fix(confidence-engine): scope contribution filtering to targetNodeId in composeDeepInvestigationCheckpoint

Historical contributions for a different Open Question node no longer
suppress fresh focused deconstruction of the current target. Only
contributions whose targetNodeId matches the current target are counted
towards suppressing redundant deconstruction.
This commit is contained in:
2026-10-08 07:34:28 +01:00
parent ddd1c7bd6f
commit 99f200303a
2 changed files with 26 additions and 1 deletions
+10 -1
View File
@@ -316,9 +316,18 @@ async function composeDeepInvestigationCheckpoint({ situationGraph, previousQues
/* ── Canonical deconstruction: use focusedDeconstruct for Contribution derivation ─── */
const effectiveContributions = contributions.length > 0 ? [...contributions] : [];
/* ── Target-scoped filtering: only contributions belonging to the current target suppress fresh deconstruction ─── */
let effectiveContributionsForTarget = effectiveContributions;
if (targetNodeId && effectiveContributions.length > 0) {
effectiveContributionsForTarget = effectiveContributions.filter(
(c) => c?.targetNodeId === targetNodeId,
);
}
let newFindingsFromContributions = [];
if (effectiveContributions.length === 0 && answer && targetNodeId) {
if (effectiveContributionsForTarget.length === 0 && answer && targetNodeId) {
const contribSeq = effectiveContributions.length + 1;
/* ── Load production deconstruction seam (dynamic import to resolve ESM path aliases) ─── */