feat(daily): milestones — the calm reward layer

Add the durable-states Milestone primitive and a milestone card to the
daily digest. A milestone marks a state REACHED, never days maintained:
a metric settled back inside its own range, a run of weeks in range, or
a fresh personal best. It is deliberately not a streak — the type carries
a reached-date and no running counter, so nothing here can be tuned into
a flame, and a lapse is invisible rather than mourned.

The primitive is a thin wrapper over engines that already exist: the pure
detectStreak band engine (return-to-range + sustained-in-range) and the
PersonalRecord detection output (new bests). Reached-once needs no new
storage — a milestone's reached-date is a stable fact, so it surfaces only
on the day it was reached and never resurfaces the next day.

The digest emits one calm success card per day when a milestone is freshly
reached, below an overdue dose and above ambient items, with a single
action into the metric's insight. Module- and data-gated: a disabled
insights account or a day with nothing reached shows nothing. Copy carries
no streak, loss, or failure vocabulary, in all six locales.
This commit is contained in:
Marc-André Bombeck committed 2026-07-17 08:10:58 +02:00
1 parent 1427125b7e
commit 8b7bb7914e
11 files changed
+908 -6

No files matched your search

+37 -1
View File
@@ -8557,7 +8557,8 @@
"viewCheckups": "View check-ups",
"checkinKeep": "Keep it",
"checkinAdjust": "Adjust",
"checkinLetGo": "Let it go"
"checkinLetGo": "Let it go",
"viewMilestone": "View"
},
"today": {
"scoreLabel": "Health score",
@@ -8567,6 +8568,41 @@
"readFullBriefing": "Read the full briefing",
"worthALook": "Worth a look",
"allClear": "Nothing needs your attention today."
},
"milestone": {
"metric": {
"restingHeartRate": "resting heart rate",
"heartRateVariability": "heart-rate variability",
"respiratoryRate": "respiratory rate",
"weight": "weight",
"generic": "this metric"
},
"record": {
"title": "A new {metric} best",
"body": "A personal best for your {metric} today — quietly noted, nothing to do."
},
"returnToBaseline": {
"title": "Back in range: {metric}",
"body": "Your {metric} has settled back inside your usual range. Whatever that was, it has passed."
},
"sustainedInRange": {
"week1": {
"title": "A week in range",
"body": "Your {metric} has held inside your usual range for a week now. Nice and steady."
},
"week2": {
"title": "Two weeks in range",
"body": "Your {metric} has stayed in your usual range for two weeks. Calm and steady."
},
"week3": {
"title": "Three weeks in range",
"body": "Three weeks of your {metric} sitting in your usual range. A real stretch of steadiness."
},
"week4": {
"title": "A month in range",
"body": "A full month with your {metric} in your usual range. Beautifully steady."
}
}
}
}
}