test(confidence-engine): extract focused target input for deterministic verification

This commit is contained in:
2026-10-09 16:44:09 +01:00
parent acf0665f23
commit a54b36a2b2
4 changed files with 140 additions and 5 deletions
+4
View File
@@ -828,3 +828,7 @@ Returns JSON-serializable record with: five deconstruction arrays (`observations
**What remains uncertain:** Whether explicit dependency information in other scenario shapes (non-recruitment) similarly improves cross-area relationship representation. Single-run limitation applies.
**Evidence file:** `.evidence-temp/headless-semantic/HS-03C-focused-E9.json`
### Iteration 3 — Extract Focused Target Input (apparatus recovery)
The focused-investigation target-node extraction was purified into a standalone pure function `extractFocusedTargetInput(situationGraph, targetNodeId)` in the canonical helper. Deterministic test verified: known-node exact-match (1/1), unknown-node empty-string fallback (2/2), graph-immutable-side-effect (1/1), source-pattern integration verification (1/1) — total 5/5 PASS. Zero live model calls. Extraction was tested deterministically; the original Experiment 9 runtime graph and root cause remain unestablished.
@@ -106,4 +106,6 @@ Preserve existing graph relationships, stable identities, provenance, persistenc
- **Experiment 8 — Explicit Evidence Persistence Operation (2026-10-09, Iteration 8 of 10):** Added `saveFocusedInvestigationEvidence(checkpoint, identity, metadata, outputPath)` to the canonical helper (`tests/graph/live-update-experiment-helper.cjs`). This is a small wrapper around `serializeFocusedInvestigationEvidence()` that performs explicit persistence via an explicitly supplied output path. Validates: (1) non-empty output path required; (2) exactly one valid deconstruction contribution in checkpoint (rejects ambiguous multi-candidate); (3) all four identity fields present (no nulls); (4) focused-investigation input values present. Writes formatted JSON, reads back, verifies deep structural equality. Returns `{ output_path, verifiedEvidence }`. Zero live model calls. Zero browser calls. No production code modified. Total deterministic test result: 0 failures across all assertions including positive tests (file write, structured evidence completeness, input fidelity, identity fidelity, return values) and negative tests (missing path rejection, missing contribution rejection, ambiguous contribution rejection). All OS temp files cleaned in `finally` blocks. Future live experiments must explicitly call this save function after a completed checkpoint. Experiment 4's original structured output remains unavailable; never persisted by the apparatus at that time.
- **Iteration 3 — Extract Focused Target Input Deterministic Test (Recovery):** Purified focused-investigation target-node extraction into a standalone pure function `extractFocusedTargetInput(situationGraph, targetNodeId)` within `tests/graph/live-update-experiment-helper.cjs`. The function uses `situationGraph.nodes.find(n => n.id === targetNodeId)` with `?? ""` empty-string fallback for unknown nodes. Reused inside the guarded focused-deconstruction path of `composeDeepInvestigationCheckpoint`. Deterministically tested with known-node exact-match assertions, unknown-node empty-fallback assertions, graph-immutable-side-effect assertion, and source-pattern integration assertion — all 5 assertions PASS. Zero live model calls.
- **Experiment 9 — Explicit Dependency Evidence and Focused Investigation (2026-10-09, Iteration 9 of 10):** Single-live-run semantic observation. Controlled scenario: synthetic answer explicitly raises three cross-area dependencies (recruitment → software integration dependency, integration → customer commitments dependency, cascading-delay risk). Model response: **PARTIAL** fidelity. Key finding — the model represented two explicit cross-area relationships and retained the overarching feasibility uncertainty ("Whether unconfirmed candidate notice periods and required onboarding duration leave enough time for software integration and customer commitments within nine months"), which was notably absent in Experiment 4's PARTIAL result. The follow-up question classifies as LEGITIMATE SPECIFICITY (narrows to notice periods but retains broader timeline context). Strongest counterevidence: overarching uncertainty combines multiple domains into one compound question, potentially obscuring the original recruitment-specific framing. Follow-up focuses on hiring logistics with cross-area context rather than independently investigating each dependency layer. Single-run limitation. Evidence file: `.evidence-temp/headless-semantic/HS-03C-focused-E9.json`.