Commit Graph
298 Commits
Author SHA1 Message Date
robbond 46b9bd8b03 fix(confidence-engine): retain successful provider path 2026-09-05 17:12:31 +01:00
robbond dabd9e2245 fix(confidence-engine): expose failed provider path 2026-09-05 17:00:33 +01:00
robbond 677f5e5757 fix(confidence-engine): use configured model for chat detection 2026-09-05 16:46:24 +01:00
robbond 8c3edfec7d fix(confidence-engine): log case-start failures 2026-09-05 14:37:29 +01:00
robbond 72324e63c8 fix(confidence-engine): enforce relationship endpoint references 2026-09-05 14:09:25 +01:00
robbond 84fc53f017 fix(confidence-engine): expose reconstruction validation issues 2026-09-05 13:48:48 +01:00
robbond e5de8564a4 fix(confidence-engine): preserve intervention fit dependency 2026-09-05 13:33:01 +01:00
robbond 55e935066c fix(confidence-engine): project unexplained transitions 2026-09-05 13:15:11 +01:00
robbond e1839147b1 fix(confidence-engine): clarify relationship direction 2026-09-05 12:55:39 +01:00
robbond fb49df87aa feat(confidence-engine): expose initial reconstruction evidence 2026-09-05 12:39:17 +01:00
robbond 7472b6ecb0 feat(confidence-engine): preserve initial reconstruction relationships 2026-09-05 11:53:58 +01:00
robbond 13fbceee7a feat(confidence-engine): strengthen initial reconstruction contract 2026-09-05 10:43:57 +01:00
robbond 37245a8e28 fix(confidence-engine): expose reconstruction failure evidence 2026-09-05 08:18:04 +01:00
robbond f2a761d26f test(confidence-engine): expose reconstruction experiment seam 2026-09-04 19:42:27 +01:00
robbond 642554038e test(confidence-engine): prove direct helper production seam 2026-09-04 14:33:02 +01:00
robbond 928954ee4a test(confidence-engine): verify direct decomposition helper 2026-09-04 14:02:36 +01:00
robbond cc3a5dabd4 feat(confidence-engine): v0.60j preserve investigation on restart 2026-09-04 10:18:22 +01:00
robbond 4bc998ee3f test(confidence-engine): verify v0.60h report identity 2026-09-04 09:34:03 +01:00
robbond 2af5971987 feat(confidence-engine): v0.60h migrate report route to use route [id] identity 2026-09-04 08:17:01 +01:00
robbond df142ca76c feat(confidence-engine): v0.60g2 render investigation portfolio 2026-09-04 07:58:04 +01:00
robbond 7ba1771bcf feat(confidence-engine): v0.60g1 list investigation summaries
Recover to clean v0.60f then implement only the storage listing contract.

- Add listInvestigations() to provider: enumerate by prefix, project lightweight summary (id, scenario, updatedAt, investigationRevision, reportExists, reportGeneratedFromRevision), sort by updatedAt desc
- Add application-facing wrapper in investigation-storage.js
- Add 8 deterministic tests covering all listing invariants (coexistence, correct IDs, lightweight projection, legacy exclusion, unrelated exclusion, independent update, ordering, malformed skip)
- Fix MockStorageMap WebStorage API compatibility (.length + .key(i))
- Portfolio NOT migrated — that is v0.60g2
2026-09-04 06:45:26 +01:00
robbond 4b55ad1eae feat(confidence-engine): v0.60f allocate investigation identity on create
Replace Portfolio's static "+ Create new investigation" link (href:
/investigations/case-1) with a <button> that allocates an opaque
application-owned durable ID via crypto.randomUUID() and navigates
via router.push to /investigations/{id} without persisting any empty
Investigation.

INVESTIGATION_ID constant retained only for card links (Continue
investigation / View report) — not migrated in this increment.

Test: deterministic Create New activation test verifies UUID allocation,
navigation to generated ID route, and zero saveInvestigation calls.
2026-09-03 19:20:28 +01:00
robbond 827411f254 refactor(confidence-engine): v0.60d clarify investigation storage identity
Replace bare re-export in investigation-storage.js with explicit wrapper
functions that own the canonical identity contract: snapshot.id is the sole
save identity authority. The provider never allocates or changes IDs.

7 new deterministic tests prove: identified snapshots persist under their
own id key, explicit competing id arguments are ignored, A/B remain
independently addressable, unknown IDs return null, and legacy singleton
compatibility is preserved for unmigrated callers.

No application callers modified. UI/routes not migrated.
2026-09-03 18:29:00 +01:00
robbond 8c85120b1c feat(confidence-engine): v0.60c identity-aware investigation storage
- loadInvestigation(id) selects by durable ID when provided, null for unknown
- saveInvestigation(snapshot, id) persists under provider-chosen key derived from id
- clearInvestigation(id) removes specific investigation by identity when provided
- localStorage representation: confidence-engine-investigation:<durable-id>
- Backward-compatible singleton path preserved for existing unmigrated callers
- 6 new targeted tests proving two independently addressable Investigations
2026-09-03 18:09:03 +01:00
robbond f06138de32 feat(confidence-engine): v0.59b-c — report freshness on Report page + Portfolio
v0.59b — Report page freshness UI:
- Shows Current / Update available beside the generated report
- Manual Update report action with duplicate prevention guard
- Explanation copy about investigation changes since generation
- Persists generatedFromRevision during update flow

v0.59c — Portfolio Report freshness state:
- Surfaces Current / Update available alongside existing View report link
- Derives solely from revision provenance (zero model calls)
- No Update report action on Portfolio (manual update owned by Report page)
- Neither state shown when no Report exists
- Updated makeSnapshot with investigationRevision for realistic test data
2026-09-03 14:41:02 +01:00
robbond 99b3d26817 feat(confidence-engine): v0.59a — correct Investigation revision provenance
Semantic revision tracking ensures every meaningful persisted
Investigation change advances investigationRevision exactly once,
while Report generation records (but does not advance) the current
revision as generatedFromRevision for provenance integrity.

Corrections:
- updateFindingDisposition: add setInvestigationRevision(+1) for
  semantic transitions (eligible→not_relevant, restore)
- updateFindingProposition: add no-op guard + setInvestigationRevision(+1)
- onRestart/ContinueLaterBanner/reset button: add setInvestigationRevision(0)
- onSituationGraphChange (Re-open seam): already had revision +1 in dirty impl

Established behaviour preserved:
- Re-open via reopenResolvedUnknown → onSituationGraphChange → revision +1
- Empty Done via handleDoneForNowPromotion → revision +1
- Report generation records generatedFromRevision, advances by 0
- Autosave passes revision but does not increment it
- clearInvestigation() ownership intact

Tests: targeted Vitest suite (17 tests) covering all provenance boundaries.

Durable rule documented in current-handoff.md §v0.59a.
2026-09-03 13:39:40 +01:00
robbond 7db28c8611 feat(confidence-engine): generate investigation report on demand 2026-09-03 09:18:29 +01:00
robbond 99b75dca4e feat(confidence-engine): confirm destructive investigation restart 2026-09-03 07:36:43 +01:00
robbond 0da7b63e30 refine(confidence-engine): clarify portfolio investigation actions 2026-09-03 07:01:18 +01:00
robbond 32e1b01767 feat(confidence-engine): separate investigation report routes 2026-09-03 06:39:35 +01:00
robbond 745026f0a0 feat(confidence-engine): v0.54b integrate Investigation Overview UI seam + bounded scroll cleanup
- Wire transient overview state from ScenarioForm to ReasoningWorkspace
- Inline rendering of investigation overview below milestone invitation
- Remove obsolete scrollIntoView after overview request (scrolled away from rendered content)
- All four overview props consumed in ReasoningWorkspace render path
- Targeted Vitest: 9/9 PASS (tests/ui/investigation-overview-ui.test.jsx)
- Production build: compiles successfully
2026-09-02 15:14:20 +01:00
robbond 83818c0c71 feat(confidence-engine): add investigation overview synthesis seam 2026-09-02 14:34:32 +01:00
robbond f2c9e4c0b2 fix(confidence-engine): align empty done and reopen state
- Empty Done immediate transition now sets node.status to resolved
  alongside resolvedNodeIds/doneForNowIds — same canonical parked
  shape as populated Done (no server call required)
- Clarified-question Re-open removes target from doneForNowIds so
  the question visibly returns to Open Questions
- Immediate graph mutation creates new node objects immutably
  (React state semantics), touching only the target node
2026-09-02 13:37:15 +01:00
robbond 2b2096e41d fix(confidence-engine): scope focused presentation to active question
- FocusedQuestionBody derives thread-local contribution subset using
  targetNodeId || originatingTargetNodeId matching
- hasCompletedContext, latest completed contrib, and all effective
  presentation fallbacks use scoped collection only
- scenario-wide focusedContributions history preserved in memory
- Fresh Question B no longer bleeds Question A's content across
  every presentation surface (Previously answered, What this tells us,
  Still unclear, Questions this raises, Assumptions, Connections)
- Reopening or revisiting Question A still uses its own history
- Targeted regression: 3 new Vitest cases pass
- Handoff docs updated with v0.52 correction record
2026-09-02 12:46:50 +01:00
robbond a061428711 feat(confidence-engine): place zero-Open-Questions milestone at Open Questions position
Move the milestone invitation from after Clarified Questions to occupy
the same spatial position as Open Questions — between Current Understanding
and Questions we have clarified. Uses ternary: openUnknowns > 0 ? OpenQuestionsUI : milestoneAllowed ? MilestoneInvitation : null, followed by ClarifiedQuestionsUI unconditionally. No duplication of clarified cards or Re-open controls.
2026-09-02 12:02:55 +01:00
robbond 043ba5f264 feat(confidence-engine): clarify understanding during Done refresh 2026-09-02 07:53:45 +01:00
robbond b647236d44 fix(confidence-engine): constrain understanding to supported evidence 2026-09-01 18:17:26 +01:00
robbond cd895a33ff feat(confidence-engine): reopen clarified questions 2026-09-01 16:07:22 +01:00
robbond a23da2b727 refactor(confidence-engine): expose canonical graph replacement seam 2026-09-01 15:15:55 +01:00
robbond 76c6096905 fix(confidence-engine): resolve model for episode reasoning 2026-09-01 13:24:37 +01:00
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 650877e5bf feat(confidence-engine): wire authoritative Done-for-now episode reconsideration
Adopt executeEpisodeDone orchestration as the canonical path for
'Done for now' activity boundary: one user Done triggers exactly
prepareCompletedEpisode -> reconsiderCompletedEpisode -> applyValidatedProposal
-> Current Understanding synthesis -> leave focused workspace.

Production changes (components/scenario-form.jsx):
- Add prepareCompletedEpisode, reconsiderCompletedEpisode, applyValidatedProposal imports
- Export executeEpisodeDone({params}) with all 4 domain functions as named
  parameters (defaults to module exports) for deterministic test wiring
- Rewrite handleDoneForNowPromotion(targetNodeId) as async: delegates to
  executeEpisodeDone pipeline; CU synthesis installed only on success
- Add doneInProgressRef useRef(false) for exactly-once Done enforcement
- On synthesis failure: KEEP updated graph, KEEP Findings, KEEP existing CU
- Retire produceFindingInformedSummary from ScenarioForm (legacy CU writer)
- Remove legacy idempotence guard and Evidence:[] regex dedup

Test changes (tests/ui/scenario-form-episode-done.test.jsx):
- 9 tests verifying orchestration pipeline correctness:
  1. Successful path order: prepare -> reconsider -> apply -> synthesis
  2. Correct prepared episode input parameters
  3. Structured application evidence (no answer fields in context)
  4. nextGraph used for synthesis (not stale result state)
  5. Reasoning failure: apply not called, CU synthesis not called
  6. Application failure: CU synthesis not called, graph not replaced
  7. Synthesis failure: nextGraph remains installed (no rollback)
  8. Exactly-once per call for each domain function
  9. Legacy Done writer retired (pipeline does not produce deterministic summary)
2026-09-01 10:05:12 +01:00
robbond c89cc51ae6 feat(confidence-engine): add completed episode reasoning seam 2026-09-01 09:28:02 +01:00
robbond ab655e2222 fix(confidence-engine): scope episode closure authority 2026-09-01 08:55:38 +01:00
robbond 0752c53a25 feat(confidence-engine): accept episode evidence at graph application 2026-09-01 08:30:26 +01:00
robbond 6b77e32771 feat(confidence-engine): accept completed episode reasoning input 2026-09-01 06:59:04 +01:00
robbond efa39f52de feat(confidence-engine): prepare completed episode evidence 2026-09-01 06:48:55 +01:00
robbond b270aa5624 feat(confidence-engine): case/update synthesis — dedicated reconstruction per update (v0.50)
Architecture: after successful /api/cases/update, derive explicit nextGraph +
nextFindings, call synthesizeFromFindings exactly once, replace Current
Understanding with reconstruction result.

Key invariants:
- outcome.summary retired as final CU authority → always synthesis reconstruction
- Explicit derived state (no React-state reread) for graph and findings
- Previous CU preserved on synthesis failure (no fallback to outcome.summary)
- Graph and Findings NOT lost on synthesis failure
- saveInvestigation persistence uses currentUnderstanding, not outcome.summary

Deterministic regression: 7 tests (Cases A-E + 2 edges) covering all rules.

Files: components/scenario-form.jsx, tests/ui/scenario-form-case-update-synthesis.test.jsx
2026-08-31 09:22:50 +01:00
robbond 989b88a4a1 feat(confidence-engine): synthesize restored findings 2026-08-31 08:18:44 +01:00