Commit Graph
782 Commits
Author SHA1 Message Date
robbondandClaude Code aa57d8589c feat(confidence-engine): verify disk persistence of focused-investigation evidence serializer (Experiment 7, Iteration 7)
Extended deterministic test to write serialized evidence record to
OS temp directory, read back from disk, parse JSON, and assert deep
structural equality. Verified: five structured arrays preserved with
correct lengths; exact inputs unchanged; identity fields intact; null
metadata fields survive round-trip. Temp file cleaned in finally block.

Zero live model calls. Zero browser calls. No production code or
canonical-helper modifications. Experiment 4 original structured
output remains unavailable.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: robbond <rob@rdbsolutions.co.uk>
2026-10-09 14:29:36 +01:00
robbond 7d7a9e8d29 feat(confidence-engine): add serializeFocusedInvestigationEvidence evidence serializer and deterministic test
Apparatus-level pure serialization function that preserves all five
focused-deconstruction arrays (observations, uncertainties, assumptions,
relationships, possibleFollowUpQuestions) plus exact inputs and execution
metadata from the existing checkpoint — without modifying production code.

Deterministic verification: syntax check pass, 79/79 assertions pass
(including 28 new evidence-ser tests), zero live calls.

Experiment 4's missing structured output cannot be reconstructed (never
persisted by the apparatus). No new semantic evidence produced.
2026-10-09 14:25:26 +01:00
robbond 7fd05745e8 feat(confidence-engine): record Experiment 4 synthetic HS-03C focused investigation results — PARTIAL fidelity, semantic narrowing observed
Controlled synthetic experiment (Iteration 4): fixed recruitment scenario with
synthetic answer showed partial preservation of the broader feasibility uncertainty.
The model correctly preserved timing estimates as observations but narrowed the
investigation to hiring pipeline logistics rather than cross-area launch feasibility.
2026-10-09 14:12:35 +01:00
robbondandClaude Code d12615075d feat(confidence-engine): expose focused-investigation inputs in composed checkpoint
Add focusedInvestigationInput {targetDescription, question, answer} to
composeDeepInvestigationCheckpoint() return object. These are the actual
invocation values: targetDescription from situationGraph node, question
is previousQuestion (NOT node.openQuestion), answer is function param.

Deterministic verification: syntax check passed; source-inspection test
assertions E10/E11 added and pass (0 failures). Call-count ownership:
up to 3 live generateReconstruction calls (focusedDeconstruct +
reconsiderCompletedEpisode + synthesizeCurrentUnderstanding).

No provider, graph, or production behavior changed.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-09 13:47:54 +01:00
robbond d0f357877d feat(confidence-engine): present canonical uncertainty description as initial display
Changed the facilitator-view-adapter to prefer node.description over
node.openQuestion for unresolved unknown items. This is a reversible
presentation change only — graph identity, reasoning-state ownership,
openQuestion generation, and resolved-unknown presentation are unchanged.

Owning test assertions updated to reflect new display contract:
- open-question-presentation.test.js: assertion target shifts from
  question text to description text
- facilitator-view-adapter.test.js: deduplication tests use distinct
  descriptions so nodes remain distinguishable after the change

Documentation: hypothesis experiment record and handoff return note.
2026-10-09 11:37:43 +01:00
robbond b71e3a8267 docs(confidence-engine): record uncertainty-led investigation hypothesis 2026-10-09 10:26:49 +01:00
robbond d89e0816b6 refactor(reconstruction): strengthen open-question semantic fidelity 2026-10-09 09:12:41 +01:00
robbond fd5241c6af feat(experiments): expose reconstruction open-question evidence 2026-10-09 08:12:06 +01:00
robbond 6bc8be6edb wip(confidence-engine): checkpoint open-question presentation work 2026-10-09 07:46:19 +01:00
robbond f74fe6de10 fix(focused-investigation): suppress incompatible question strategies 2026-10-08 17:48:53 +01:00
robbond 92ae463d10 feat(llm): propagate cancellation through reconstruction providers 2026-10-08 17:45:02 +01:00
robbondandClaude Code 35a6303ce8 test(confidence-engine): enable longitudinal synthesis checkpoint selection
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-08 10:49:51 +01:00
robbondandClaude Code 57c88b713a test(confidence-engine): establish longitudinal synthesis checkpoints
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-08 10:33:59 +01:00
robbondandClaude Code 8d9df8c939 test(confidence-engine): expose current understanding experiment output
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-08 10:16:34 +01:00
robbondandClaude Code ce7df91a42 test(confidence-engine): enable live current understanding experiment execution
Extend the CU synthesis experiment helper with a --live flag that
uses the production provider (getProvider from lib/llm/provider.js)
for live model invocation. Preserves deterministic mode unchanged.

Adds 10 new deterministic tests verifying live-mode wiring via
injected mock provider: fixture pass-through, single invocation,
schema correctness, immutability, persistence safety, and regression
of existing deterministic behaviour. Zero network calls in all tests.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-08 09:59:03 +01:00
robbondandClaude Code 425e1e7805 test(confidence-engine): capture original current understanding regression fixture
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-08 09:52:57 +01:00
robbondandClaude Code dd875b5535 test(confidence-engine): add current understanding synthesis experiment helper
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-08 09:49:09 +01:00
robbondandClaude Code 279b9a2a67 fix(confidence-engine): permit evidenced knowledge gaps in current understanding
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-08 09:41:24 +01:00
robbond f1fae621f1 test(confidence-engine): remove Iteration 16 unsubstantiated target-scoped contribution behaviour section
Remove the 140-line Iteration 16 test section (commit 5d4e7b5) that
represented manually supplied checkpoint values as evidence of
target-scoped contribution behaviour. The section used extractLiveExperimentCheckpoint
to construct mock result objects simulating multi-episode state transitions
but could not observe contributions — the deterministic seam has no
contributions field in its return shape.

Preserves: all pre-existing checkpoint tests, Iteration 15 source-level
assertions, synthetic CU synthesis tests, and existing helper imports.
2026-10-08 07:41:40 +01:00
robbond 5d4e7b5e94 test(confidence-engine): verify target-scoped contribution behaviour via deterministic seam
Add Iteration 16 test extension that documents the behavioral evidence
boundary for target-scoped contribution filtering:

- Observable via extractLiveExperimentCheckpoint:
  * Node A pre-episode graph state (graphCheckpoint.nodeCount)
  * B's fresh deconstruction trigger (providerGenerateCalls increments)
  * Graph/findings continuity (reasoningState turnCount advanced)

- Blocked from deterministic seam (no contributions field in checkpoint):
  * Historical contribution retention for non-current targets
  * B contribution associated with targetNodeId
  * Both A and B surviving in postEpisodeContributions
  * B prep scope receiving B-specific contribution

Uses mock result objects to simulate the two-target sequence
(n_enterprise_customer_signing -> n_product_launch_decision) and
explicitly documents which assertions can and cannot be verified.
2026-10-08 07:39:22 +01:00
robbond 99f200303a fix(confidence-engine): scope contribution filtering to targetNodeId in composeDeepInvestigationCheckpoint
Historical contributions for a different Open Question node no longer
suppress fresh focused deconstruction of the current target. Only
contributions whose targetNodeId matches the current target are counted
towards suppressing redundant deconstruction.
2026-10-08 07:34:28 +01:00
robbond ddd1c7bd6f test(confidence-engine): cover CU diagnostics and investigation checkpoints 2026-10-08 06:45:37 +01:00
robbond 20b416dcb6 test(confidence-engine): report final deep provider count 2026-10-07 07:43:08 +01:00
robbond 44db12d9c0 test(confidence-engine): forward deep provider schemas 2026-10-07 07:25:52 +01:00
robbond 0b84f8ad28 test(confidence-engine): expose CU synthesis failure shape 2026-10-07 06:59:43 +01:00
robbond d6dbc17bdf fix(confidence-engine): await focused deconstruction provider 2026-10-06 18:18:10 +01:00
robbond 814360e368 test(confidence-engine): use canonical focused deconstruction 2026-10-06 17:28:40 +01:00
robbond 9362c78f81 refactor(confidence-engine): extract focused deconstruction seam 2026-10-06 17:06:44 +01:00
robbond 8e3f4388d6 test(confidence-engine): preserve focused investigation evidence seam 2026-10-05 09:35:04 +01:00
robbond e996a542b3 test(confidence-engine): align deep investigation episode seam 2026-10-05 08:06:28 +01:00
robbond ca284d9c04 test(confidence-engine): preserve deep investigation episode state 2026-10-05 07:54:17 +01:00
robbond 90649c0495 test(confidence-engine): compose deep CU checkpoints 2026-10-05 06:44:29 +01:00
robbond 72b10d0050 test(confidence-engine): capture deep-investigation checkpoints 2026-10-05 06:40:28 +01:00
robbond 97c7482177 docs(confidence-engine): checkpoint report learning semantics 2026-10-02 17:20:29 +01:00
robbondandClaude Code b8c2909b5f feat(confidence-engine): show investigation learning in report
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-02 08:26:07 +01:00
robbond b448f522f6 feat(confidence-engine): deriveInvestigationLearning deterministic learning projection from canonical provenance
Adds deriveInvestigationLearning to episode-preparation.js: pure function that maps resolvedNodeIds + Contributions + Findings to investigation learning propositions, preserving node.label question text and contribution-provenance ordering.

Owning tests prove: correct provenance, cross-question isolation, eligibility rule (null/agree eligible; not_quite/not_relevant excluded), unresolved exclusion, no-eligible-material omission, text preservation, and provenance authority over originatingTargetNodeId shortcut.
2026-10-02 08:18:19 +01:00
robbond 30648ca5b3 docs(confidence-engine): checkpoint plausible zero-state verification 2026-10-02 07:12:36 +01:00
robbond 0cc9d087c3 fix(confidence-engine): permit empty plausibleInterpretations for honest zero state
- Zod validator: plausibleInterpretations accepts empty string (zero interpretations) while remaining required and string-typed
- Prompt instruction: SECTION B now explicitly requests "" instead of absence prose when no plausible inputs exist
- Report generation/update paths derive hasPlausibleInterpretations from actual synthesized data rather than hard-coding true
- Tests: updated validation contract, added hasPlausibleInterpretations derivation assertions, updated seam tests to use derived values
2026-10-02 06:48:24 +01:00
robbond 8dc6e58d43 docs(confidence-engine): checkpoint verified three-part report 2026-10-01 17:13:10 +01:00
robbondandClaude Code 56b5f0099c feat(confidence-engine): show unresolved report questions
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-01 14:20:01 +01:00
robbond 7c1d657761 docs(confidence-engine): record product-launch epistemic A/B result — 4-iteration loop complete
Controlled A/B (zero-Findings scenario, Qwen): unresolved uncertainty exposure
did not contaminate supported understanding or plausible interpretation.
No production changes. No report semantic changes.
2026-09-30 17:22:52 +01:00
robbond cf09a72739 feat(confidence-engine): add --variant hidden|visible to overview experiment helper for controlled A/B
- Helper now supports --variant visible which appends unresolved Open Questions
  as a separate NON-EVIDENCE section to the baseline prompt (built via production
  buildOverviewSynthesisPrompt)
- Default (--variant hidden, or no flag) remains production path
- No production code changed; apparatus-only extension
- Deterministic A/B control proven by existing 34/34 test suite
2026-09-30 17:20:28 +01:00
robbond 9a56176323 fix(confidence-engine): supply overview-specific output schema to generateReconstruction
synthesizeInvestigationOverview() called provider.generateReconstruction(prompt, modelName)
without an output contract. Without a structured-output schema the provider defaults to its
initial-reconstruction format which lacks { understanding, plausibleInterpretations }, causing
'Missing or invalid required fields' validation failure.

Add overviewOutputSchema (JSON-schema matching validateOverviewResponse contract) and pass as
third argument, matching the proven pattern in synthesizeCurrentUnderstanding().

53/53 tests PASS. Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-30 17:05:47 +01:00
robbond 6d9a7e7603 test(confidence-engine): add canonical overview experiment helper 2026-09-30 16:14:59 +01:00
robbond 3d0c90e64c 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.
2026-09-30 16:06:14 +01:00
robbond 8d268efb12 test(confidence-engine): support zero-finding report experiment case
- Add nullish coalescing on fix.findings ?? [] so absent findings
  array in a fixture is represented as zero Findings [] for the A/B
  input apparatus.

- Append product-launch second controlled case (live-product-launch-
  start-response.json) with zero Findings to the epistemic comparison
  test suite. All 34 tests pass deterministically.

- Update docs/current-handoff.md to record the zero-Findings case.
2026-09-30 13:25:22 +01:00
robbondandClaude Code d387b66c03 test(confidence-engine): clarify controlled report experiment boundary
Retained deterministic input-control test proving that A/B apparatus
correctly holds supportedEvidence, findings, plausibleInterpretations,
scenarioState, and providerConfig constant while only varying unresolved
question visibility. Added buildOverviewSynthesisPrompt identity proof
that full vs filtered graph produce identical prompt text.

Corrected handoff semantics: deterministic input filtering does NOT prove
model output behaviour; live two-call semantic comparison remains required.
Preserved prior imperfect live evidence with correct qualification about
uncontrolled plausibleInterpretations divergence.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-30 12:30:36 +01:00
robbondandClaude Code ada83de1db test(confidence-engine): control report epistemic comparison inputs
Deterministic test (17 cases) proves A/B inputs are correctly controlled:
- supportedEvidence identical in A and B
- findings identical in A and B
- plausibleInterpretations identical (fixed canonical interpretation) in A and B
- scenarioState identical in A and B
- providerConfig identical in A and B
- only unresolvedQuestions visibility differs (A=hidden, B=canonical)
- unresolved questions excluded from evidence and plausible interpretations
- fixed interpretation carries NON-EVIDENCE epistemic status

Also corrects Loop 2 documentation to reflect that three-category
invariance was NOT established (plausibleInterpretations differed
between calls despite identical input), retaining only the narrower
valid finding: no unresolved Open Question was promoted to evidence.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-30 11:44:51 +01:00
robbondandClaude Code ef6592cd91 test(confidence-engine): add progressed investigation experiment fixture
Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-30 10:55:13 +01:00
robbond 2dc1cb0fe6 docs(confidence-engine): record tester readiness findings 2026-09-11 10:34:53 +01:00