diff --git a/specs/001-local-mesh-discovery/tasks.md b/specs/001-local-mesh-discovery/tasks.md index 4536d0c09..0e2261f44 100644 --- a/specs/001-local-mesh-discovery/tasks.md +++ b/specs/001-local-mesh-discovery/tasks.md @@ -15,21 +15,21 @@ ## Phase 1 — Setup (module creation, navigation routes, DI) -- [ ] **D001** Create `feature/discovery/` with `meshtastic.kmp.feature` + serialization plugin setup, source sets, namespace, and baseline dependencies. -- [ ] **D002** Add `FeatureDiscoveryModule` with `@Module` + `@ComponentScan("org.meshtastic.feature.discovery")`. -- [ ] **D003** Register the module in `settings.gradle.kts` and include it in Android / Desktop Koin roots. -- [ ] **D004** Add typed discovery routes to `core/navigation/src/commonMain/kotlin/org/meshtastic/core/navigation/Routes.kt`. +- [X] **D001** Create `feature/discovery/` with `meshtastic.kmp.feature` + serialization plugin setup, source sets, namespace, and baseline dependencies. +- [X] **D002** Add `FeatureDiscoveryModule` with `@Module` + `@ComponentScan("org.meshtastic.feature.discovery")`. +- [X] **D003** Register the module in `settings.gradle.kts` and include it in Android / Desktop Koin roots. +- [X] **D004** Add typed discovery routes to `core/navigation/src/commonMain/kotlin/org/meshtastic/core/navigation/Routes.kt`. - [X] **D005** Extend `DeepLinkRouter` and navigation tests for discovery entry paths. -- [ ] **D006** Add the Settings > Advanced entry point and placeholder discovery screen wiring. +- [X] **D006** Add the Settings > Advanced entry point and placeholder discovery screen wiring. **Phase dependency**: none **Exit criteria**: the app can navigate to an empty/placeholder Local Mesh Discovery screen and compile across KMP targets. ## Phase 2 — Data model (Room entities, DAOs, migrations) -- [ ] **D007** [P] Add `DiscoverySessionEntity`, `DiscoveryPresetResultEntity`, and `DiscoveredNodeEntity` under `core:database`. -- [ ] **D008** [P] Add discovery DAO interfaces and relation models. -- [ ] **D009** Register entities / DAOs in `MeshtasticDatabase` and bump the schema version. +- [X] **D007** [P] Add `DiscoverySessionEntity`, `DiscoveryPresetResultEntity`, and `DiscoveredNodeEntity` under `core:database`. +- [X] **D008** [P] Add discovery DAO interfaces and relation models. +- [X] **D009** Register entities / DAOs in `MeshtasticDatabase` and bump the schema version. - [ ] **D010** Add DAO tests for insert, relation loading, sort order, and cascade deletion. - [ ] **D011** Add migration coverage for the new schema version. @@ -40,11 +40,11 @@ - [ ] **D012** [P] Add discovery prefs contract in `core:repository` and DataStore implementation in `core:prefs`. - [X] **D013** [P] Implement `DiscoveryScanState` / state machine in `commonMain`. -- [ ] **D014** [P] Implement `DiscoveryScanCoordinator` to validate inputs, snapshot home preset, switch presets, and manage dwell timing. -- [ ] **D014b** [P] Implement `DiscoveryViewModel` in `commonMain` to expose scan state, session data, and user actions to the UI layer. Wire to `DiscoveryScanCoordinator` and `DiscoveryRepository`. -- [ ] **D015** [P] Reuse the existing radio config/admin path to apply `Config.LoRaConfig` preset changes. -- [ ] **D016** [P] Observe shared connection state and pause/resume around BLE reconnects without introducing a custom reconnect loop. -- [ ] **D017** [P] Persist scan lifecycle milestones (session start, preset start, stop/cancel/fail, restore result). +- [X] **D014** [P] Implement `DiscoveryScanCoordinator` to validate inputs, snapshot home preset, switch presets, and manage dwell timing. +- [X] **D014b** [P] Implement `DiscoveryViewModel` in `commonMain` to expose scan state, session data, and user actions to the UI layer. Wire to `DiscoveryScanCoordinator` and `DiscoveryRepository`. +- [X] **D015** [P] Reuse the existing radio config/admin path to apply `Config.LoRaConfig` preset changes. +- [X] **D016** [P] Observe shared connection state and pause/resume around BLE reconnects without introducing a custom reconnect loop. +- [X] **D017** [P] Persist scan lifecycle milestones (session start, preset start, stop/cancel/fail, restore result). - [X] **D018** Add unit tests for normal flow, reconnect delays, timeout, cancel, and home-preset restore failure. **Depends on**: D007-D009 @@ -52,10 +52,10 @@ ## Phase 4 — Packet collection (integrate with existing packet pipeline) -- [ ] **D019** [P] Implement `DiscoveryPacketCollector` that listens to shared packet / node / neighbor flows. +- [X] **D019** [P] Implement `DiscoveryPacketCollector` that listens to shared packet / node / neighbor flows. - [ ] **D020** [P] Trigger neighbor info requests at dwell boundaries through the existing command path. -- [ ] **D021** [P] Aggregate per-preset metrics (packet count, telemetry count, neighbor count, unique nodes, best distance, link quality). -- [ ] **D022** [P] Upsert `DiscoveredNodeEntity` rows with deduped per-preset observations. +- [X] **D021** [P] Aggregate per-preset metrics (packet count, telemetry count, neighbor count, unique nodes, best distance, link quality). +- [X] **D022** [P] Upsert `DiscoveredNodeEntity` rows with deduped per-preset observations. - [ ] **D023** Add tests for duplicate packets, nodes without positions, and neighbor-info-only sightings. **Depends on**: D014-D017 @@ -64,9 +64,9 @@ ## Phase 5 — Map visualization (CompositionLocal map, markers, topology) - [ ] **D024** [P] Build shared discovery map presentation models and preset filter state in `commonMain`. -- [ ] **D025** [P] Implement `DiscoveryMapScreen` and node detail sheet/cards using Compose Multiplatform. Verify that distance displays use `MetricFormatter` / `Node.distance(...)` shared formatting (FR-016). -- [ ] **D026** [P] Reuse or extend platform map providers for discovery overlays on Android. -- [ ] **D027** [P] Provide Desktop map fallback (provider or placeholder/list hybrid) that does not break the feature. +- [X] **D025** [P] Implement `DiscoveryMapScreen` and node detail sheet/cards using Compose Multiplatform. Verify that distance displays use `MetricFormatter` / `Node.distance(...)` shared formatting (FR-016). +- [X] **D026** [P] Reuse or extend platform map providers for discovery overlays on Android. +- [X] **D027** [P] Provide Desktop map fallback (provider or placeholder/list hybrid) that does not break the feature. - [ ] **D028** Add UI tests for preset filtering, mapped/unmapped counts, and topology toggle behavior. **Depends on**: D019-D022 @@ -76,7 +76,7 @@ - [X] **D029** [P] Implement `DiscoveryRankingEngine` deterministic heuristic in `commonMain`. - [ ] **D030** [P] Build summary presentation models for overview cards, comparison table, and tie explanations. -- [ ] **D031** [P] Implement `DiscoverySummaryScreen` with per-preset ranking, warnings, and partial-session handling. +- [X] **D031** [P] Implement `DiscoverySummaryScreen` with per-preset ranking, warnings, and partial-session handling. - [ ] **D032** Add tests for ranking ties, failed presets, and deterministic fallback output. **Depends on**: D021-D022 @@ -84,10 +84,10 @@ ## Phase 7 — AI recommendation (Gemini Nano integration) -- [ ] **D033** [P] Define `DiscoveryRecommendationEngine` and result contracts in `commonMain`. -- [ ] **D034** [P] Bind `RuleBasedDiscoveryRecommendationEngine` as the always-available default. -- [ ] **D035** [P] Implement Android Google-flavor Gemini Nano adapter and availability checks. -- [ ] **D036** [P] Add opt-in UI and non-blocking fallback behavior. +- [X] **D033** [P] Define `DiscoveryRecommendationEngine` and result contracts in `commonMain`. +- [X] **D034** [P] Bind `RuleBasedDiscoveryRecommendationEngine` as the always-available default. +- [X] **D035** [P] Implement Android Google-flavor Gemini Nano adapter and availability checks. +- [X] **D036** [P] Add opt-in UI and non-blocking fallback behavior. - [ ] **D037** Add tests for supported / unsupported / failure cases. **Depends on**: D029-D031 @@ -95,10 +95,10 @@ ## Phase 8 — Session history (list, detail, delete) -- [ ] **D038** [P] Implement `DiscoveryHistoryScreen` with newest-first sessions and status chips. -- [ ] **D039** [P] Implement session detail routing and history-to-detail navigation. -- [ ] **D040** [P] Implement delete flow with cascade validation. -- [ ] **D041** Ensure historical sessions load entirely from Room without requiring a live radio connection. +- [X] **D038** [P] Implement `DiscoveryHistoryScreen` with newest-first sessions and status chips. +- [X] **D039** [P] Implement session detail routing and history-to-detail navigation. +- [X] **D040** [P] Implement delete flow with cascade validation. +- [X] **D041** Ensure historical sessions load entirely from Room without requiring a live radio connection. - [ ] **D042** Add tests for history sorting, deep-link session load, and delete behavior. **Depends on**: D007-D010, D029-D031 @@ -106,10 +106,10 @@ ## Phase 9 — Polish (PDF export, accessibility, edge cases) -- [ ] **D043** [P] Implement Android share / PDF export and Desktop save/export fallback. +- [X] **D043** [P] Implement Android share / PDF export and Desktop save/export fallback. - [ ] **D044** [P] Add accessibility polish: semantics, progress announcements, disabled-preset explanations, and large-screen layout checks. - [ ] **D045** [P] Finalize 2.4 GHz hardware gating using `DeviceHardwareRepository` + current radio metadata. -- [ ] **D046** [P] Add logging / diagnostics and make sure the feature is debuggable through existing app logging tools. +- [X] **D046** [P] Add logging / diagnostics and make sure the feature is debuggable through existing app logging tools. - [ ] **D047** [P] Add strings, icons, and docs updates (`core/resources`, deep-link docs, quickstart references). - [ ] **D048** Run targeted and full verification commands.