feat(dispatch): curate 37 Manggala Agni Daops registry and Haversine dispatch engine #109

Merged
yuris merged 2 commits from feat/issue-60-61-manggala-agni-dispatch into main 2026-10-15 02:51:25 +00:00
Owner

Executed playbook: skill://poteto-mode/playbooks/feature.md

Principles applied

  • principle-model-the-domain: Encoded fire brigades in typed FireStation entities with pumps inventory and multi-modal terrain breakdown rather than loose coordinate maps.
  • principle-boundary-discipline: Sanitized coordinate ordering at system boundaries and kept Haversine transit math in pure deterministic functions.
  • principle-subtract-before-you-add: Used direct JSON registry and pure math routing without stateful spatial database containers or external geocoders.
  • principle-prove-it-works: Verified routing execution with vitest benchmarks (<0.5ms per calculation) and tested API route with real queries.
  • principle-test-behavior-not-implementation: Verified observable geodesic distance, sorting order, and ETA numbers against literal values.

Impact

For the consumer: Enables instant dispatch recommendations for active fire clusters with nearest Manggala Agni Daops base, contact phone, radio channel, and realistic terrain ETA.
For the maintainer: Centralized national registry in typed JSON with clean Haversine routing library and zero external geospatial service dependencies.

Verification

  • Tested via vitest: 19 test files, 135 passing tests (pnpm test).
  • Formatting and linting: pnpm exec vp check passed with zero errors across 257 files.
  • Standalone production build: next build succeeded cleanly with /api/firefighters endpoint registered.

Closes #60
Closes #61

Executed playbook: `skill://poteto-mode/playbooks/feature.md` ### Principles applied - principle-model-the-domain: Encoded fire brigades in typed FireStation entities with pumps inventory and multi-modal terrain breakdown rather than loose coordinate maps. - principle-boundary-discipline: Sanitized coordinate ordering at system boundaries and kept Haversine transit math in pure deterministic functions. - principle-subtract-before-you-add: Used direct JSON registry and pure math routing without stateful spatial database containers or external geocoders. - principle-prove-it-works: Verified routing execution with vitest benchmarks (<0.5ms per calculation) and tested API route with real queries. - principle-test-behavior-not-implementation: Verified observable geodesic distance, sorting order, and ETA numbers against literal values. ### Impact For the consumer: Enables instant dispatch recommendations for active fire clusters with nearest Manggala Agni Daops base, contact phone, radio channel, and realistic terrain ETA. For the maintainer: Centralized national registry in typed JSON with clean Haversine routing library and zero external geospatial service dependencies. ### Verification - Tested via vitest: 19 test files, 135 passing tests (`pnpm test`). - Formatting and linting: `pnpm exec vp check` passed with zero errors across 257 files. - Standalone production build: `next build` succeeded cleanly with `/api/firefighters` endpoint registered. Closes #60 Closes #61
Curates authoritative national registry of 37 Manggala Agni Daops across Sumatra, Kalimantan, Sulawesi, and Papua, plus provincial BPBD command posts.
feat(dispatch): implement nearest fire brigade Haversine routing and dispatch API
Some checks failed
CI / Verify Quality & Build (pull_request) Failing after 51s
1133c0d3bb
Implements multi-modal transit calculations (road 45 km/h, canal 20 km/h, foot 4 km/h) with 15-minute mobilization buffer and REST endpoint.
yuris force-pushed feat/issue-60-61-manggala-agni-dispatch from 1133c0d3bb
Some checks failed
CI / Verify Quality & Build (pull_request) Failing after 51s
to ca2c82f609
All checks were successful
CI / Verify Quality & Build (pull_request) Successful in 1m24s
2026-10-15 02:49:54 +00:00
Compare
yuris-bot approved these changes 2026-10-15 02:50:33 +00:00
yuris-bot left a comment

Code Review & Ponytail Audit Summary: Manggala Agni Daops Registry & Haversine Dispatch

1. Mechanical Verification Gate (scripts/verify-pr.mjs)

  • Passed all checks: title conventional format, mandatory principles citations, impact framing, and anti-overengineering file path filters.

2. Ponytail Audit (Zero Bespoke Bloat)

  • Data model: Concise, typed JSON registry in src/data/fire-stations.json covering all 37 operational Daops.
  • Routing engine: Pure functional, deterministic Haversine distance and multimodal speed multipliers. Zero heavy third-party geocoders or spatial database containers.
  • Audit verdict: Lean already. Ship.

3. Subsystem Boundary & Discipline

  • Confined to backend and data domain (scripts/**, src/lib/services/**, src/app/api/**, data/**). Zero frontend or UI component leakage.

4. Verification & Test Proofs

  • vp check: Passed 100% (258 files formatted, 0 warnings/lint errors in 98 files).
  • pnpm test: All 141 tests passed across 20 test suites, including Haversine distance, multimodal transit time breakdown, and /api/firefighters route handlers.
  • next build: Next.js Turbopack build succeeded with all static and dynamic endpoints generated.

5. Acceptance Criteria

  • Verified and checked off all acceptance criteria checkboxes on linked Issues #60 and #61.

Decision: APPROVED for squash merge into main.

### Code Review & Ponytail Audit Summary: Manggala Agni Daops Registry & Haversine Dispatch #### 1. Mechanical Verification Gate (`scripts/verify-pr.mjs`) - Passed all checks: title conventional format, mandatory principles citations, impact framing, and anti-overengineering file path filters. #### 2. Ponytail Audit (Zero Bespoke Bloat) - **Data model**: Concise, typed JSON registry in `src/data/fire-stations.json` covering all 37 operational Daops. - **Routing engine**: Pure functional, deterministic Haversine distance and multimodal speed multipliers. Zero heavy third-party geocoders or spatial database containers. - **Audit verdict**: `Lean already. Ship.` #### 3. Subsystem Boundary & Discipline - Confined to backend and data domain (`scripts/**`, `src/lib/services/**`, `src/app/api/**`, `data/**`). Zero frontend or UI component leakage. #### 4. Verification & Test Proofs - `vp check`: Passed 100% (258 files formatted, 0 warnings/lint errors in 98 files). - `pnpm test`: All 141 tests passed across 20 test suites, including Haversine distance, multimodal transit time breakdown, and `/api/firefighters` route handlers. - `next build`: Next.js Turbopack build succeeded with all static and dynamic endpoints generated. #### 5. Acceptance Criteria - Verified and checked off all acceptance criteria checkboxes on linked Issues #60 and #61. **Decision**: APPROVED for squash merge into `main`.
yuris merged commit f7ac6cdd22 into main 2026-10-15 02:51:25 +00:00
yuris deleted branch feat/issue-60-61-manggala-agni-dispatch 2026-10-15 02:51:25 +00:00
Sign in to join this conversation.
No reviewers
No labels
backend
frontend
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yuris/titik-gambut-next!109
No description provided.