navi/backend/services/navi_offroute
Matt 63aea8aea5 navi-offroute: Auto classify-once / route-once (kill 4-mode contest)
PR 1 of the Auto rewrite. _route_auto no longer routes all four modes and keeps a
min-time winner; it classifies each endpoint (category map, spatial probe only as
untagged-click fallback), picks the first AUTO_MODE_PRIORITY mode in the eligible
intersection, and routes ONCE. This removes the measured ~3.03s in-town 4-mode
probe (single-mode probing line in journald) -- in-town Auto drops from ~6s toward ~1s.

Trade-off (intentional, PR1): no routing-failure fall-through and no min-time
refinement -- if the capability-picked mode cannot route, the error is returned.
The hybrid path (unchanged here, still gated on the 24km MIN_HYBRID_DISTANCE_KM)
recovers road->offroad plans. Semantic hybrid gate is PR 2.

Scope: router.py (_route_auto contest loop only) + test_offroute.py (contest tests
-> capability-pick tests + new tagged-no-spatial and untagged-spatial-once tests).
_try_hybrid_auto body, the hybrid gate, AUTO_MODE_PRIORITY/MODE_PROFILES, and all
other modules untouched. Full offroute suite: 84 passed.

Design: recon_refactor/auto-rewrite-plan.md (artifacts dir).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 05:04:48 +00:00
..
tests navi-offroute: Auto classify-once / route-once (kill 4-mode contest) 2026-05-27 05:04:48 +00:00
__init__.py Add navi-offroute service (extraction #8 — final) (#10) 2026-05-22 23:30:43 -06:00
admin.py navi-offroute: numpy-pack TrailheadIndex (memory opt #2) (#32) 2026-05-26 16:46:22 -06:00
app.py navi-offroute: enable INFO logging for per-stage timing (#35) 2026-05-26 22:02:13 -06:00
astar.py fix(offroute): smooth max_grade penalty instead of hard cliff (DEM noise robustness) 2026-05-25 15:34:18 +00:00
barriers.py Add navi-offroute service (extraction #8 — final) (#10) 2026-05-22 23:30:43 -06:00
cost.py Rename mode constants: mtb→2w, atv→4w (#20) 2026-05-25 15:33:47 -06:00
friction.py Add navi-offroute service (extraction #8 — final) (#10) 2026-05-22 23:30:43 -06:00
mvum.py MVUM Layer 0: spatial index foundation (#22) 2026-05-25 18:53:58 -06:00
mvum_annotate.py MVUM Layer 1: per-edge annotation + accurate closure counts (#23) 2026-05-25 19:32:43 -06:00
mvum_exclude.py MVUM Layer 2c: exclude_polygons for closure-avoiding routing (#24) 2026-05-25 19:54:28 -06:00
mvum_parking.py MVUM Layer 3b: OSM parking as multi-modal Auto transition candidates (#31) 2026-05-26 14:48:35 -06:00
mvum_surface_change.py MVUM Layer 3c: surface-change transition candidates (#27) 2026-05-25 23:52:08 -06:00
mvum_transitions.py navi-offroute: numpy-pack TrailheadIndex (memory opt #2) (#32) 2026-05-26 16:46:22 -06:00
offroute_route.py MVUM Layer 3b: OSM parking as multi-modal Auto transition candidates (#31) 2026-05-26 14:48:35 -06:00
router.py navi-offroute: Auto classify-once / route-once (kill 4-mode contest) 2026-05-27 05:04:48 +00:00
trails.py Add navi-offroute service (extraction #8 — final) (#10) 2026-05-22 23:30:43 -06:00