Heart v1.0.15 — On-device ML: rhythm, readiness, personalization
What's new
Three on-device prediction features land in this release. Every algorithm is closed-form maths running purely on the user's device — no model artifact, no telemetry, no remote inference, no account. Open the source on GitHub and every threshold and weight is right there in plain Dart.
Phase 1 — Rhythm anomaly hints
Live, unsupervised detector flags windows of unusually high beat-to-beat variability (pNN50 > 30%, CoV > 10%, RMSSD > 100 ms, RR range > 300 ms). A window is flagged irregular when ≥ 3 of 4 thresholds cross. Sustained irregularity (≥ 30 s) is recorded as an episode and surfaced in Insights with its peak features.
- Home: rhythm-status chip on the Live HR card (Normal / Borderline / Irregular)
- Tap the chip for an explanation + wellness disclaimer
- Insights: "Rhythm" card with the episode list, peak feature breakdown, and embedded "not a diagnosis" framing
Wellness hint, never medical advice. If episodes recur — especially with palpitations, dizziness, or shortness of breath — see a clinician.
Phase 2 — Tomorrow's readiness forecast
One-step-ahead prediction of tomorrow's overnight RMSSD using Holt linear exponential smoothing (α = 0.45, β = 0.20) over the user's last 7–14 nights, with small modifiers for last night's sleep (±5%) and recent training load (±5%). Confidence band sized from in-sample MAE.
- Insights: top card with predicted RMSSD + range + delta vs your personal baseline
- Trend pill: Likely up / Stable / Likely down
- "Building forecast…" until 5 nights of overnight data exist
Phase 3 — Personalized sleep correction
Pragmatic per-user offset layer on the rule-based sleep stager. Once the user logs ≥ 7 paired diary nights, mean bedtime / wake offsets are computed and applied to the detected window — without any per-user model artifact.
- Insights sleep snapshot card now shows a "Personalized · N diary nights" badge when correction is active
- Defensive cap: offsets > 90 min are rejected (fall back to raw stager)
Why this design
Consumer wellness apps usually ship opaque "AI" models that nobody — including the developer — can audit after the fact. Heart goes the other way: every formula is pinned in Dart source, cited to the published literature (Holt 1957, Keytel 2005, classical HRV thresholds), and runs entirely on the device that captured the data. You can read it, you can reproduce it, you can disagree with it. The differentiator isn't "AI inside" — it's "maths you can inspect."
Engineering
- 102 / 102 unit tests pass — 16 new tests cover the ML pipeline (5 rhythm + 7 readiness + 4 personalization)
flutter analyze: 0 issues- No new runtime dependencies; APK size unchanged from v1.0.13
Build
heart-android.apk— arm64-v8a, 21 MB. SHA-256:691fe24acaae8aec1d7911d3fcefcf1fa978a710b64e23a927c094026ac04e03heart-android-universal.apk— fat APK, 61 MB. SHA-256:2e5f10c080f74389c3ccaa711205773264158a5a9aadfaf4427d9c9910561fb8- Same release certificate as every prior version — clean upgrade.