fix(confidence-engine): supply overview-specific output schema to generateReconstruction

synthesizeInvestigationOverview() called provider.generateReconstruction(prompt, modelName)
without an output contract. Without a structured-output schema the provider defaults to its
initial-reconstruction format which lacks { understanding, plausibleInterpretations }, causing
'Missing or invalid required fields' validation failure.

Add overviewOutputSchema (JSON-schema matching validateOverviewResponse contract) and pass as
third argument, matching the proven pattern in synthesizeCurrentUnderstanding().

53/53 tests PASS. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
2026-09-30 17:05:47 +01:00
parent 6d9a7e7603
commit 9a56176323
2 changed files with 12 additions and 0 deletions
@@ -31,6 +31,16 @@ const overviewResponseSchema = z.object({
plausibleInterpretations: z.string().min(1),
});
const overviewOutputSchema = {
type: "object",
properties: {
understanding: { type: "string" },
plausibleInterpretations: { type: "string" },
},
required: ["understanding", "plausibleInterpretations"],
additionalProperties: false,
};
const FORBIDDEN_FIELD_NAMES = new Set([
"recommendation",
"decision",
@@ -245,6 +255,7 @@ export async function synthesizeInvestigationOverview(params, deps) {
providerResult = await provider.generateReconstruction(
prompt,
modelName,
overviewOutputSchema,
);
} catch (err) {
throw new Error(`Overview synthesis provider call failed: ${err.message}`);