test(confidence-engine): establish longitudinal synthesis checkpoints

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
2026-10-08 10:33:59 +01:00
co-authored by Claude Code
parent 8d9df8c939
commit 57c88b713a
3 changed files with 356 additions and 1 deletions
@@ -103,4 +103,63 @@ Contents:
- `situationGraph`: 11 nodes (1 state, 5 observation, 2 metric, 3 unknown), 10 edges, full `reasoningState`, `resolvedNodeIds`, `centralStatement`, `activeUnknownNodeId`
- `findings`: 9 findings total; all 7 previously verified IDs present (`hciikc`, `ybfsm3`, `k45vyt`, `vhftyr`, `9bgkmw`, `23192q`, `kkh39k`)
Verified: helper parses without invoking live synthesis; fixture immutability confirmed via deep-clone roundtrip.
Verified: helper parses without invoking live synthesis; fixture immutability confirmed via deep-clone roundtrip.
## Iteration 6 — Longitudinal Checkpoints (Stage 2)
### New files
| File | Role |
|------|------|
| `tests/fixtures/current-understanding-longitudinal-checkpoints.json` | Compact checkpoint manifest referencing original fixture; lists included contribution IDs and finding IDs per checkpoint |
| `tests/graph/current-understanding-experiment-helper.test.js` (extended) | 15 new longitudinal assertions in `Longitudinal checkpoints — manifest integrity` describe block |
### Checkpoint manifest structure
The manifest contains:
- `manifestVersion`, `description`, `sourceFixture`, `contaminationAssessment`
- `contributions[]` — ordered list with timestamps and ordering integers
- `findingsById` — verbatim copy of each original finding (by ID)
- `checkpoints[]` — four cumulative states: `{ id, includedContributions[], includedFindings[] }`
### Checkpoint state summary
| Checkpoint | Description | Contribs | Findings | Count |
|---|---|---|---|---|
| checkpoint-0 | Baseline (no findings) | none | none | 0 |
| checkpoint-1 | contrib-0001 | contrib-0001 | 3bw5f0, i5zdcq | 2 |
| checkpoint-2 | contrib-0001 + contrib-0002 | contrib-0001, contrib-0002 | 7 findings | 7 |
| checkpoint-3 | All contributions | all three | all 9 original findings | 9 |
### Graph-state contamination analysis
`synthesizeCurrentUnderstanding()` and `buildGraphEvidenceProjection()` project **only**:
- Nodes with `status: "known"` or `"supported"` (filtered)
- `centralStatement` (framing only)
- Findings passed as separate parameter
**Explicitly excluded from prompt:** `resolvedNodeIds`, `activeUnknownNodeId`, `reasoningState`, edges, `currentSummary`, nodes outside known/supported statuses.
**Conclusion: NONE — final-state graph fields do not leak into synthesis input.**
### Compatibility gap
The existing helper consumes a single `{ situationGraph, findings }` fixture via `--file`. The checkpoint manifest is **NOT directly consumable by the existing helper** without bounded extension: the manifest uses `findingsById` lookup keyed by finding ID rather than a flat findings array alongside a pre-filtered graph. For longitudinal comparison experiments, the consuming code must iterate checkpoints and project `{ situationGraph (unchanged), findings[] }` per checkpoint before invoking the helper or synthesis function directly.
### Test assertions added (15 new tests)
1. Manifest has exactly 4 checkpoints
2. Checkpoint counts are 0, 2, 7, 9
3. checkpoint-0 has no included findings
4. checkpoint-1 includes exactly contrib-0001 findings
5. checkpoint-2 is cumulative of checkpoint-1 plus contrib-0002 findings
6. checkpoint-3 includes all 9 original findings
7. All checkpoint findings are verbatim from the original fixture
8. Contribution ordering matches recorded timestamps
9. Manifest ordering matches fixture finding order
10. checkpoint-3 is cumulative of all checkpoints before it
11. No findings appear before their contribution boundary
12. Original fixture unchanged (spot check)
13. Production synthesis contract accepts all checkpoint inputs
14. Manifest references the source fixture path
15. Manifest does not fabricate historical graph state