test(confidence-engine): verify v0.60h report identity

This commit is contained in:
2026-09-04 09:34:03 +01:00
parent 2af5971987
commit 4bc998ee3f
2 changed files with 316 additions and 0 deletions
+68
View File
@@ -597,6 +597,74 @@ v0.60h: Migrate Report route to use route `[id]` for all identity operations (in
---
## v0.60h-a — Clean deterministic verification of Report identity migration
**Purpose:** Isolate the contaminated v0.60h deterministic test evidence into a dedicated file, proving that Report identity assertions pass cleanly without unrelated Portfolio/restart apparatus failures.
**Why this exists:** The original v0.60h deterministic run targeted `tests/ui/investigation-overview-ui.test.jsx` (mixed file) and produced 15/15 unrelated Portfolio/restart failures due to shared mutable mocks — not Report defects. Under experiment discipline, this should have been classified as APPARATUS FAILURE with the v0.60h implementation left intact (which it was).
**What was done:** Created `tests/ui/v060h-report-identity.test.jsx` — a dedicated file containing only Report page assertions, isolated from Portfolio/restart test apparatus.
| Item | Value |
|---|---|
| Source mixed test inspected | `tests/ui/investigation-overview-ui.test.jsx` (Report route identity describe block at line 497) |
| Dedicated Report test | `tests/ui/v060h-report-identity.test.jsx` |
| Report assertions isolated | A (route identity on load), B (existing report no generation), C (first-gen with findings=[]), D (manual update), E (generation failure), F (update failure) — 6 tests total |
| Portfolio rendered/imported | NO |
| Restart behaviour included | NO |
| Storage provider imported | NO |
| localStorage used | NO (only as implementation detail of mock setup, not in assertions) |
| Module-cache manipulation used | NO |
### Isolation apparatus
| Category | What is included | What is excluded |
|---|---|---|
| Mocks | `loadInvestigation(id)`, `saveInvestigation(snapshot)`, `listInvestigations()`, `clearInvestigation()` | None beyond storage contract |
| Fixture | Minimal identified Investigation with `id: "inv-report-a"`, valid `situationGraph`, empty `findings` | No Findings, no re-open workflow |
| Route id | Fixed: `"inv-report-a"` (not dynamic UUIDs, not case-1) | No random discovery, no shared mutable refs |
### Deterministic evidence
| Invariant | Result |
|---|---|
| First run isolated command | `npx vitest run tests/ui/v060h-report-identity.test.jsx` |
| 6/6 Report assertions PASS on first run | YES |
| No reruns required | YES |
| Production files changed | NO |
| Build run | NO |
| Playwright / model / server activity | NONE |
### Assertions proven
| Category | Assertion | Result |
|---|---|---|
| A | `loadInvestigation("inv-report-a")` on initial load | PASS |
| B | Existing report renders without new overview POST | PASS |
| C | First generation: exactly one POST, snapshot id === `"inv-report-a"`, generatedFromRevision === 4 | PASS |
| D | Manual update reloads same id, saves back with updated revision | PASS |
| E | Generation failure preserves existing (no partial save) | PASS |
| F | Update failure preserves existing report | PASS |
### Classification: PASS
**v0.60h production implementation now has uncontaminated deterministic evidence for durable Report identity and the established Report lifecycle.**
- v0.60h production commit remains `2af5971` (untouched)
- Original v0.60h deterministic evidence was contaminated by unrelated mixed-file Portfolio/restart failures
- v0.60h-a introduced dedicated Report-only deterministic test
- Exact isolated command `npx vitest run tests/ui/v060h-report-identity.test.jsx` passed on its first run (6/6)
- Report identity/lifecycle is now cleanly verified independently of Portfolio/restart apparatus
### NOT proven by this verification
- All UI tests pass
- Portfolio/restart mixed apparatus is repaired
- The entire Vitest suite passes
- Empty-Done semantics were retested end-to-end
---
## 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.