Skip to content

Add direct Apple Health sync without Strava - #4

Merged
nirvanasangsara-AI merged 2 commits into
mainfrom
codex/direct-healthkit-v0-3
Aug 10, 2026
Merged

Add direct Apple Health sync without Strava#4
nirvanasangsara-AI merged 2 commits into
mainfrom
codex/direct-healthkit-v0-3

Conversation

@nirvanasangsara-AI

Copy link
Copy Markdown
Owner

What changed

  • adds an iOS 17 HealthKit companion that exports Apple-origin running workouts to a user-selected Files/iCloud Drive outbox
  • adds strict HealthKit JSON parsing, a public v1 JSON Schema, and sparse timestamp-preserving FIT conversion
  • adds source-neutral SQLite state migration, HealthKit/Strava auto-selection, historical backfill, Garmin-origin filtering, and optional portable FIT export
  • keeps Garmin duplicate checks and the Garmin–Nike partner delivery boundary
  • updates Korean/English setup, privacy, architecture, no-Strava, AI-discovery, and licensing documentation
  • adds Swift package tests, synthetic Python regression tests, XcodeGen project generation, and iOS simulator CI

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 passed
  • uv run coverage run -m pytest -q && uv run coverage report — 83%
  • uv run ruff check .
  • uv run bandit -q -r src/nrc_volt_sync
  • uv run pip-audit
  • swift build --package-path ios --target HealthOutboxCore
  • staged-file secret/private-identifier scan
  • GitHub CI additionally runs Swift tests, regenerates the Xcode project, and builds the unsigned iOS simulator app

Closes #2.

@nirvanasangsara-AI
nirvanasangsara-AI marked this pull request as ready for review August 10, 2026 09:00
@nirvanasangsara-AI
nirvanasangsara-AI merged commit 6ea250f into main Aug 10, 2026
2 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/nrc_volt_sync/fit.py
Comment on lines +325 to +326
timestamp = start_time + min(elapsed_s, max(0, round(offset_s)))
return records.setdefault(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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.

Direct Apple Health source without Strava

1 participant