The nightly rebuild is the pipeline almost everyone writes first. Drop the export, recompute every day from scratch, write it out. It is idempotent, it is easy to reason about, and it quietly throws away the one thing a health feed needs: which day changed, and why.
The longer version, with the live proof, is on the blog: Import Once, Rebuild Everything.
The export is not immutable
A full rebuild earns its place. It is stateless: delete the output, re-derive it, and you get the same answer every time. No cache to invalidate, no partial state to repair, no ordering to get wrong. If your export were immutable, it would be the right answer forever.
It is not immutable. Late-arriving samples are normal, not an edge case. A watch uploads a workout hours after you recorded it, a ring or scale syncs overnight, a manual entry lands after the fact. So a day you already read can change, and the model stops paying for itself.
Where the full rebuild breaks
- Yesterday's number changes with no record of the change. You read a day's resting heart rate, an agent caches it, and the next rebuild the value is different because a sample landed late. Nothing says the day was rebuilt, so a corrected day and a broken query look identical.
- You cannot distinguish data from code. If you also change the aggregation, a full rebuild rewrites every day at once. A day that moved because a sample arrived and a day that moved because you changed a formula become the same event. Debugging that is guesswork.
- The cost scales with the file, not the change. A real export runs to gigabytes. Re-parsing all of it nightly, to recompute days that did not change, is why streaming parsers and columnar stores became an arms race.
- A failed rebuild leaves a silent hole. If the job dies halfway, you either publish a partial day or keep serving the old copy. Both are invisible unless something checks the freshness of each day, not just the file.
What the delta model keeps
Write a per-day rebuild stamp when a day is recomputed, and only recompute the days a new sample touches. Three things fall out of that one change:
- A change becomes a fact, not an inference. "This day was rebuilt at 07:12 because a sample arrived" is queryable.
- The work scales with the change. A late workout recomputes one day, not the file.
- Age becomes visible. A day that is too old to rebuild can say so, instead of silently keeping a stale value.
The recompute block
The health-export-mcp server exposes the delta model through one field on get_mcp_status. Here is the verbatim result from the published server running in demo mode (no iPhone needed), which is what a cache with no rebuild stamps reports:
npx -y health-export-mcp --demo # then call get_mcp_status "recompute": { "supported": null, "reason": "This cache has no _meta block (written by an app older than 1.2, a LAN receiver, or edited by hand), so whether the app rebuilds days after late-arriving samples cannot be told from the file. No day in it carries a rebuild stamp.", "backfilled_days": 0 } Read that carefully, because the honest failure is the point. On a cache written by the app, supported is true and the block names the days rebuilt after late-arriving samples, with any day too old to rebuild called out separately. When the file cannot answer the question, the server says supported: null and tells you why, instead of returning backfilled_days: 0 as if nothing had changed.
A count of zero and an unknown are different answers. A health feed should never confuse them.
Four checks for your own pipeline
- Does each day carry a rebuild stamp, or only the file carry a timestamp?
- If a sample lands late, does one day recompute, or does the whole file?
- Can the tool name the days that changed, and the days too old to rebuild?
- When it cannot tell, does it say so, or does it return a confident zero?
If the answer to 3 or 4 is no, you are running a full rebuild and calling it a cache.
MetricBridge is a general-wellness app, not a regulated medical device. Nothing here is medical advice. The recompute block above was read live from the published server in demo mode.
Early access: your AI, reading your own Apple Health. The agentic upgrade opens to a small group first. Join the early-access list, one email when it opens.

