diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b3acae..b2a9df1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## Sin publicar — Apple Health (Salud) + +A new **Salud** tab, next to Plan, and an endpoint behind it. An iOS automation in *Health Auto +Export* POSTs Apple Health to your profile and the data shows up as read-only cards: steps, heart +rate, sleep, weight, oxygen, workouts, and every other metric HAE can export — including ones this +fork has never heard of, which land under **Other** with a humanised name and a detail sheet listing +every field the watch sent. + +Per profile, and private by construction. Each profile mints its own **ingest key** (write-only: it +can add to that one profile's health file and cannot read a single number back), and rotating it +disconnects a phone without signing anybody out. The health data lives in its own +`data/vitals-.json`, outside the synced state document, so a year of heart rate never +round-trips through `localStorage` on every device. + +The interesting problem was duplicates. A five-minute automation re-sends overlapping windows, and +"append" would count a day of steps again on every run while "replace" would throw away everything +but the last five minutes under a different HAE setting. The receiver decides per payload instead: +day-grouped totals replace the day they name (converging on the day's total no matter how often it +is re-sent), while real samples are identified by instant plus numbers and stored once — so a sync +every five minutes, hourly, or once a day all land the same way. `docs/HEALTH.md` has the settings, +the merge table and the one configuration that is merely approximate rather than wrong. + +Also here: the watch's workouts are shown **read-only** in Salud and deliberately kept out of the +history — they carry no sets or weights, so folding them into progression, PRs and the recovery +model would be inventing data. Coverage: `api/vitals.js` (13 tests), the routes against a real +server (4), the card model (18), plus the endpoint documented in `api/openapi.yaml` and the new +`docs/HEALTH.md` setup guide. +