Skip to content

Architecture review: remediate core and recording runtime - #97

Open
Foxpace wants to merge 1 commit into
architecture/39-cleanup-architecture-docsfrom
architecture/40-review-runtime-remediation
Open

Architecture review: remediate core and recording runtime#97
Foxpace wants to merge 1 commit into
architecture/39-cleanup-architecture-docsfrom
architecture/40-review-runtime-remediation

Conversation

@Foxpace

Copy link
Copy Markdown
Owner

Summary

Completes the core and recording-runtime half of the architecture review. This PR is stacked on architecture/39-cleanup-architecture-docs; PR 2 will target this branch.

  • Replaces diagnostics with composite file and Logcat routing, seven-calendar-day retention, stale-file pruning, ordered export/clear, explicit locks, and atomic uncaught-handler installation.
  • Splits preferences into onboarding, recording, and display groups without changing persisted keys or defaults.
  • Introduces injectable document/session storage, a shared epoch clock, and an Android activity-recognition platform adapter.
  • Flattens recording preparation and storage flows, surfaces sensor writer failures immediately, and preserves failure propagation from close.
  • Replaces hand-built metadata JSON with serializable models while retaining the existing schema.

Compatibility

  • DataStore keys and defaults are unchanged.
  • Metadata JSON keys and value types are unchanged.
  • Existing AppResult behavior is retained.
  • Public preference access is grouped under onboarding, recording, and display.

Verification

  • ./gradlew test detekt lint
  • git diff --check
  • Focused tests cover diagnostics retention/pruning/routing/concurrency/export/clear/write isolation, preference compatibility and cancellation, document and measurement storage, activity-recognition lifecycle, sensor writer failures, metadata serialization, and early preparation failures.

Inline review disposition

#Original reviewDisposition
1PR 14Implemented explicit file-lock naming.
2PR 14Removed redundant volatile.
3PR 14Implemented composite file and Logcat diagnostics.
4PR 14Implemented explicit handler-lock naming.
5PR 14Already implemented; diagnostic errors continue to be copied before locking.
6PR 14Duplicate of #3; handled by composite Logcat routing.
7PR 14Split preferences by onboarding, recording, and display responsibility.
8PR 14Removed unused storage/create parameters.
9PR 14Renamed APIs to describe operations instead of getter mechanics.
10PR 56Made uncaught-handler installation atomic.
11PR 56Retains seven calendar days and prunes older diagnostics.
12PR 56Removed explicit cancellation branching; Flow cancellation propagation remains intact.
13PR 56Imported MutablePreferences normally.
14PR 56Accepted exception: test names already encode GIVEN/WHEN/THEN; redundant comments were not added.
15PR 57Flattened GPS preparation with named intermediate operations and early returns.
16PR 57Replaced direct calendar access with injectable EpochClock.
17PR 57Introduced injectable document and measurement storage.
18PR 57Sensor writer failures are logged immediately; close propagates writer failure.
19PR 58Injected storage into recording measurements.
20PR 58Moved Android activity-recognition work behind an internal platform adapter.
21PR 58Replaced manual JSON construction with serializable metadata models.
22PR 58Flattened sensor result handling.
23PR 62Flattened nested recording/storage control flow.
24PR 62Assigned to stacked PR 2: model conversion ownership.
25PR 62Assigned to stacked PR 2: complete heart-rate removal.
26PR 64Already implemented; workflow-specific view models are retained.
27PR 64Assigned to stacked PR 2: conversions moved beside their models.
28PR 63Assigned to stacked PR 2: Kotlin datetime formatting.
29PR 65Assigned to stacked PR 2: reporting-mode enum and mapper.
30PR 65Assigned to stacked PR 2: centralized deterministic formatting.
31PR 72Accepted exception in stacked PR 2: Android constructs the Hilt service, so one injected dispatcher field remains.

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