fix(confidence-engine): permit empty plausibleInterpretations for honest zero state

- Zod validator: plausibleInterpretations accepts empty string (zero interpretations) while remaining required and string-typed
- Prompt instruction: SECTION B now explicitly requests "" instead of absence prose when no plausible inputs exist
- Report generation/update paths derive hasPlausibleInterpretations from actual synthesized data rather than hard-coding true
- Tests: updated validation contract, added hasPlausibleInterpretations derivation assertions, updated seam tests to use derived values
This commit is contained in:
2026-10-02 06:48:24 +01:00
parent 8dc6e58d43
commit 0cc9d087c3
4 changed files with 67 additions and 14 deletions
@@ -28,7 +28,7 @@ export { filterEligibleFindings };
const overviewResponseSchema = z.object({
understanding: z.string().min(1),
plausibleInterpretations: z.string().min(1),
plausibleInterpretations: z.string(),
});
const overviewOutputSchema = {
@@ -210,7 +210,7 @@ ${interpSections.length > 0 ? JSON.stringify(interpSections, null, 2) : "(none)"
9. Neither field may contain recommendations, decisions, confidence scores, next actions, priorities, or readiness assessments.
10. This is a FRESH synthesis — do NOT treat any previous overview or Current Understanding as input.
Both fields must be non-empty strings.`;
understanding must be a non-empty string. When SECTION B has no plausible inputs, return plausibleInterpretations as an empty string ("") — do NOT manufacture an absence statement.`;
return prompt;
}