Skip to content

refactor: replace SensorBox architecture - #44

Closed
Foxpace wants to merge 2 commits into
codex/sensorbox-refactor-30-remove-modulesfrom
sensorbox-refactor
Closed

refactor: replace SensorBox architecture#44
Foxpace wants to merge 2 commits into
codex/sensorbox-refactor-30-remove-modulesfrom
sensorbox-refactor

Conversation

@Foxpace

@FoxpaceFoxpace commented Aug 15, 2026

Copy link
Copy Markdown
Owner

This PR replaces the 30 lower layers in the original SensorBox refactor stack, PRs #14 through #43. PR #44 is now the only review target.

The base is master, so GitHub's Files changed view shows the final repository state. Intermediate interfaces and implementations removed by the architecture pass are not part of the review diff.

What changed

  • Added the pure Kotlin core-common and recording-core modules.
  • Standardized expected outcomes on AppResult<T> with stable, data-only application errors.
  • Added private rotating diagnostics that users can view, copy, share, export, or clear from Settings.
  • Kept Android recording adapters in sensorservices and removed its Wear transport dependency.
  • Replaced the Wear command protocol with strict version 2 prepare, commit, abort, stop, and correlated acknowledgements.
  • Added phone-owned, all-or-nothing paired recording coordination with stable source order, retries, timeouts, and compensation.
  • Split phone presentation state by onboarding, recording, and settings workflows.
  • Moved command behavior into typed phone and watch handlers, leaving listener services as decode-and-dispatch boundaries.
  • Added ADRs and the implementation checklist in docs/architecture-refactor-plan.md.

Earlier review feedback

PR #14 contains the only review threads in the old stack. Its AppDiagnostics threads target a class deleted by this change and replaced by FileDiagnostics plus the Settings diagnostics flow. The preference grouping and NativeDocumentStorage API notes still refer to current code, so they remain visible in #14 and should be judged against their current implementations in this PR.

Validation

  • ./gradlew testDebugUnitTest lintDebug assembleDebugAndroidTest assembleDebug detekt
  • ./gradlew :core-common:test :recording-core:test
  • tools/emulator/run_phone_sensor_test.sh: OK (1 test)
  • Wear-to-phone APKs and instrumentation suites compile. The runtime workflow reaches its pairing precondition, but SensorBox_Wear_API_37 still needs one-time phone/watch pairing in Android Studio before tools/emulator/run_wear_sync_test.sh can run.

@FoxpaceFoxpace changed the title sensorbox refactordocs: update refactor documentation and emulator toolsAug 15, 2026
@Foxpace
Foxpace marked this pull request as ready for review August 15, 2026 21:51
@FoxpaceFoxpace changed the title docs: update refactor documentation and emulator toolsrefactor: replace SensorBox architectureAug 19, 2026
@FoxpaceChatGPT Codex Connector

Copy link
Copy Markdown
OwnerAuthor

Superseded by #46, which targets master and shows the final current tree. Closing this stacked layer so review stays on the consolidated diff; this PR remains available as history.

@FoxpaceFoxpace closed this Aug 19, 2026
@FoxpaceChatGPT Codex Connector

Copy link
Copy Markdown
OwnerAuthor

Stack restored at the author's request. This PR is again part of the original 31-layer refactor chain. The architecture work continues as stacked PRs #47 through #54; consolidated PR #46 is superseded.

@FoxpaceChatGPT Codex Connector

Copy link
Copy Markdown
OwnerAuthor

GitHub would not reopen this PR after the required branch restoration. It is replaced by #55 on the same sensorbox-refactor head and original base. The architecture stack continues in #47 through #54.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Foxpace