fix(confidence-engine): show focused investigation activity

This commit is contained in:
2026-08-29 15:15:28 +01:00
parent 0f4dfcbb17
commit b9c0b6f6f7
3 changed files with 212 additions and 12 deletions
+51
View File
@@ -1795,6 +1795,57 @@ State: 1 contribution targeting n58lwnx, 3 findings.
- Current Understanding narrative reconstruction (lower priority after integration is established)
- Any speculative cold-hydration/schema/provider fixes
### PHASE 7 — OPEN QUESTION INVESTIGATING CUE ON INITIAL REFLECTION SURFACE (v0.49)
#### Defect
The initial post-Analyse reflection surface renders Open Questions as plain buttons with only the epistemic Unclear tag. ThreadContributionsBadge was absent from ReasoningWorkspace's initial reflection surface button rendering. Investigated questions were visually indistinguishable from untouched questions on the normal Open Questions surface.
#### Repair
Added ThreadContributionsBadge as a sibling element after each Open Question button in ReasoningWorkspace's openUnknowns map, wrapping the button+badge in a shared div for vertical layout. The badge receives the same props it already uses in all other surfaces: nodeId, focusedContributions, and findings.
The existing filter inside ThreadContributionsBadge matches contributions via OR logic:
```
c.targetNodeId === nodeId || c.originatingTargetNodeId === nodeId
```
This captures both direct-target contributions and follow-up contributions whose origin anchors to a different Open Question.
#### What remains unchanged
- Unclear tag renders independently of activity — epistemic state is NOT derived from contribution history.
- The amber INVESTIGATING text above the learned-contributions summary is rendered by ThreadContributionsBadge, not redesigned.
- No new persisted state, store, or Finding source of truth introduced. Activity derives exclusively from canonical focusedContributions.
#### Deterministic tests (89 total in test file, 17 new for this phase)
All cases pass:
- Untouched question → Unclear only, no INVESTIGATING.
- Direct targeted contribution → INVESTIGATING visible.
- Follow-up/origin contribution (different immediate target) → INVESTIGATING visible via originatingTargetNodeId match.
- Question isolation — investigated shows cue, untouched does not.
- Multi-turn cold-return recovery via originatingTargetNodeId.
#### Live Playwright verification
URL: http://localhost:3000
Existing investigation reused: YES (onboarding funnel abandonment scenario)
LLM/API calls: 0
Return-to-overview (Phase 6):
- Originating question ("Which specific step of the onboarding funnel has the highest abandonment rate?"): Unclear + INVESTIGATING + learned contributions count visible.
- Untouched comparison ("Whether unclear instructions at account setup are causing users to stall."): Unclear only, no INVESTIGATING.
Cold reload (Phase 7):
- Same investigation state returned after normal browser reload.
- Originating question retains Unclear + INVESTIGATING + contributions count.
- Untouched questions remain without INVESTIGATING.
- Zero LLM/API calls performed.
#### Classification
A — REPAIR VERIFIED
### BUILD → BREAK → LEARN
Do not invent architecture ahead of evidence. Every architectural direction should emerge from live behaviour, not from design speculation. Use small bounded increments. Trace before changing unclear ownership paths. Do not broaden scope — keep focused on what the current evidence demands.