Meshtastic-Android/conductor/archive/extract_services_20260317/plan.md
2026-03-17 14:06:01 -05:00

2.7 KiB

Implementation Plan: Extract service/worker/radio files from app

Phase 1: Preparation & Analysis [checkpoint: 72022ed]

  • Task: Identify all Android-specific classes to be moved (Services, WorkManager workers, Radio connections in app) [fd916e3]
    • Locate Service classes in app/src/main/java/org/meshtastic/app
    • Locate WorkManager Worker classes
    • Locate Radio connection classes
  • Task: Conductor - User Manual Verification 'Preparation & Analysis' (Protocol in workflow.md)

Phase 2: Extraction to core:service [checkpoint: ff47af8]

  • Task: Setup core:service module for Android and Common targets (if not already fully configured) [a114084]
  • Task: Move Android Service implementations to core:service/androidMain [965def0]
    • Move the files
    • Update imports and Koin injections
  • Task: Abstract shared service logic into core:service/commonMain [a85e282]
    • Write failing tests for abstracted shared logic (TDD Red)
    • Extract interfaces and platform-agnostic logic (TDD Green)
    • Refactor the implementations to use these shared abstractions
  • Task: Conductor - User Manual Verification 'Extraction to core:service' (Protocol in workflow.md)

Phase 3: Extraction to core:network [checkpoint: 97a5b62]

  • Task: Move Radio connection and networking files from app to core:network/androidMain [b5233cf]
    • Move the files
    • Update imports and Koin injections
  • Task: Abstract shared radio/network logic into core:network/commonMain [cc1581d]
    • Write failing tests for abstracted radio logic (TDD Red)
    • Extract platform-agnostic business logic (TDD Green)
    • Refactor implementations to use shared abstractions
  • Task: Conductor - User Manual Verification 'Extraction to core:network' (Protocol in workflow.md)

Phase 4: Desktop Integration [checkpoint: fffcedc]

  • Task: Integrate newly extracted shared abstractions into the desktop module [f39df2f]
    • Implement desktop-specific actuals or Koin bindings for the shared interfaces
    • Wire up abstracted services/radio logic in desktop Koin graph
  • Task: Conductor - User Manual Verification 'Desktop Integration' (Protocol in workflow.md)

Phase 5: Verification & Cleanup [checkpoint: a0866e0]

  • Task: Build project and verify no regressions in background processing or radio connectivity [a9edc2e]
  • Task: Verify test coverage (>80%) for all extracted and refactored code [9cff9bc]
  • Task: Remove any lingering unused dependencies or dead code in app [e39d2e2]
  • Task: Conductor - User Manual Verification 'Verification & Cleanup' (Protocol in workflow.md)

Phase: Review Fixes

  • Task: Apply review suggestions [1ae9fb6]