fix(confidence-engine): reopen resolved unknowns by graph state

This commit is contained in:
2026-09-08 09:42:46 +01:00
parent 0b5a38f83d
commit 85b9f4411f
2 changed files with 23 additions and 3 deletions
+6 -3
View File
@@ -1,11 +1,12 @@
/**
* Deterministically reopen a resolved unknown node in a SituationGraph.
*
* Transition: node.status "resolved" → "unknown", and removes the node's ID
* Transition: removes the node's ID from resolvedNodeIds and establishes
* node.status "unknown".
* from resolvedNodeIds. This reverses canonical resolution so the question
* reappears among Open Questions for further investigation.
*
* Idempotent — if the target is not a currently-resolved unknown, returns the
* Idempotent — if the target is not an unknown marked resolved in graph state, returns the
* original graph unchanged (no mutation). Does NOT create nodes, delete edges,
* or touch contributions/findings/historical evidence.
*/
@@ -17,7 +18,9 @@ export function reopenResolvedUnknown(situationGraph, nodeId) {
if (nodeIndex === -1) return situationGraph;
const node = situationGraph.nodes[nodeIndex];
if (node.kind !== "unknown" || node.status !== "resolved") return situationGraph;
if (node.kind !== "unknown" || !situationGraph.resolvedNodeIds?.includes(nodeId)) {
return situationGraph;
}
const newNode = { ...node, status: "unknown" };
const newNodes = [...situationGraph.nodes];