You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P2] Raw recovery overload can score without the required HRV baseline #40
The public recovery overload that accepts optional driver baselines documents the HRV baseline as required. However, hrvBaseline may be absent while the separate hrvBaselineUsable flag defaults to true.
Another optional term can therefore produce a Charge score without any HRV term.
Both Swift and Kotlin return approximately 57.932425214874954. Under the documented contract the result should be nil/null.
Cause
The cold-start guard checks only hrvBaselineUsable; it does not require hrvBaseline. The missing HRV term is skipped and sleepPerf becomes the only weighted term.
Impact
A public caller can produce a plausible Charge score without the model's dominant required driver. Known production paths use the stricter baseline-state overload, so this is P2 rather than P1.
Acceptance criteria
Return nil/null whenever the required HRV baseline is absent, or make absence unrepresentable.
Preserve cold-start behavior for present but unusable baselines.
Preserve scores for valid usable baselines.
Add paired tests with each optional driver present while HRV baseline is absent.
This is pure analytics behavior; no hardware testing is required.
PR opened upstream: ryanbr#1978 — the raw RecoveryScorer.recovery(…) overload now returns nil/null when the HRV baseline is absent instead of scoring from the remaining optional
drivers, mirrored in Swift and Kotlin with paired tests.
Activity
bhelm commentedon Sep 7, 2026
PR opened upstream: ryanbr#1978 — the raw
RecoveryScorer.recovery(…)overload now returnsnil/nullwhen the HRV baseline is absent instead of scoring from the remaining optionaldrivers, mirrored in Swift and Kotlin with paired tests.
fix(analytics): require the HRV baseline on the raw recovery overload