fix(confidence-engine): preserve follow-up progression ownership

This commit is contained in:
2026-08-30 08:28:29 +01:00
parent 17c6048047
commit 8bded90094
4 changed files with 408 additions and 9 deletions
+66
View File
@@ -2092,3 +2092,69 @@ previous question
```
Exact UI labels and wording remain subject to later UX refinement. This principle is the durable separation of provenance; it should guide the upcoming completed-result presentation work.
---
### v0.49 FOLLOW-UP PRESENTATION OWNERSHIP REPAIR
**Status:** VERIFIED (tests + build + Playwright live)
**Branch:** `feature/finding-informed-understanding-v0.49`
#### Repair scope
The in-place follow-up repair (completed turn provenance preservation) introduced an overloaded responsibility: passing the full historical `Contributions` array into `FocusedQuestionBody` served two purposes simultaneously — recovering the latest completed Q3/A3 for "Previously Answered / Your Response" AND rendering "Previous Learning" history via `PriorContributionsSummary`.
Those are distinct presentation responsibilities. Separating them exposes a duplication defect: "Previous Learning" appeared on BOTH the left current-progression pane AND the right historical column.
#### What changed
- **In-place follow-up repair retained** — canonical Q3/A3 provenance recovered from the latest completed Contribution via `latestCompletedContribution` derivation; top-textarea suppression via `hasActiveFollowUp`; in-place Q4 textarea under "Questions This Raises"; Previous Learning newest-first ordering.
- **Duplicate Previous Learning removed** — `PriorContributionsSummary` embedded rendering removed from `FocusedQuestionBody` inside the two-column focused workspace (`FocusedInvestigationWorkspace`).
- **Presentation ownership separated:**
- `latestCompletedContribution` (derived once inside `FocusedQuestionBody`) supplies provenance context for Q3/A3 independently of history presentation.
- Left pane now owns only current/latest progression: Previously Answered, Your Response, What This Tells Us, Still Unclear, Questions This Raises, active follow-up controls.
- Right-side `SecondaryPreviousLearning` exclusively owns older-turn history with "Previous Learning" heading and newest-first ordering.
- **Exactly one "Previous Learning" surface** across the focused workspace.
- **Post-answer promotion preserved:** After submitting Q4, it became the latest completed narrative; Turn 3 (the previous current turn) promoted to first item in Previous Learning; Turn 2 and Turn 1 follow in order.
#### Test results
- **Tests passed:** 116/116 (`tests/open-questions-vs-assumptions.test.jsx`)
- **Build:** PASS
- **Full Vitest:** NOT RUN (bounded scope)
#### Playwright live verification
- Correct Q3 retained under "Previously Answered": YES
- Correct A3 retained under "Your Response": YES
- Q4 remains in place as follow-up textarea: YES
- Visible textarea count: 1
- Top duplicate "Question" heading: ABSENT
- Left-side Previous Learning visible: ABSENT (removed)
- Right-side Previous Learning visible: YES (exactly one)
- Previous Learning heading count across workspace: 1
- Previous Learning order: newest-first (Turn 2 → Turn 1 before fix; Turn 3 → Turn 2 → Turn 1 after post-answer submission)
#### Post-answer verification
- Natural focused answers submitted: 1 (Q4 inline answer)
- New turn became latest narrative: YES (Q4 text under "Previously Answered")
- Previous turn became first historical item: YES (Turn 3 as first entry in Previous Learning on the right)
- Single Previous Learning surface preserved: YES
#### Critical regression boundaries
- Persistence changed: NO
- Contribution schema changed: NO
- Finding semantics changed: NO
- Graph reasoning changed: NO
- Current Understanding changed: NO
- Workspace controls changed: NO
#### Next position
- Completed-result provenance: CLOSED
- In-place follow-up continuation: CLOSED
- Previous Learning single-owner presentation: CLOSED
- Previous Learning newest-first: CLOSED
- Post-answer promotion: PRESERVED