From bc8382014a8cd8cf781a95714b2b18f4920e2dce Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 5 Jun 2026 00:09:44 +0000 Subject: docs(agent): fix code-map GPS section; add intent-reality audit process MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit code-map.md: - Correct the GPS gotcha section: DeviceGpsProvider uses LocationManager (not FusedLocationProviderClient) and is dead code — never instantiated - Remove the false claim that MainViewModel shows a "No GPS" banner - Document locationFlow replay=1 staleness behaviour accurately - Document ACTION_STOP_UPDATES background-idle behaviour added in this session config.md: - Add review-intent-reality.md to the directory table - Add two Living Documentation mandates: code-map accuracy obligation and intent-reality audit cadence review-intent-reality.md (new): - Structured audit prompt covering 6 categories: code-map vs implementation, dead code with documented intent, lying comments, architectural invariants, design-doc vs shipped code, worklog vs current state - Standardised finding format (doc claim / code reality / severity / fix) - Post-review commit convention https://claude.ai/code/session_0126zvB69ccVoFtx2o96oaE2 --- .agent/code-map.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to '.agent/code-map.md') diff --git a/.agent/code-map.md b/.agent/code-map.md index eb2f564..1a36542 100644 --- a/.agent/code-map.md +++ b/.agent/code-map.md @@ -359,8 +359,11 @@ CI (`android.yml`) triggers only on pushes to `main`. Firebase App Distribution ## 8. Context Tips & Gotchas ### Navigation / GPS -- `DeviceGpsProvider` uses `FusedLocationProviderClient`. External GPS comes via NMEA TCP/UDP through `NmeaStreamManager` → `NmeaParser` → `GpsProvider` interface. -- GPS fix is stale after 10 s — `MainViewModel` shows red "No GPS" banner. +- `LocationService` (foreground service) uses `FusedLocationProviderClient` for Android GPS. External GPS comes via NMEA TCP/UDP through `NmeaStreamManager` → `NmeaParser`, emitted on `LocationService.nmeaGpsPositionFlow`. +- `LocationService.recomputeBestPosition()` fuses NMEA + Android GPS: prefers NMEA if < 5 s old, falls back to Android. Result is `bestPosition: StateFlow`. +- `locationFlow: SharedFlow(replay=1)` carries raw Android fixes. **`replay=1` means new subscribers immediately receive the last cached position regardless of age — there is no staleness expiry.** Consumers must check `gpsData.timestampMs` if they care about age. +- `DeviceGpsProvider` implements `GpsProvider` and has a `fixLostRunnable` (10 s timeout), but is **dead code** — it is never instantiated. `LocationService` does not use the `GpsProvider` interface. There is no "No GPS" banner. +- Background location: `throttleLocationIfIdle()` (called on `onPause`) sends `ACTION_STOP_UPDATES` to stop `fusedLocationClient` when neither recording nor anchor-watch is active. `restoreLocationMode()` (called on `onResume`) restarts appropriate mode. ### NMEA - `NmeaStreamManager` handles connection lifecycle (reconnect on failure). Don't manage socket lifecycle elsewhere. -- cgit v1.2.3