mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
The empty-path guard in the score fast-path checked raw record presence (any row at all) rather than each pillar's own eligibility threshold — weight needs 2 readings, mood needs 5 entries, BP needs a paired reading, compliance needs an active scheduled medication. An account with some data but no eligible pillar (a single mood entry, a single weight reading) fell through to computeHealthScore, which summed no components and returned a raw 0/red score indistinguishable from a genuinely poor result. Check the computed result's own components instead of re-deriving the thresholds, so the guard can never drift from computeHealthScore's actual eligibility rules. A pillar legitimately computed as 0 keeps its 0 value and is never swept into the null branch. Closes #582.