Repository navigation
feat(health): parse activity summaries from Apple Health exports - #47
Merged
Merged
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com>
This was referenced Nov 13, 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.
Parse daily Apple Health
ActivitySummaryrows alongside workouts and records in the Foundation-only package. The new Codable model keeps ring totals and goals separate from record-derived daily totals, preserves the calendar day and source energy unit, and offers supported energy conversions to kilocalories.Completes the activity-summary parsing slice. Part of #6. Closes #46.
Verification
mise run lintpassed, with 491 warnings and 0 serious violations across the repository. No warnings in the changed Swift files.mise run buildpassed.mise run testpassed, including 23 pipeline checks, 151 XCTest tests, and 30 Swift Testing tests across 4 suites.The CI run passed every check, including the Linux SwiftPM build/tests, iOS build, mobile e2e suite, and iOS UI tests with coverage.
Proof
Unit-test capture succeeded. This core ingestion slice has no app UI changes, so simulator screenshots were not needed; no capture path was blocked. The standard CI UI tests and mobile e2e suite also passed. The following transcript comes from
mise run teston commit5844498.The new
HealthActivitySummaryTestssuite proves mixed XML ingestion without double counting, both parser input APIs, all ring fields, supported and unsupported energy units, missing and invalid numeric values, JSON round-trips, decoding older exports, and malformed XML rejection.The CI UI coverage job also captured the existing app journeys successfully.
Reviewer notes
The exported
dateComponentsstring stays unchanged rather than being converted into an invented timestamp. Exercise values are in minutes and stand values are in hours. Missing, negative, non-finite, or non-numeric XML quantities become nil; measured zero remains zero. Energy with an unknown or absent unit is preserved but is not presented as kilocalories.Existing JSON without the new collection decodes with an empty
activitySummariesarray. This slice does not add activity ring UI, merge ring totals into record-derived summaries, or change recommendation policy. The parent ingestion epic remains open.