Dokumen ini mencatat tahap implementasi pada versi yang disebutkan. Untuk status akhir seluruh fitur, baca audit implementasi.
#33 — live replanning
Android build 0.12.0-live-replan; physical TECNO KF8; 2026-09-19.
Starting navigation for a charging-plan leg binds guidance to that plan and its explicitly completed destinations. A new durable trip SOC reading, an explicitly completed charging session, or confirmed off-route status requests an updated charging plan from the current position. Charging remains open until the user supplies its final SOC. Charger proximity never completes a charge or advances mandatory destinations. Generic route navigation without a charging-plan binding remains independent.
The existing location foreground service owns the calculation worker and its deadline. The worker runs the bundled planner with native online HTTPS routing/elevation, independently of the activity and screen. It loads the complete cached charging catalogue and avoidance preferences. Ending navigation cancels the worker. It does not implement offline routing.
The selected reserve consent is retained. Ordered unvisited destinations remain mandatory; a return trip still ends at its original origin, and a one-way trip retains the exit to a charging point. A successful current result atomically replaces native guidance, invalidates old location generations/speech claims, preserves mute/synthetic flags and waits for a fresh location. Meaningful changes to charging points, charging targets and feasibility appear in the UI and Android notifications. Failed calculations keep previous recommendations and their original timestamp visibly stale, including after reopening the application.
Actual SOC and travel evidence
The recorder exposes the latest explicit SOC/charge reading from durable events without rebuilding/copying the whole history on each location update. A location fix never invents a new reading. Replanning requires a fresh precise position. To account for movement after a reading, the native journey trace requires a location anchor no older than five seconds at the reading, accumulates every positive displacement and climb, and invalidates gaps, implausible jumps, poor fixes or missing altitude on movement. An unanchored reading does not become complete merely because a first fix arrives later.
Complete travelled distance/ascent feeds the existing conservative energy model. Estimated departure SOC is labelled separately from the original manual observation, which remains immutable. This is a model based on GPS altitude and the selected motor/payload assumptions, not live vehicle telemetry or proven field accuracy. Missing evidence asks for a new reading instead of assuming the previous SOC is current. Restarted navigation requires explicit resume and a newly anchored reading when the trace cannot be reconstructed.
Concurrency and ownership
Navigation and recording share one platform location listener. The fastest consumer determines its requested cadence: 2 seconds / 5 m with guidance, 5 seconds / 5 m for recording alone. Consumers retain independent delivery intervals, freshness checks and lifecycle ownership. Removing one owner preserves the other; removing the final owner removes the platform listener.
Off-route/retry attempts are bounded to one per minute; explicit new SOC/charging observations can supersede an in-flight calculation. Jobs have a three-minute deadline and are closed on navigation shutdown. Foreground and worker plan writes use shared per-file locking, revision checks and compare-and-write against the pending document. Responses from superseded calculations cannot overwrite current results. Manual plan edits clear the previous live-plan lineage and change the binding revision; profile changes also invalidate an older worker/binding. Catalogue changes invalidate a running worker snapshot.
Verification
- 54 Node tests pass, including ten live-replan boundary tests: reserve preservation, new SOC/current origin, ordered return and exit destinations, offline retention, stale input, response races, charger/feasibility changes, cadence, consumption since a reading, manual plan edits and competing foreground/background calculations.
- 19 JVM tests pass: nine navigation, six recorder, two routing transport and two journey trace tests. Trace regressions include twenty consecutive movements below five metres with ascent, an unanchored reading, missing altitude and gaps. Android debug build and lint pass.
- Physical TECNO synthetic replay verifies one actual
dumpsys locationlistener for simultaneous navigation/recording, independent end/pause/resume behavior, and no listener after the final owner stops. - Real online routing/elevation completed with the screen off and replaced native guidance. The initial concurrent catalogue refresh correctly superseded a calculation; retry after refresh succeeded.
- The final anchored-flow replay verifies an initial unanchored SOC asks for a new reading; subsequent anchored SOC inputs and explicit charge completion automatically replan with the screen off. An open charge holds calculation. Off-route replay waits for cadence, debits estimated consumption since the reading, replaces guidance and retains one location listener.
- Standards and Spec reviewers identified slow-motion loss, unanchored completeness, obsolete live lineage after manual edits and one-sided publication protection. These were fixed, regression-tested and re-reviewed with no remaining blockers.
Offline physical replay disabled Wi-Fi/mobile data after a successful plan, then supplied a new anchored SOC. The worker returned stale without replacing guidance; the previous result/timestamp and new actual observation remained durable. Reopening displayed the retained itinerary and explicit old-result warning. Radios and fixtures were restored. Evidence: research/runtime/issue33-offline-device.json and check-offline-replan-device.py.
Device evidence and helpers are ignored under research/runtime/: issue33-location-device.json, issue33-location-dumpsys.txt, issue33-worker-device.json, issue33-automatic-device.json, issue33-offroute-device.json, and their check-*-device.py scripts. Synthetic fixtures, app databases, plan/catalogue documents, binding preferences, mock-provider settings and permissions are restored. These are integration checks, not road accuracy or battery savings measurements; energy benchmarking belongs to #37.