From 5d358cd570075d36a61f9a37bb80c64f8a0a7e2a Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Fri, 3 Apr 2026 08:05:24 +0000 Subject: chore(stories): add claudomator stories for unused results and faked data 6 stories covering findings from codebase audit: - ct-remove-mock-tidal: remove random fake tidal currents near Solent - ct-wire-tidal-to-map: wire tidalCurrentState to MapHandler (never called) - ct-wire-anchor-to-map: wire anchorWatchState to map overlay (text-only) - ct-show-wind-direction: display TWD fetched but not shown in sheet - ct-show-swell-direction: display swell dir fetched but not shown - ct-fix-weather-fallback: remove silent SF fallback in WeatherActivity Co-Authored-By: Claude Sonnet 4.6 --- scripts/.claude/ct-remove-mock-tidal.yaml | 83 +++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 scripts/.claude/ct-remove-mock-tidal.yaml (limited to 'scripts/.claude/ct-remove-mock-tidal.yaml') diff --git a/scripts/.claude/ct-remove-mock-tidal.yaml b/scripts/.claude/ct-remove-mock-tidal.yaml new file mode 100644 index 0000000..86d4e76 --- /dev/null +++ b/scripts/.claude/ct-remove-mock-tidal.yaml @@ -0,0 +1,83 @@ +name: "Remove MockTidalCurrentGenerator" +description: "LocationService generates random fake tidal current arrows near a hardcoded Solent coordinate (50.8, -1.3) every 60 seconds regardless of boat position. Remove the mock generator; leave the layer empty until a real tidal API is integrated." +agent: + model: "sonnet" + working_dir: "/workspace/nav" + instructions: | + Context + ------- + In LocationService.onCreate() there is a coroutine loop: + (android-app/app/src/main/kotlin/org/terst/nav/LocationService.kt, lines ~113-119) + + serviceScope.launch { + while (true) { + val currents = MockTidalCurrentGenerator.generateMockCurrents() + _tidalCurrentState.update { it.copy(currents = currents) } + kotlinx.coroutines.delay(60000) + } + } + + MockTidalCurrentGenerator.generateMockCurrents() produces 10 TidalCurrent objects with: + - Random speedKnots (0–5 kn) + - Random directionDegrees (0–360°) + - Positions scattered within 0.05° of lat=50.8, lon=-1.3 (Solent, UK) + regardless of actual boat position. + (android-app/app/src/main/kotlin/org/terst/nav/MockTidalCurrentGenerator.kt) + + TidalCurrentState has an isVisible flag (defaults false) and a currents list. + MapHandler.updateTidalCurrents() respects isVisible — when false it clears the layer. + + Goal + ---- + 1. Remove the mock generator loop from LocationService.onCreate() + 2. Delete MockTidalCurrentGenerator.kt + 3. Ensure _tidalCurrentState starts with isVisible=false and empty currents (the default) + 4. Remove the import of MockTidalCurrentGenerator from LocationService + + Do NOT remove TidalCurrentState, _tidalCurrentState, or the tidalCurrentState public flow — + those are needed when a real tidal API is added later. + Do NOT remove ACTION_TOGGLE_TIDAL_VISIBILITY handling in onStartCommand — keep the + visibility toggle working for future use. + + Step 1 — Remove the mock loop from LocationService + --------------------------------------------------- + In android-app/app/src/main/kotlin/org/terst/nav/LocationService.kt: + + Delete the entire block (including the comment): + // Mock tidal current data generator + serviceScope.launch { + while (true) { + val currents = MockTidalCurrentGenerator.generateMockCurrents() + _tidalCurrentState.update { it.copy(currents = currents) } + kotlinx.coroutines.delay(60000) // Update every minute + } + } + + Remove the import: + import org.terst.nav.MockTidalCurrentGenerator + + Step 2 — Delete MockTidalCurrentGenerator.kt + --------------------------------------------- + Delete android-app/app/src/main/kotlin/org/terst/nav/MockTidalCurrentGenerator.kt + + Step 3 — Build + -------------- + cd android-app && ANDROID_HOME=/opt/android-sdk ./gradlew assembleDebug 2>&1 | tail -5 + Confirm BUILD SUCCESSFUL with no references to MockTidalCurrentGenerator remaining. + + Step 4 — Commit and push + ------------------------ + git add -A + git commit -m "chore: remove MockTidalCurrentGenerator + + The mock generator was producing 10 random tidal current arrows near a + hardcoded Solent coordinate (50.8, -1.3) every 60 seconds regardless of + boat position. Remove it entirely. The tidal overlay infrastructure + (TidalCurrentState, mapHandler.updateTidalCurrents) is retained for when + a real tidal current API is integrated." + git push github main && git push local main +timeout: "15m" +tags: + - "cleanup" + - "tidal" + - "mock-data" -- cgit v1.2.3