test(score): pin the weight yardstick, the mood gate and rollup/live parity

Covers what the required parameters now make impossible to forget: the
scorer takes the band whole and never widens it, a missing target scores
the bare trend, the resolved yardstick rides the weight component, the
shared builder refuses the reference band that sits under an override,
the snapshot gates its mood pillar on the module map, an explicit target
reaches both the score and the dashboard bands, and weight/BMI record
direction follows the user's own goal.

F1 adds the golden the score has never had: the rollup read branch and
the live read branch scored against one series encoded both ways. On the
canonical one-weigh-in-a-day cadence they agree exactly. On an uneven
cadence they part company, and the test pins that the whole difference is
the per-day mean collapse - the rollup branch equals the live branch fed
those same daily means - with a companion assertion proving the fixture
is not a no-op.
This commit is contained in:
Marc-André Bombeck committed 2026-07-27 23:15:38 +02:00
1 parent b0862c0902
commit be348f8820
12 files changed
+886 -63

No files matched your search

@@ -180,8 +180,10 @@ describe("PR detection — drift guard (real DB)", () => {
// either the worker or the suppress branch via `getPRDirection`).
const result = await detectPersonalRecordsForUser(TEST_USER_ID);
// v1.34 — the seeded user carries no weight target, so weight / BMI keep
// their null direction and stay out of the trackable set.
const trackable = measurementTypeEnum.options.filter((t) =>
isPRTrackable(t as MeasurementType),
isPRTrackable(t as MeasurementType, { weightGoal: null }),
);
expect(result.scanned).toBeGreaterThanOrEqual(trackable.length);
});