The problem
Most running plans are fixed. You miss a session or have a bad week, and the plan carries on as if nothing happened. The apps that do adapt usually give you a number with no reason behind it.
An AI coach sounds like the fix, but language models are bad at arithmetic and happy to invent a pace. For training load, a made-up number is how people get hurt.
What I’m building
KM Zero reads the runs people already record in Apple Health. It builds a plan for a race or for general fitness, checks every run against the session it was meant to be, and asks how the run felt. Then it adjusts the next few days if it needs to.
The split of work is the whole design:
- The engine decides. Zones, paces, weekly volume, long-run caps, the taper, and when a change is needed. It is plain, deterministic TypeScript with no I/O.
- Claude chooses within limits. When a change is needed, the engine offers a few options. Each one has already passed every safety rule. Claude picks the one that suits this runner and writes one sentence on why.
- The runner has the last word. Automatic changes only touch the next 7 days and at most 3 sessions. Anything bigger needs a screen the runner confirms.
- Shorten Thursday’s easy run from 8 to 6 kmThe rules’ default. Week goes from 42 to 40 kmClaude’s pick
- Drop the 6 × 20 s strides from Saturday’s easy runWeek stays at 42 kmAllowed
- No changeAlways on the listAllowed
Keeping the model honest
Every model output is checked before a runner sees it:
- Shape. Valid JSON, an option id that was actually offered, and one to three notes.
- Numbers. A number extractor reads paces, times, distances, heart rates and “8 of 10” out of the text. Any number that isn’t in the facts fails the check.
- Voice. No exclamation marks, no emoji and no hype words, in UK English.
A failed output gets one retry with the error attached. If that fails too, the runner gets the engine’s default option with template wording. The plan is always correct, even with the model switched off.
How I’m building it
I wrote the spec before any code: 14 documents, about 2,200 lines, covering the plan engine, the AI contracts, every screen and the test plan. A build plan cuts that into pull-request-sized steps.
Coding agents do the building, one pull request at a time. Each one stops when its PR is green in CI and waits for me to review it. Nothing merges until I say so in the chat.
The engine tests run under both Node and Deno, and a parity check fails any test that passes in only one of them. There are about 200 tests so far.
| Milestone | What it delivers | Status |
|---|---|---|
| M0 Foundations | Domain model, engine skeleton, fixtures, iOS app and CI, accounts | 5 of 12 PRs merged |
| M1 Health import | Apple Health sync, baseline zones and paces | Next |
| M2 Goal and plan | Race and fitness plans, the 12 safety rules | Planned |
| M3 to M9 | Today and Plan screens, run analysis, plan updates, progress, release | Planned |
What’s next
- Finish M0: the backend with anonymous accounts that upgrade with Sign in with Apple, and TestFlight builds straight from CI.
- Import from Apple Health and work out a runner’s zones and paces from their own history.
- AI tests against 30 reviewed reference outputs. CI fails if fewer than 98% pass the checks.