diff options
| author | Claude <noreply@anthropic.com> | 2026-06-05 00:09:44 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-06-05 00:09:44 +0000 |
| commit | bc8382014a8cd8cf781a95714b2b18f4920e2dce (patch) | |
| tree | 39c6b14dc598e7d56ae66796065bf281b9fbe68d /.agent/code-map.md | |
| parent | 23e72f39ced0e051d9803415efde3729a9fd433a (diff) | |
docs(agent): fix code-map GPS section; add intent-reality audit process
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
Diffstat (limited to '.agent/code-map.md')
| -rw-r--r-- | .agent/code-map.md | 7 |
1 files changed, 5 insertions, 2 deletions
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<GpsPosition?>`. +- `locationFlow: SharedFlow<GpsPosition>(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. |
