feat(confidence-engine): synthesize corrected findings

This commit is contained in:
2026-08-31 07:48:29 +01:00
parent 8e941b0c7b
commit 5fb32e628c
3 changed files with 255 additions and 6 deletions
+33
View File
@@ -2887,6 +2887,39 @@ The synthesis route now supplies the configured `OLLAMA_MODEL` and the domain re
- newly submitted evidence incorporated
- generic workspace error absent
### SECOND synthesis trigger integrated (v0.50.2 — corrected-Finding)
- `components/scenario-form.jsx` — `updateFindingProposition` now triggers `synthesizeFromFindings` after explicit next-state construction
- Same pattern as focused-Finding trigger: explicit next state, no React-state reread, one synthesis per save
**Changes:**
- `updateFindingProposition` (line 273): derives `nextFindings` explicitly from local args → calls `synthesizeFromFindings(fetch, { situationGraph: currentGraph, findings: normalizeFindings(nextFindings) })` → replaces CU on success; no fallback/approach on failure
**Deterministic gate:**
- correction tests: 5/5 PASS (Cases 15)
- focused-Finding regression: 19/19 PASS
- synthesis seam + route: 54/54 PASS
- build: PASS
**Trigger contract:**
- Not quite click → 0 synthesis calls
- Corrected proposition saved → 1 synthesis call
- Same Finding.id preserved ✅
- sourceObservation preserved ✅
- Corrected proposition sent in payload ✅
- Complete next Findings array sent ✅
- Previous CU NOT sent as synthesis input ✅
- Correction preserved on synthesis failure ✅
- Previous CU preserved on synthesis failure ✅
- No automatic retry ✅
- No legacy append fallback ✅
**Live runtime (classification RUN-B):**
- Not quite click → 0 `/api/cases/synthesis` requests
- Corrected proposition entered and saved → exactly 1 `/api/cases/synthesis` → HTTP 200
- Current Understanding visibly replaced (reconstruction incorporates corrected Finding)
- Same Finding remains at same position, disposition returns to normal state
### NEXT BOUNDED ISSUE (for future reference)
#### Name