feat(confidence-engine): isolate finding-informed understanding

This commit is contained in:
2026-08-28 08:16:37 +01:00
parent c45b703b3a
commit e221bd3bf8
3 changed files with 186 additions and 2 deletions
+38
View File
@@ -166,3 +166,41 @@ export function applyFindingsToSummary(summary, validatedFindings) {
return text + " [" + parts.join(" | ") + "]";
}
// ── Post-authoritative experimental understanding producer ──
/**
* Deterministic proof-seam: produce Current Understanding from validated findings
* AFTER authoritative graph update is settled.
*
* Eligibility contract (closed):
* null → eligible provisional working interpretation
* "agree" → eligible confirmed evidence
* other/falsy → excluded (not_relevant, rejected, etc.)
*
* Output affects ONLY the summary/current understanding string.
*/
export function produceFindingInformedSummary(originalSummary, appendedFindings) {
if (!appendedFindings || appendedFindings.length === 0) {
return originalSummary;
}
const parts = [];
for (const f of appendedFindings) {
if (f.evaluation === "rejected") continue;
// null disposition → eligible (provisional working interpretation)
// "agree" disposition → eligible (confirmed evidence)
if (f.userDisposition === null || f.userDisposition === "agree") {
parts.push(f.proposition);
}
// not_relevant and not_quite → excluded
}
if (parts.length === 0) {
return originalSummary; // no eligible findings
}
const evidenceText = `Evidence: [${parts.join("; ")}]`;
return originalSummary + " " + evidenceText;
}