Commit Graph
12 Commits
Author SHA1 Message Date
robbond 7177c7bb61 refactor(confidence-engine): make episode preparation server-owned 2026-09-01 11:54:02 +01:00
robbond 8432ed45d4 fix(confidence-engine): keep episode reasoning server-side 2026-09-01 11:24:48 +01:00
robbond 3235c35cf0 feat(confidence-engine): add focused finding handoff plumbing 2026-08-26 16:07:21 +01:00
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 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 7d06cd3c47 reasoning: use structured semantic fidelity contract 2026-08-11 16:45:00 +01:00
robbond 7965375aff refine answerMeaning contract around user-supported meaning 2026-08-09 08:50:37 +01:00
robbond 0d7ad5775c reasoning: add proposal-level answer meaning guard
- Add answerMeaning schema with supportCategory and resolutionGuidance enums
- Add pre-mutation guard that validates proposal alignment with answerMeaning
- Update prompt builder to instruct the model on answerMeaning contract
- Add tests for schema, guard logic, parsing defaults, and regression cases A-D
2026-08-09 07:07:21 +01:00
robbond 1d64144e01 feat: separate confidence from reasoning completeness 2026-08-03 07:05:20 +01:00
robbond 25a989450c feat: advance reasoning after comparability is resolved 2026-08-02 17:06:34 +01:00
robbond 72ef175971 feat: surface new unknowns after graph updates 2026-08-02 10:30:59 +01:00
robbond 0ccc03c111 feat: add situation graph foundation 2026-08-02 06:59:23 +01:00