feat(confidence-engine): isolate finding-informed understanding
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user