feat(confidence-engine): v0.60h migrate report route to use route [id] identity
This commit is contained in:
@@ -549,6 +549,54 @@ This defect will be addressed in a separate increment (v0.60h). It is NOT caused
|
||||
|
||||
v0.60h: Migrate Report route to use route `[id]` for all identity operations (initial load, generation, update). Preserve existing v0.58/v0.59 Report lifecycle and freshness semantics. This is an identity migration only — no Report redesign.
|
||||
|
||||
## v0.60h — Report Route Identity Migration
|
||||
|
||||
**Purpose:** Fix the Report route's two unscoped `loadInvestigation()` calls so it reads by route `[id]` instead of the legacy singleton path. Preserve all existing v0.58/v0.59 Report lifecycle and freshness semantics.
|
||||
|
||||
### What was implemented
|
||||
|
||||
| File | Change |
|
||||
|---|---|
|
||||
| `app/investigations/[id]/report/page.jsx` | Extract `routeId` from `params.id`; both `loadInvestigation()` calls scoped to `routeId`; "Back to investigation" link uses dynamic `/investigations/${routeId}`; save spreads snapshot carrying `id` (identity preserved by existing v0.60d contract) |
|
||||
| `tests/ui/investigation-overview-ui.test.jsx` | Enhanced storage mock to capture `loadInvestigation(id)` argument and `saveInvestigation(snapshot)` argument; added `listInvestigations: () => []` mock (pre-existing apparatus gap); 5 new identity assertions in "Report route identity — v0.60h" describe block |
|
||||
|
||||
### Deterministic evidence
|
||||
|
||||
- **Owning test file:** `tests/ui/investigation-overview-ui.test.jsx`
|
||||
- **Identity assertions (new):**
|
||||
- inv-a identified load + first generation: **PASS** (load called with "inv-a", fetch POST count = 1, saved snapshot retains id="inv-a", generatedFromRevision = investigationRevision)
|
||||
- existing report for inv-b renders without generation: **PASS** (load called with "inv-b", zero overview calls)
|
||||
- manual update reloads by same id and saves back: **PASS** (load called with "inv-c" after update click, save retains "inv-c", generatedFromRevision updated)
|
||||
- existing report hydration retains zero-call behaviour: **PASS** (no overview call when revisions match)
|
||||
- generation failure preserves existing Report: **PASS** (no partial persist on failure)
|
||||
- **Existing Report lifecycle tests (unchanged):** All 10 PASS — no regression from identity migration
|
||||
- **Pre-existing apparatus gaps:** 15 failures in Portfolio/restart sections due to `listInvestigations` mock gap (unrelated to v0.60h; pre-existing from v0.60g2)
|
||||
|
||||
### Identity mechanism
|
||||
|
||||
- Route params prop (`params.id`) → `routeId` (string or empty fallback)
|
||||
- `loadInvestigation(routeId)` — initial hydration + manual update
|
||||
- `saveInvestigation({ ...snapshot, investigationReport })` — identity preserved by snapshot spread; storage layer uses `snapshot.id` per v0.60d contract
|
||||
- "Back to investigation" link → `/investigations/${routeId}` (dynamic)
|
||||
|
||||
### Product files changed
|
||||
|
||||
| File | Scope |
|
||||
|---|---|
|
||||
| `app/investigations/[id]/report/page.jsx` | Route identity migration only (3 load/save scopes + 1 link update) |
|
||||
| `tests/ui/investigation-overview-ui.test.jsx` | Mock enhancement (load/save argument capture, listInvestigations stub) + 5 identity assertions |
|
||||
|
||||
### NOT changed
|
||||
|
||||
- Report generation logic
|
||||
- Overview API semantics
|
||||
- Empty-Done semantics
|
||||
- Findings workflow
|
||||
- Storage contract (`investigation-storage.js`, `local-storage.js`)
|
||||
- Portfolio/ScenarioForm/SituationGraph
|
||||
|
||||
---
|
||||
|
||||
## Next restart point
|
||||
|
||||
Consult `docs/design-evolution/README.md` for progressive loading of product reasoning and provenance chronology; load the relevant chapter only when a specific historical question requires it.
|
||||
|
||||
Reference in New Issue
Block a user