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
This commit is contained in:
+26
-2
@@ -313,9 +313,33 @@ A fresh unanswered Question B displayed stale focused-investigation content from
|
||||
- Claude Playwright was not used for final verification because the canonical dev server was unavailable at that point
|
||||
- Full Vitest suite was not re-run in this session (only targeted regression test)
|
||||
|
||||
### v0.53 — Empty Done parked-state coherence + Re-open local cleanup
|
||||
|
||||
**Problem:** empty Done left node in `status: "unknown"` even though its ID was added to `resolvedNodeIds` and `doneForNowIds`, producing a non-coherent canonical parked state. Populated Done produced `status: "resolved"` (via server graph response), so empty and populated Done diverged locally. Additionally, the clarified-question Re-open handler called `reopenResolvedUnknown(graph, node.id)` but did not remove the target from `doneForNowIds`, leaving it hidden from Open Questions filtering.
|
||||
|
||||
**Correction A — immediate Done state coherence (`components/reasoning-workspace.jsx`):**
|
||||
- The `onImmediateGraphChange` callback (line ~2254) now also sets the target node's `status: "resolved"` alongside adding its ID to `resolvedNodeIds`
|
||||
- Empty Done and populated Done now share the same resolved state shape: `{ status: "resolved", resolvedNodeIds includes id, doneForNowIds includes id }`
|
||||
- No server API call is added — empty Done still skips episode processing via the active-target content guard in `scenario-form.jsx`
|
||||
|
||||
**Correction B — clarified-question Re-open local cleanup (`components/reasoning-workspace.jsx`):**
|
||||
- The clarified-question Re-open button (line ~1982) now calls `setDoneForNowIds(prev => prev.filter(id => id !== node.id))` after installing the reopened graph
|
||||
- The node visibly returns to Open Questions because both filtering sets (`resolvedNodeIds` and `doneForNowIds`) no longer contain the target ID
|
||||
|
||||
**Verification:**
|
||||
- Targeted Vitest (`tests/empty-done-orchestration.test.jsx`) — 23 tests pass (original 14 gate tests + 9 new coherence/reopen/history tests)
|
||||
- `npm run build` — compiles successfully
|
||||
- Playwright live verification: NOT RUN (no existing investigation with parked questions available on the persisted dev server state at http://localhost:3000)
|
||||
|
||||
**Preservation guarantees:**
|
||||
- Empty Done still skips completed-episode API call when active target has no episode content (active-target guard in scenario-form.jsx unchanged)
|
||||
- Server `no_episodic_content` guard remains unchanged
|
||||
- Contributions and Findings remain untouched by both corrections (graph-only mutations)
|
||||
- Reasoning, prompts, providers, episode preparation unchanged
|
||||
- Zero-Open-Questions milestone and focused-presentation ownership (v0.52) remain unchanged
|
||||
|
||||
### Open defects
|
||||
|
||||
- **Focused-investigation state bleed**: Resolved by v0.52 correction above (scoped presentation derivation). Verified by targeted Vitest, build, and Rob manual visual verification.
|
||||
- Empty Done `no_episodic_content`: choosing Done without episodic content can produce `{ success: false, stage: "preparation", error: "no_episodic_content" }` — separate future increment
|
||||
- Empty Done `no_episodic_content`: choosing Done without episodic content can produce `{ success: false, stage: "preparation", error: "no_episodic_content" }` — separate future increment (empty-Done orchestration guard now prevents the 400 in practice by skipping episode processing entirely)
|
||||
|
||||
**Next restart point:** The empty-Done `no_episodic_content` 400. Implement and verify that a Done action taken when no episodic evidence exists produces the same user-facing state (CU refresh with appropriate messaging) without a 400 error.
|
||||
|
||||
Reference in New Issue
Block a user