Skip to content

fix: preserve recovery time across body map reads - #94

Merged
johnnyhuy merged 1 commit into
mainfrom
agent/issue-93-recovery-read-baseline
Nov 21, 2026
Merged

johnnyhuy merged 1 commit into
mainfrom
agent/issue-93-recovery-read-baseline

Conversation

@johnnyhuy

@johnnyhuy johnnyhuy commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Frequent body map reads discarded elapsed recovery time, so hourly polling could leave a sore region stuck indefinitely. BodyMapManager now derives each read from its stored baseline. Recording a workout refreshes elapsed recovery before applying fatigue, and the injected clock also controls recording and reset.

Part of #5.
Closes #93.

  • Route map, status, readiness, exercise recommendations and overall recovery through the same snapshot path.
  • Add deterministic coverage for hourly polling through 72 hours, mixed regional statuses, snapshot isolation, reset and a new workout after recovery with or without a preceding read.
  • Preserve the encoded model fields and existing fatigue thresholds; document the snapshot behaviour and optional clock/date parameters.

Verification passed on commit 3167cd6.

  • mise run lint - passed, 490 warnings and zero serious violations across the existing repository.
  • mise run build - passed.
  • mise run test - passed, including pipeline smoke tests and both Swift test frameworks.
  • git diff --cached --check - passed before commit.

Unit-test transcript provides proof for this package-only change. The regression suite failed against the original read mutation, including sore regions remaining sore after 72 hourly reads, before the snapshot fix.

==> summary: 23 passed, 0 failed
Executed 169 tests, with 0 failures (0 unexpected)
Suite RecoveryReadTests passed after 0.037 seconds.
Test run with 110 tests in 16 suites passed after 0.039 seconds.

No UI files or layout changed. Recovery status consumers receive the corrected elapsed-time results. A simulator screenshot does not demonstrate the 72-hour behaviour; deterministic unit tests provide the proof. Local iOS UI tests were not run for this core-only slice; repository CI runs the iOS build, UI coverage and mobile e2e gates.

Recovery still uses a shared timestamp across regions, and direct mutating BodyMapRecovery updates consume that value's baseline. Per-region timestamps and restoring persisted recovery during facade startup remain outside this slice. Epic #5 stays open.

Repository CI is green for the same commit.

Executed 27 tests, with 0 failures (0 unexpected) in 443.172 seconds
** TEST SUCCEEDED **

Keep recovery reads derived from the stored baseline and refresh elapsed recovery before recording another workout. Add deterministic polling tests and document the snapshot behaviour.

Co-authored-by: OpenAI Codex <noreply@openai.com>
@johnnyhuy
johnnyhuy merged commit 11a0742 into main Nov 21, 2026
10 checks passed
@johnnyhuy
johnnyhuy deleted the agent/issue-93-recovery-read-baseline branch November 21, 2026 22:06
Sign up for free to 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.

Preserve recovery time across repeated body map reads

1 participant