From 79bb167333917aa6b5fac882b8a92d2441140f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 9 May 2026 22:16:33 +0200 Subject: [PATCH] fix(ai): MockAIProvider DEFAULT_RESPONSE conforms to v1.4.15 strict schema Phase D senior-dev review HIGH H4: the mock's default response carried the legacy v1.4.14 rich shape (classification, findings, correlations, dataQuality, disclaimer). The v1.4.15 strict schema requires {summary, recommendations, citations, warnings}. The default passed only because of `aiInsightResponseSchema.passthrough()`; once v1.4.16 retires the passthrough, every test using the default mock would silently start failing schema validation before its asserts ran. Switch to a strict-schema-conformant default. Tests needing the legacy shape opt in via `responses: [...]`. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/lib/ai/mock-client.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib/ai/mock-client.ts b/src/lib/ai/mock-client.ts index 889701832..3b84c96a6 100644 --- a/src/lib/ai/mock-client.ts +++ b/src/lib/ai/mock-client.ts @@ -39,14 +39,13 @@ export interface MockAIProviderOptions { tokensUsed?: number | number[] | null; } +// Conforms to v1.4.15 strict `aiInsightResponseSchema`. Tests that need +// the legacy v1.4.14 rich shape opt in via `responses: [...]`. const DEFAULT_RESPONSE = JSON.stringify({ summary: "mock", - classification: "gut", - findings: [], - correlations: [], recommendations: [], - dataQuality: { coverage: "mock", gaps: [], confidence: "mittel" }, - disclaimer: "mock disclaimer", + citations: [], + warnings: [], }); export class MockAIProvider implements AIProvider {