mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-19 08:12:52 +00:00
refactor(dashboard): remove the orphaned verdict resolver
The nine-rung verdict ladder was written for the opt-in dashboard hero. That hero was retired when the digest-driven Today rail became the single promoted hero, and its i18n copy was dropped across every locale in the same change, but the resolver stayed behind. Since then it has had no caller outside its own tests: nothing renders it and no string exists for any of its variants. Every rung it computed already has a live owner. Dose states ride the digest's dose_window item, an elevated-at-rest window rides tension_window, the score delta rides the digest score block the Today hero paints its chip from, weight drift and sleep deficit and a silent stretch are the coach nudge cron's own triggers, and a crisis blood-pressure reading is the safety-floor engine's. Wiring a renderer back on would rebuild the second hero the retirement removed. - Delete the resolver, its ladder suite, and the client-safety import walk that pinned its bundle graph. - Fold the two shared nudge thresholds back into the cron. The leaf module existed only so a client component could read them without dragging the server graph along; there is no such component now. - Repoint the score-config guard off the verdict onto the digest fields the Today hero actually reads, so it still fails on the assembly it was written for. - Repoint the clinical-floors notes off the retired surface.
This commit is contained in:
1 parent
817886e145
commit
86f0e5d2cb
8 files changed
+53
-1299
No files matched your search
@@ -2,11 +2,11 @@
|
||||
* D3-H1 coverage — the clinical safety floors are ONE source of truth.
|
||||
*
|
||||
* Before v1.21.0 the "is this BP a crisis?" floors lived in three modules with
|
||||
* a divergent diastolic value (notification engine + Coach 180/120, dashboard
|
||||
* hero 180/110), so a 170/112 reading lit the hero banner yet never tripped the
|
||||
* alarm. This suite pins that every consumer now resolves the SAME canonical
|
||||
* constants from `@/lib/clinical-floors`, so the three surfaces can never drift
|
||||
* apart again without a test failure.
|
||||
* a divergent diastolic value (notification engine + Coach 180/120, a third
|
||||
* surface 180/110), so a 170/112 reading read as a crisis in one place and
|
||||
* never tripped the alarm. This suite pins that every consumer now resolves the
|
||||
* SAME canonical constants from `@/lib/clinical-floors`, so the surfaces can
|
||||
* never drift apart again without a test failure.
|
||||
*/
|
||||
import { describe, it, expect } from "vitest";
|
||||
|
||||
@@ -33,8 +33,8 @@ import { getMetricStatusMeta } from "@/lib/insights/metric-status-registry";
|
||||
|
||||
describe("clinical-floors — single source of truth", () => {
|
||||
it("uses the guideline-correct hypertensive-crisis floors (180/120)", () => {
|
||||
// ACC/AHA hypertensive-urgency floor: the diastolic floor is 120, NOT the
|
||||
// former hero-only 110 that fired the banner on calmer readings.
|
||||
// ACC/AHA hypertensive-urgency floor: the diastolic floor is 120, not the
|
||||
// 110 one surface once used to raise a banner on calmer readings.
|
||||
expect(BP_SYS_CRITICAL).toBe(180);
|
||||
expect(BP_DIA_CRITICAL).toBe(120);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user