diff --git a/.claude/memory/evals.md b/.claude/memory/evals.md index dd00ff91..8e80a667 100644 --- a/.claude/memory/evals.md +++ b/.claude/memory/evals.md @@ -89,3 +89,11 @@ Method: golden v2 PDFs frozen from the old pipeline before any change; suites re Result: verifier pass 1 ECARTS(36) = 4 real (golden test not pinning the new generated files, EditorRoute 398 lines, 5 stale doc lines, one eslint-disable) + my contract omissions (scope files, deleted legacy suites) + floor noise ("species" matched "spec"); pass 2 ECARTS(4) = replacement assertions missing for 4 deleted suites; pass 3 ECARTS(4) = doc counts + 3 more suites' assertions (PDF conclusion/metadata/attachment structure, ObservationCard, persistence). All closed by executors (two) and by hand (docs); cap of 3 passes reached → last lot not re-verified. Security PASS with LOW: prototype-key lookup on untrusted ids (fixed: Object.hasOwn + test), unbounded inflate on the primary attachment path + no file cap (fixed: 16 MiB attachment, 50 MB PDF + test), denylist SVG sanitiser acceptable while assets are repo-built (allowlist before Storage-served assets, Step 13). Anomalies: executor ran `pnpm format` repo-wide and reverted by hand (watch for `format` in briefs); foreign JSON attachment (no version) surfaced as incompatible_version → fixed to no_attachment (legacy message); verifier floor counts deleted legacy tests as findings until CLARIFICATIONS name them. Action: user validation of Step 5 (manual FR/EN flow, visual before/after); BDR-038, LRN-043. + +## EVAL-012 | 2026-10-10 | Step 5 addendum during user manual validation — per-leaf migration tests, archive check tool, final controls + +Method: user asked (while testing) for final controls on last lot + per-leaf test beyond the map + simple v2/v3 PDF comparison method. Built: anatomy test all 612 legacy leaves through `migrateReportV2ToV3` with committed map vs draft document (442 identical / 141 moved = 134 category + 7 leaf renames / 29 removed, snapshots + vet flag verbatim, 26 annotations on right view, v3 re-read stable); app test same leaves via `sheetIndex.nodeAt` + v3 PDF roundtrip; CLI `pnpm report:compare` (pure module + entry, `readAttachedDocument` split out of `extractReportJson`, behaviour unchanged). Contract criteria 16-18 added, gates MET, fresh verifier ×3 + security ×2. +Result: verifier pass 1 ECARTS(2) = floor only (EVAL-011 prose "eslint-disable" false positive → CLARIFICATIONS; 11 dropped `regionFromLabel` assertions → new `legacy.regions.test.ts` on `inferRegionCode`); security PASS + 2 MEDIUM (terminal control chars in untrusted strings; free text printed by default) → executor: `esc()` + `--full` privacy default; pass 2 ECARTS(1) (`--diff` still clear text, JSON.parse message echoed attachment fragment) + security PASS 4 LOW → executor: diff follows `--full`, generic reason, Cc/Cf escaping, regular files only; pass 3 CONFORME. Workspace 94/21/119/181, docker build OK. +Anomalies: verifier stage runs after executor edits only (concurrent reads otherwise); gates.sh needs `EVIDENCE: PENDING` placeholder lines on new criteria. Residuals noted, not fixed: ZodError message echoes closed-vocabulary received values (never names), `compareReport` computes v3 lines twice, template-literal lines >80 chars, locals >5 in two functions. +Action: await user manual validation of Step 5; residuals in TODO follow-up. + diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 5ae2f7c1..c08b667d 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -192,3 +192,5 @@ Step 4 validated + finished into develop. User decisions on the 7 open points - Step 5 preparation (2026-10-10): 4 analyzer agents (core/store, rendering, PDF, tests) + plan/spec reading → docs/development/STEP5_MIGRATION_ANALYSIS.md on chore/step-05-migration-analysis. Key facts: all 27 legacy data-anno-ids differ from canonical ids; 170/612 legacy finding paths moved/removed by curation → generated report-migration-map; markers never drawn by the app (in the SVG); PDF depends on markers only for the highlight; 66 tests import the registry. 8 decisions D1–D8 await the user. No implementation. - Step 5 implemented (2026-10-10, feature/step-05-app-on-canonical-sheet): domain report v3 + migration (80 tests), pipeline migration map/sheet-ref/app review drawings + layer renderer (110), app rewritten on the sheet (99 tests: service, store, provider, canvas, pickers, PDF v2/v3, route), legacy code removed, docs rewritten (ANNOTATION-RENDERING.md replaces the SVG convention). Root check green, docker build OK, real stack 267/267, default build carries no sheet. BDR-038, LRN-043. Gates next; awaiting user validation. - Step 5 gates (2026-10-10): verifier 36→4→4 (real gaps closed by 2 executors + doc fixes; cap reached, last test lot unverified by a 4th pass), security PASS (2 LOW fixed: prototype keys, size caps). EVAL-011. Final check green. Awaiting user validation; no publication; default build carries no sheet. +- Step 5 addendum (2026-10-10, user testing manually): per-leaf migration tests (612 leaves, anatomy + app + PDF roundtrip), `pnpm report:compare` archive check tool (privacy default, escaping), stale `scaffold:species` script removed, attachment read/parse split. Gates: verifier 2→1→CONFORME, security PASS ×2 (2 MEDIUM + 4 LOW fixed by executors). EVAL-012, LRN-044. Branch 14 commits ahead, not merged; awaiting user validation; no Step 6. + diff --git a/.claude/memory/learnings.md b/.claude/memory/learnings.md index ced0ccef..04fc8d47 100644 --- a/.claude/memory/learnings.md +++ b/.claude/memory/learnings.md @@ -330,3 +330,10 @@ Apply: next species/sheet curation; any overlay/diagnostic SVG rasterised with I Freeze golden artifacts with the OLD code before touching it (v2 PDFs via a one-shot vitest, MAKE_GOLDEN=1, deleted after): the new importer is then tested against real archive-like bytes. Generate id/path maps from the pipeline's own records (renames/removals), never hand-written, and commit them as golden-tested data. In React routes, click handlers bound through `useEffect` capture stale closures when two DOM clicks land before a re-render (tests dispatch synchronously): read `store.getState()` inside the handler. A sheet needed to restore a draft but only known from the draft → load the default species' sheet when no report is open. Vitest has its own config: a Vite plugin providing a virtual module must be registered there too. ImageMagick cannot verify marker look with `