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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user