diff --git a/src/lib/ai/__tests__/citation-enforcement.test.ts b/src/lib/ai/__tests__/citation-enforcement.test.ts index 4e4794500..0b885513a 100644 --- a/src/lib/ai/__tests__/citation-enforcement.test.ts +++ b/src/lib/ai/__tests__/citation-enforcement.test.ts @@ -19,14 +19,11 @@ import { * Empty / missing → schema parse fails. The model cannot * fabricate a recommendation that points at "nothing". * - * 2. Every recommendation's `metricSource` MUST be backed by an - * entry in `citations[]` (matching `type` + `timeRange`). - * Cross-check enforced by `findUncitedRecommendations` and run - * by the wrapper after schema parse. - * - * 3. Two separate failure modes (missing metricSource vs. missing - * citation) both surface as zod / wrapper errors so the route - * can return 422 in either case. + * Point 2 of the original contract — every recommendation's + * `metricSource` must also appear in `citations[]` — was a cross-check + * run by a wrapper that had no production caller. Both the wrapper and + * the cross-check are gone; what remains here is the schema-level half, + * which is a real definition and is exercised below. */ const baseMetricSource = { diff --git a/src/lib/ai/__tests__/rationale-schema.test.ts b/src/lib/ai/__tests__/rationale-schema.test.ts index 9bd1eeac0..f03a88b65 100644 --- a/src/lib/ai/__tests__/rationale-schema.test.ts +++ b/src/lib/ai/__tests__/rationale-schema.test.ts @@ -28,10 +28,10 @@ import { * bundle when present — defence in depth on top of the rec-level * `referenceId`. * - * `findRecommendationsMissingRationale()` flags legacy (pre-B5c) - * payloads where the rationale object is absent. Used by the legacy- - * payload migration path so the UI can show a "regenerate for new - * explainability features" CTA without auto-regenerating. + * A companion helper once flagged legacy (pre-B5c) payloads with an + * absent rationale object, for a regenerate CTA. It ran only inside a + * wrapper that had no production caller and has been removed; the + * schema-level requirement asserted below is the live part. */ const baseRationale = {