mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
The reference-range classifier assumed bands[0] was always the normal/target band, so any metric whose first band is abnormal was placed wrong: a healthy BMI 22 read as just outside the reference and an underweight BMI 17 read as inside; pulse pressure had the same flaw (Narrow is its first band). The same classifier drives the in-app four-state explainer, so both surfaces were affected. Mark the population-normal band explicitly with a `normal: true` flag on every metric, add `normalBandIndex`, and place values by distance from the marked band rather than from index 0. `headlineBandText` now renders the marked band, so BMI grounds against 18.5-24.9 kg/m2. Exclude daily steps from the Coach grounding: it is fed the intra-day mean of the step rows, which averages a multi-row day down and can misplace it below the 8,000 floor. Grounding it on a per-day sum is the correct fix and is left as a follow-up; until then drop the line rather than ship a wrong placement. Extend the classifier and grounding tests for BMI 17/22/27, a pulse pressure case, the normal-band-not-at-index-0 contract, and that steps is not grounded.