Dokumen ini mencatat tahap implementasi pada versi yang disebutkan. Untuk status akhir seluruh fitur, baca audit implementasi.
#31 — native trip recording and immutable actual history
Android build 0.10.0-recording, physical TECNO KF8. Validation date: 2026-09-19.
Recording is owned by a non-exported Android location foreground service. The visible app initiates the session after location permission; its ongoing notification provides a pause action. No background-location permission, PC routing backend, boot restart, screen wake lock or automatic resurrection is used. Location callbacks write individual SQLite event rows rather than rewriting the trip archive. The WebView only sends bounded commands and reads status/history.
Trips support start, pause, explicit resume and end. The archive records the vehicle/payload snapshot, manual SOC observations, actual leg boundaries, GPS samples with accuracy/time, and charging start/end SOC, elapsed wall time and known/unknown power. Charging pauses location recording and must be finished explicitly before resuming. Charging location is labelled as the last recorded location and retains its timestamp, rather than claiming it is a fresh fix.
Each actual leg can copy the chosen pre-leg prediction from a saved plan, including model version and assumptions. Plan legs now retain those fields at calculation time. Subsequent profile, model or observation changes do not rewrite the copied prediction. Existing plans without model metadata remain explicitly unknown. No prediction is invented when the user leaves the optional plan-leg selection blank.
Events are committed before they affect visible durable state. A new process changes a previously active trip to interrupted and requires explicit resume; it does not register location from a stale checkpoint. Pause/end reject late callbacks. Fix deduplication survives recording generations and process restart within the same Android boot; a new boot can restart the elapsed clock. The service also rejects fixes timestamped before the current recording interval, older than 30 seconds, out of order, invalid or worse than 100 m accuracy. Missing fixes produce an uncertain location status, not interpolated observations.
Mock-provider fixes permanently mark their trip synthetic. The controlled replay receiver exists only in debug builds, requires the shell/DUMP permission plus Android mock-location app-op, and requires a trip already marked synthetic. It is absent from release source sets.
Automated verification:
- Five public TripRecorder tests cover lifecycle/late callbacks, immutable prediction copies, interrupted process recovery, charging persistence, failed writes, duplicate fixes across resume/restart, boot-clock reset, and mock data marking. Two existing routing-transport JVM tests also pass.
- 44 Node tests pass; JavaScript syntax, Android debug assembly and lint pass.
- Standards review found late pre-resume fixes and failed-pause/end token invalidation; both were fixed and independently re-reviewed. Spec review found cross-resume fix duplication; boot-aware deduplication and regression tests resolve it. No remaining code-level findings.
Physical-device evidence from controlled Android mock-provider replay:
- Denied location permission leaves recording idle; granting permission allows the visible-app start.
- Samples arrive with the screen off. After 35 seconds without new fixes, the native status becomes location lost. Pausing stops acceptance; resuming preserves the same trip and rejects a replay timestamped before resume.
- A charging session retains SOC 70% → 75% and 800 W, then a new actual leg can begin.
- Force-stop/reopen shows interrupted, accepts no samples until explicit resume, and retains previous observations. End stops acceptance; subsequent restart retains ended history.
- The UI displays both actual legs and the simulation label. Replay is not evidence of road GPS accuracy or battery savings.
Ignored runtime evidence: research/runtime/issue31-device.json. Synthetic database/profile changes, mock-provider registration/app-op and location permission are restored after testing. TECNO Android 11 cannot validate Android 13 notification denial or Android 14–15 foreground launch enforcement; SDK guards, manifest declarations and lint are covered, newer physical-device validation remains a platform limit.
Implementation references: foreground service launch, LocationManager API, and navigation lifecycle decision. Screen-off recording uses the same documented foreground-location permission model; navigation/TTS remains #32.