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
+2 -2
View File
@@ -63,7 +63,7 @@ export default function ReportPage({ params }) {
if (data.success) {
/* ── v0.59a — provenance: record generation revision (does NOT change Investigation revision) ── */
const rev = existing?.investigationRevision ?? 0;
const reportData = { understanding: data.understanding, plausibleInterpretations: data.plausibleInterpretations, hasPlausibleInterpretations: true, generatedFromRevision: rev };
const reportData = { understanding: data.understanding, plausibleInterpretations: data.plausibleInterpretations, hasPlausibleInterpretations: (data.plausibleInterpretations ?? "").trim().length > 0, generatedFromRevision: rev };
setExisting((p) => {
void saveInvestigation({ ...p, investigationReport: reportData })
.catch((error) => console.error("Investigation report save failed", error));
@@ -109,7 +109,7 @@ export default function ReportPage({ params }) {
const data = await res.json();
if (data.success) {
const reportData = { understanding: data.understanding, plausibleInterpretations: data.plausibleInterpretations, hasPlausibleInterpretations: true, generatedFromRevision: rev };
const reportData = { understanding: data.understanding, plausibleInterpretations: data.plausibleInterpretations, hasPlausibleInterpretations: (data.plausibleInterpretations ?? "").trim().length > 0, generatedFromRevision: rev };
setExisting((p) => {
void saveInvestigation({ ...p, investigationReport: reportData })
.catch((error) => console.error("Investigation report save failed", error));