fix(confidence-engine): avoid Done result shadowing
This commit is contained in:
@@ -365,7 +365,7 @@ export default function ScenarioForm() {
|
|||||||
doneInProgressRef.current = true;
|
doneInProgressRef.current = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await executeEpisodeDone({
|
const doneResult = await executeEpisodeDone({
|
||||||
resultSituationGraph: result?.situationGraph,
|
resultSituationGraph: result?.situationGraph,
|
||||||
targetNodeId,
|
targetNodeId,
|
||||||
focusedContributions: focusedContributions ?? [],
|
focusedContributions: focusedContributions ?? [],
|
||||||
@@ -381,8 +381,8 @@ export default function ScenarioForm() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/* CU synthesis — install only on success */
|
/* CU synthesis — install only on success */
|
||||||
if (result?.synthesisResult?.ok && result.synthesisResult.data?.currentUnderstanding) {
|
if (doneResult?.synthesisResult?.ok && doneResult.synthesisResult.data?.currentUnderstanding) {
|
||||||
setCurrentUnderstanding(result.synthesisResult.data.currentUnderstanding);
|
setCurrentUnderstanding(doneResult.synthesisResult.data.currentUnderstanding);
|
||||||
}
|
}
|
||||||
/* On synthesis failure: KEEP nextGraph, KEEP Findings, KEEP existing CU. Do NOT rollback. */
|
/* On synthesis failure: KEEP nextGraph, KEEP Findings, KEEP existing CU. Do NOT rollback. */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user