Repository navigation
feat(health): add weekly training summaries from parsed workouts - #37
Merged
Merged
Conversation
This was referenced Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
WeeklyTrainingSummaryandHealthExport.weeklyTrainingSummaries(calendar:)to aggregate parsed workouts by calendar week, sorted by week start. Summaries include workout and activity counts, normalised duration, energy and distance totals, mean per-workout average heart rate and highest maximum heart rate. Missing metrics remain nil and undated workouts are skipped. The core package remains UI-independent.Part of #7. Part of #6.
Closes #36.
Verification on commit
6719b9b810fd944430ec65551059fcf8fb8c3c1dmise run lintran and failed with the existing baseline of 503 violations, including 11 serious, in 130 files. Neither added file has lint violations. No unrelated lint fixes are included.mise run buildpassed.mise run testpassed the 23 video-pipeline smoke checks and 151 XCTest tests plus 10 Swift Testing tests with zero failures.git diff --check origin/main...HEADpassed.Proof from the local unit-test transcript
The nine new tests cover week grouping and sorting, normalised totals, missing metrics, heart rate aggregation, activity counts, empty input, skipping undated workouts, XML parsing through aggregation and Codable round trips.
Average heart rate is deliberately the unweighted mean of per-workout averages, as documented on the field. Recommendation and recovery integration, UI and weekly file export remain future slices under the parent epics. Parent epics #7 and #6 remain open.
Nothing user-facing changed. Unit-test transcript evidence succeeded; no simulator screenshot applies.