From d22c992f60992e3c785865e998596d462e68eb78 Mon Sep 17 00:00:00 2001 From: robbond Date: Tue, 1 Sep 2026 12:17:32 +0100 Subject: [PATCH] fix(confidence-engine): avoid Done result shadowing --- components/scenario-form.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/scenario-form.jsx b/components/scenario-form.jsx index 776b77f..eddc1d0 100644 --- a/components/scenario-form.jsx +++ b/components/scenario-form.jsx @@ -365,7 +365,7 @@ export default function ScenarioForm() { doneInProgressRef.current = true; try { - const result = await executeEpisodeDone({ + const doneResult = await executeEpisodeDone({ resultSituationGraph: result?.situationGraph, targetNodeId, focusedContributions: focusedContributions ?? [], @@ -381,8 +381,8 @@ export default function ScenarioForm() { }); /* CU synthesis — install only on success */ - if (result?.synthesisResult?.ok && result.synthesisResult.data?.currentUnderstanding) { - setCurrentUnderstanding(result.synthesisResult.data.currentUnderstanding); + if (doneResult?.synthesisResult?.ok && doneResult.synthesisResult.data?.currentUnderstanding) { + setCurrentUnderstanding(doneResult.synthesisResult.data.currentUnderstanding); } /* On synthesis failure: KEEP nextGraph, KEEP Findings, KEEP existing CU. Do NOT rollback. */