Commit Graph
790 Commits
Author SHA1 Message Date
robbond 5af3e62ddd feat(uncertainty-led-investigation): add Condition D freeform deconstruct treatment selector
- Add reconstruct-v0.5-d-deconstruct-no21.md prompt (removes rule 21)
  from original deconstruct-first prompt: 'Do not create artificial
  uncertainties to increase their number.'
- Extend start-case-experiment-helper.cjs with --condition D and
  --treatment no21 CLI flags for treatment selector apparatus
- Add programmatic treatment validation (rejects invalid treatments
  cross-condition, validates only 'no21' is a valid treatment value)
- Condition D output uses freeformText field instead of reconstruction
  JSON — avoids production JSON schema enforcement on freeform text
- Mock double supports freeform mode: returns deterministic raw text
  instead of structured importantUnknowns when isFreeform=true
- Add 23 targeted tests: J (Condition D prompt selection),
  J.1 (treatment validation), J.2 (prompt isolation verification)
- Fix existing B.1 assertions to use matchObject for execution field
2026-10-12 18:45:53 +01:00
robbond d5a06b9f28 docs(confidence-engine): record CE-ULI-11 domain-preservation intervention — explicit instruction did NOT prevent structural compression (Condition B=1 unknown, Condition C=1 unknown) 2026-10-12 09:41:43 +01:00
robbondandClaude Code 14ee66e82b docs(confidence-engine): record CE-ULI-10 paired observation — question-free reconstruction does not preserve broader uncertainty (single paired comparison, HS-03C)
Iteration 5 of bounded iteration loop. Two live calls per condition
using fixed HS-03C input (new-service-launch scenario). Model:
qwen-claude:latest via Ollama.

Condition A (question-required): 2 importantUnknowns with broad
descriptions + narrowing questions, 8 nodes, valid validation.

Condition B (question-free): 1 importantUnknown with structurally
narrowed combined-timeline description, 7 nodes, partial validation.

Neither condition preserved the original four-domain structure of
HS-03C. Narrowing occurred through different mechanisms in each
condition — hypothesis unconfirmed for this scenario shape.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-12 07:54:35 +01:00
robbond 742d7c319b docs(confidence-engine): record CE-ULI-09 paired observation — question-free reconstruction valid through canonical path (single paired comparison) 2026-10-12 07:45:13 +01:00
robbondandClaude Code 3b04d05355 feat(confidence-engine): add CE-ULI-08 two-condition uncertainty comparison apparatus
Adds experimental apparatus for testing whether removing the question field
from importantUnknowns in reconstruction output improves semantic fidelity.

New files:
- lib/reconstruction/schema-variant.js (conditionB schema + production passthrough)
- prompts/reconstruct-v0.5-b-noreq.md (alt prompt, identical line count to prod)

Changed files:
- lib/graph/orchestrator.js (pass generationSchema through dependencies)
- lib/analysis.js (accept opts.generationSchema fallback to original schema)
- scripts/start-case-experiment-helper.cjs (--condition B/A flag support)
- tests/scripts/start-case-experiment-helper.test.js (8 new deterministic tests)

43 targeted deterministic tests PASS. Production callers use original prompt/schema unchanged.
No live model calls. No full suite evidence available.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-12 07:33:31 +01:00
robbond a54b36a2b2 test(confidence-engine): extract focused target input for deterministic verification 2026-10-09 16:44:09 +01:00
robbondandClaude Code acf0665f23 docs(confidence-engine): record Experiment 9 evidence — explicit dependency preservation observed (PARTIAL fidelity)
HS-03C experiment with explicitly raised cross-area dependencies showed the model preserved relationships between recruitment, software integration and customer commitments while retaining the broader feasibility uncertainty. Result: PARTIAL semantic fidelity. Evidence at .evidence-temp/headless-semantic/HS-03C-focused-E9.json.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-09 14:41:51 +01:00
robbond 0698a1a61e feat(confidence-engine): add saveFocusedInvestigationEvidence persistence operation (Experiment 8)
Add exported saveFocusedInvestigationEvidence(checkpoint, identity, metadata,
outputPath) to the canonical experiment helper. Validates output path, exactly
one valid deconstruction contribution, required identity fields, and exact input
values. Writes formatted JSON, reads back, verifies deep structural equality.
Rejects ambiguous checkpoints instead of silently selecting a contribution.

Deterministic test covers: positive file write, structured evidence completeness,
input fidelity, identity fidelity, return values, missing path rejection, missing
contribution rejection, ambiguous contribution rejection. All OS temp files cleaned
in finally blocks.

Zero live model calls. Zero browser calls. No production code modified.
2026-10-09 14:33:33 +01:00
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