Commit Graph
343 Commits
Author SHA1 Message Date
robbond 57c9f2205e feat: add 'option' node kind and 'contained_in' edge — 60A.3
Implementation of Candidate B (unknown+option) from decision architecture
design in 60A.2. Adds two new primitives to the situation graph:

Schema (lib/graph/schema.js):
- SituationKind.option — a choice available within a decision context
- SituationRelationship.contained_in — links option → its parent unknown context

Prompt rules (lib/graph/prompt-builder.js):
- Section added: Decision Option Structure Rules with 5 numbered instructions
  governing when/how to create option nodes, link them via contained_in,
  attach consequences to specific options, and handle do-nothing alternatives.
  Explicitly forbids alternative_to edges and is_baseline/is_default flags.

Tests (446 new lines):
- schema.test.js: +300 — enum completeness updates, option kind validation,
  contained_in edge validation, native two-option graph fixture (~25 new tests)
- prompt-builder.test.js: +133 — focused rules verification for all 5 rule points,
  negative checks (no relocation/savings/example-specific wording, no alternative_to
  requirement, baseline flag prohibition context)

No production code paths affected beyond the two enum additions; existing node and
edge kinds remain unchanged. No Ollama calls, no live API calls.
2026-08-12 19:39:58 +01:00
robbond 6dd9afbf6b experiment: choose minimum decision representation 2026-08-12 18:34:18 +01:00
robbond e6cf973d2a exp 60A.1: read-only vocabulary adequacy diagnosis for alternatives and decisions
Diagnoses the root cause of the persistent pattern from 59B.2-59B.4
where explicit dual-option input collapsed into a single undifferentiated
unknown node. Concludes the graph vocabulary lacks first-class primitives
for options/decisions (not primarily a prompt issue). Identifies three
missing primitives: option node kind, decision node kind, alternative_of
edge type. Recommends ~25-line schema addition for 60A.2 implementation.
2026-08-12 18:19:29 +01:00
robbond ec32713c31 experiment: test explicit two-option decision structure 2026-08-12 17:52:38 +01:00
robbond 2cd346423d experiment: test do-nothing baseline representation 2026-08-12 17:42:25 +01:00
robbond 70688f91c9 experiment: test independent decision relevance 2026-08-12 17:18:18 +01:00
robbond 7f27fccadc experiment: test decision relevance and do-nothing baseline 2026-08-12 17:10:01 +01:00
robbond 8856e66147 experiment: test known-vs-uncertain consequence structure 2026-08-12 16:59:56 +01:00
robbond c3c5351143 experiment: test trade-off decomposition 2026-08-12 16:51:39 +01:00
robbond 8c5c4b5b75 experiment: test shift into trade-off reasoning 2026-08-12 16:37:52 +01:00
robbond 3f1bf7bcb0 experiment: test verified uncertainty resolution 2026-08-12 16:26:43 +01:00
robbond 52c529a688 experiment: test qualified evidence uncertainty status 2026-08-12 16:02:28 +01:00
robbond 201f259326 experiment: exercise interrogative question rendering live 2026-08-12 15:35:00 +01:00
robbond 6f2c09cd94 experiment: validate question-formulation fix live 2026-08-12 15:29:38 +01:00
robbond 870d6caa05 docs: record question-formulation fix 2026-08-12 15:07:13 +01:00
robbond fa42a2643a fix(graph): preserve grammar for question-like unknown labels 2026-08-12 15:02:56 +01:00
robbond b1914f5da7 experiment: test next-question formulation 2026-08-12 13:53:03 +01:00
robbond 20e4b58440 experiment: test evidence preservation with one uncertainty 2026-08-12 13:46:29 +01:00
robbond 32184694c5 experiment: test qualified-answer reasoning 2026-08-12 13:35:40 +01:00
robbond a78f3edb10 experiment: choose declaration recovery boundary 2026-08-12 13:27:02 +01:00
robbond a40a3e343e experiment: diagnose null semantic mutation path 2026-08-12 13:19:37 +01:00
robbond eaf3194752 experiment: observe direct meaning/action fields on anchored update 2026-08-12 12:09:32 +01:00
robbond 6a04d62800 docs: record accepted answer-meaning capture 2026-08-12 12:01:16 +01:00
robbond c4431997b1 tooling: capture accepted answer meaning directly 2026-08-12 12:00:18 +01:00
robbond d2891730af experiment: rerun incremental meaning on anchored uncertainty 2026-08-12 11:19:47 +01:00
robbond f23e2b2de0 docs: record update-only previous-question fix 2026-08-12 10:41:31 +01:00
robbond 8526aa4b69 tooling: supply anchored previous question in update-only mode 2026-08-12 10:41:02 +01:00
robbond 70db093cb1 experiment: test incremental meaning on existing uncertainty 2026-08-12 10:34:53 +01:00
robbond ce01e70010 tooling: add pre-anchored update-only mode to canonical harness
Add FIXTURE_MODE=updateOnly support that bypasses Start and sends the
committed fixture (tests/fixtures/pre-anchored-update-savings-realism.json)
directly as an Update request body through production HTTP route.

scripts/reproduce-multi-turn-investigation.mjs:
  - Added ESM imports for deterministic fixture loading (fs, fileURLToPath, path)
  - Added FIXTURE_PATH constant pointing to committed fixture
  - Added fixtureMode env-var selector and runUpdateOnlyMode() function
  - Validates ANSWER_2 before any live call (zero calls if missing)
  - Verifies single savings-realism anchor invariant on load
  - Preserves all hardened capture fields in pre-anchored mode
  - Normal-mode Start→Update chain preserved under guard clause

tests/reproduce-multi-turn-investigation.harness.test.js:
  - Added 7 new harness tests for pre-anchored scenarios (46 total, all pass)
  - Updated runPreAnchoredSimulation to persist rejectedProposalSnapshot on rejection
  - Added runPreAnchoredSimulationWithBlock() helper

docs/:
  - New docs/experiment-57j78.md with full apparatus description
  - Updated docs/current-handoff.md with 57J.78 section
2026-08-12 10:19:09 +01:00
robbond 9b7721c610 experiment: audit pre-anchored live apparatus 2026-08-12 09:56:11 +01:00
robbond 85fb2b4256 experiment: validate controlled structural no-op live 2026-08-12 09:35:05 +01:00
robbond 8184e050c8 docs: record pre-anchored update apparatus 2026-08-12 09:13:40 +01:00
robbond d77a1ff04d tooling: add pre-anchored update fixture 2026-08-12 09:11:20 +01:00
robbond f78061c1db experiment: validate intentional structural no-op live 2026-08-12 08:49:40 +01:00
robbond 67699ecd03 docs: record structural action capture hardening 2026-08-12 08:33:06 +01:00
robbond beef434a6f tooling: capture structural action declaration in live harness 2026-08-12 08:32:21 +01:00
robbond fc06ff02e4 experiment: rerun structural action contract live 2026-08-12 08:26:58 +01:00
robbond 4de871092f docs: record structural action guard cleanup 2026-08-12 08:17:28 +01:00
robbond bd3c7d59ae fix(graph): make structural action contract authoritative 2026-08-12 08:15:41 +01:00
robbond c899ad620c experiment: validate structural action contract live 2026-08-12 08:04:41 +01:00
robbond 1b3bbd59aa docs: record structural action contract implementation 2026-08-12 07:29:28 +01:00
robbond 6aef806845 feat(graph): add structuralActionRequired contract (57J.67)
- Add structuralActionRequired field to graphUpdateSchema (optional boolean nullable)
- Validate declaration consistency in validateGraphUpdate():
  - true requires meaningful mutation (addedNodes/updatedNodes/addedEdges)
  - false permits intentional no-op when userSupportedMeaning populated
  - null/absent with meaning → reject
  - true/false mismatch on output shape → reject
  - preserve legacy no-op guard for non-contract paths
- Update prompt-builder: add field to required list, insert contract section between rules and Additional Guidance with two mandatory sentences
- 50 new tests: schema validation (4), prompt builder content checks (10), utils contract matrix (10), plus 26 existing suite migrations

All 197 graph tests pass.
2026-08-12 07:26:26 +01:00
robbond 5f9e8ebe33 experiment: finalize semantic action contract semantics 2026-08-12 06:30:40 +01:00
robbond 51da4b973f experiment: define semantic action contract placement 2026-08-12 06:23:21 +01:00
robbond 9425e7b2d6 experiment: define semantic action contract 2026-08-12 06:13:15 +01:00
robbond d7cb343838 experiment: diagnose semantic-to-mutation action ownership 2026-08-12 05:53:58 +01:00
robbond f022d6f4ad experiment: rerun equivalent uncertainty identity with hardened capture 2026-08-12 05:48:18 +01:00
robbond 47509d307b docs: record accepted-update capture hardening 2026-08-11 19:43:11 +01:00
robbond bf959bb9a0 tooling: retain accepted update experiment evidence 2026-08-11 19:42:43 +01:00
robbond 929486c354 experiment: validate equivalent uncertainty identity live 2026-08-11 19:30:08 +01:00