From fbdf831cb006a8ffe6c0ceca727c489d6f4016cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 5 Jun 2026 15:24:17 +0200 Subject: [PATCH] fix(insights): strip MOOD from the period-narrative measurement query MOOD is mood-entry backed, not a MeasurementType; it was filtered out of DISCOVERY_BEHAVIOURS but not DISCOVERY_OUTCOMES, so it leaked into the measurement.findMany type filter and threw PrismaClientValidationError, failing the period-narrative warm job. --- src/lib/insights/narrative/period-narrative.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/insights/narrative/period-narrative.ts b/src/lib/insights/narrative/period-narrative.ts index 7c12658e1..1641b2314 100644 --- a/src/lib/insights/narrative/period-narrative.ts +++ b/src/lib/insights/narrative/period-narrative.ts @@ -481,7 +481,7 @@ export async function buildPeriodNarrativeContext( ...DELTA_METRICS.map((m) => m.type), ...VITALS_BASELINE_TYPES, ...DISCOVERY_BEHAVIOURS.filter((k) => k !== "MOOD"), - ...DISCOVERY_OUTCOMES, + ...DISCOVERY_OUTCOMES.filter((k) => k !== "MOOD"), ]), ) as MeasurementType[];