feat(confidence-engine): synthesize not relevant findings
This commit is contained in:
@@ -265,9 +265,27 @@ export default function ScenarioForm() {
|
||||
}
|
||||
|
||||
function updateFindingDisposition(findingId, newDisposition) {
|
||||
setFindings((prev) =>
|
||||
prev.map((f) => (f.id === findingId ? { ...f, userDisposition: newDisposition } : f)),
|
||||
// Derive explicit next state — not a React-state reread.
|
||||
const nextFindings = (findings ?? []).map((f) =>
|
||||
f.id === findingId ? { ...f, userDisposition: newDisposition } : f,
|
||||
);
|
||||
|
||||
setFindings(() => nextFindings);
|
||||
|
||||
// ── Synthesis trigger: eligible Finding → not_relevant → one reconstruction ──
|
||||
if (newDisposition !== "not_relevant") return;
|
||||
|
||||
const currentGraph = result?.situationGraph;
|
||||
if (!currentGraph) return;
|
||||
|
||||
void synthesizeFromFindings(fetch, {
|
||||
situationGraph: currentGraph,
|
||||
findings: normalizeFindings(nextFindings),
|
||||
}).then((res) => {
|
||||
if (res.ok && res.data?.currentUnderstanding) {
|
||||
setCurrentUnderstanding(res.data.currentUnderstanding);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateFindingProposition(findingId, newProposition) {
|
||||
|
||||
Reference in New Issue
Block a user