fix(confidence-engine): unwrap overview provider response

Production: synthesizeInvestigationOverview() now passes providerResult.response
to validateOverviewResponse() instead of the raw envelope, matching the proven
pattern in current-understanding-synthesis.js.

Regression: fakeProvider returns real-provider envelope shape { response, providerApiPath }
and four new regression tests verify unwrapping succeeds with valid response
and fails correctly with invalid response inside the envelope.

Handoff: documented defect confirmed, fix applied, and owning regression added.
This commit is contained in:
2026-09-30 16:06:14 +01:00
parent 8d268efb12
commit 3d0c90e64c
3 changed files with 76 additions and 8 deletions
+8
View File
@@ -385,6 +385,14 @@ RAW USER EVIDENCE
- Current Understanding and Investigation Report are architecturally distinct artefacts. Report interpretations remain explicit, not evidence.
- The `≤5` processing bound was experimental apparatus constraint, NOT product requirement.
## Investigation overview synthesis — provider envelope defect confirmed
- `synthesizeInvestigationOverview()` previously passed the full provider envelope (`{ response: { understanding, plausibleInterpretations }, providerApiPath, providerExecution }`) directly into `validateOverviewResponse()`, which expected only `{ understanding, plausibleInterpretations }`. This caused "Missing or invalid required fields" on real providers.
- Fix now unwraps `.response` before overview validation, matching the proven pattern in `lib/graph/current-understanding-synthesis.js` (line 296: `validateSynthesisResponse(providerResult.response)`).
- Owning regression (`tests/graph/investigation-overview-synthesis.test.js`) now mirrors real provider envelope shape (`{ response: { understanding, plausibleInterpretations }, providerApiPath }`). Regression fails against pre-fix seam and passes after fix.
- No live proof yet. Zero live calls made in this handoff.
- Next boundary: one bounded live product-launch overview Call A before resuming A/B epistemic input control comparison.
## HISTORICAL — initial-decomposition v0.61 status
Initial decomposition experiments (v0.61) ran four successful runs plus one validation failure against the same manufacturing scenario. Key findings: