Add direct Apple Health sync without Strava - #4
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c4636d103
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| timestamp = start_time + min(elapsed_s, max(0, round(offset_s))) | ||
| return records.setdefault( |
There was a problem hiding this comment.
Preserve colliding sub-second HealthKit samples
When two route or same-type sensor points have offsets that round to the same second, such as 0.1 and 0.2, this timestamp-keyed dictionary returns the same record and the later assignment overwrites the earlier GPS or sensor value. The generated FIT therefore silently drops source points even though the parser retained them; emit distinct records or use FIT fractional timestamps instead of coalescing by rounded seconds.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
| } | ||
| return bundle.hasPrefix("com.apple.") | ||
| || manufacturer.contains("apple") | ||
| || model.contains("watch") |
There was a problem hiding this comment.
Require positive Apple provenance for watch models
When HealthKit contains a run recorded by a non-Apple device whose model contains watch and whose bundle/manufacturer does not contain garmin, this fallback accepts it as Apple-origin; the Mac-side filter also checks only for Garmin, so the activity can be uploaded to Garmin and Nike despite being outside the Apple Watch source scope. Require an Apple bundle or manufacturer rather than treating every watch model as Apple-origin.
AGENTS.md reference: AGENTS.md:L3-L5
Useful? React with 👍 / 👎.
What changed
Why
Runners who record with Apple Watch should be able to move their own Apple Health runs to Nike Run Club without creating a Strava account or paying a sync service. macOS cannot read HealthKit, so the privacy-preserving direct source must be a user-authorized iPhone companion and private outbox.
User impact
Users may choose direct HealthKit, Strava, or both. HealthKit is processed first and Garmin is checked before every upload. Route, heart rate, distance, speed, power, stride length, vertical oscillation, and ground-contact time are preserved only when present; cadence is never invented. The docs explicitly disclose Apple's free Personal Team 7-day reinstall limit.
Validation
uv run pytest -q— 41 passeduv run coverage run -m pytest -q && uv run coverage report— 83%uv run ruff check .uv run bandit -q -r src/nrc_volt_syncuv run pip-auditswift build --package-path ios --target HealthOutboxCoreCloses #2.