From d7c9d39b13249909458d099e33d036b5631f898e Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Sun, 12 Jul 2026 16:56:32 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20apply=20reconcile=20suggestions=20?= =?UTF-8?q?=E2=80=94=20CLAUDE.md=20drift=20+=20TODO=20sync?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit REC-1: registry cross-ref ranges (22 BDR / 31 LRN / 5 BLK). REC-2: env-var identity checked with tour evidence. REC-3: draft mirror note — restore landed f58a49f. REC-4: CLAUDE.md factual drift — canvg→native raster, svgToPngDataUrl→ loadSvg, version 1→2, pako→DecompressionStream, pnpm path, folder tree (EditorsRoute, AppHeader/Footer, LateralityPicker, pdf render files). TODO gains a dated tour+fixes DONE block. --- .claude/tasks/TODO.md | 14 +++++++++----- CLAUDE.md | 23 +++++++++++------------ 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index 8af7c37c..517aa2ea 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -38,6 +38,10 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo - [x] pathology-editor.html prod 404 fixed — served from public/ so it ships to dist (2803cf7, LRN-029) - [x] gitflow socle + pre-commit hook adopted (4991c10) +### Tour + fixes 2026-07-12 (branch chore/tour-2026-07-12 — UNMERGED, review pending) +- [x] /tour sweep: CVE deps patched (pnpm audit 0), SVG import sanitized, container non-root (**BREAKING: PORT >=1024**), nginx:1.31-alpine pin, dead code −93 lines (canvg dropped), docs synced. Report: .claude/audits/TOUR.md +- [x] Post-tour fixes: aria-labels i18n (B-1/B-2), EN PDF title prefix (B-4), SvgEditor placeholders (B-5), species labelEn (B-6), draft restore (B-3, TDD), entrypoint escaping (SEC-9), PDF decompression cap (SEC-8, TDD), dead BoneState + 22 unused PNGs (CLN-6/7). 180/180 tests. + --- ## Phase A — DONE (kept for reference) @@ -47,7 +51,7 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo - [x] Anatomy: parseSvgBones, loadSvg, svgToPng raster - [x] Zustand store: full action set (initReport, hydrateReport, observation CRUD, conclusion/recommendations/nextAppointment setters, identity setters) -- [x] sessionStorage draft mirror + localStorage practitioner cache +- [x] sessionStorage draft mirror + localStorage practitioner cache (restore path was missing until f58a49f 2026-07-12 — refresh now keeps the session) - [x] UI primitives: Button, Card, Dialog, Input, Label, Select, Textarea, Badge, Chip - [x] Canvas: AnatomyCanvas (data-state highlighting, async-mount safe), DetailModal - [x] Observation chain: ObservationList, ObservationCard, PathologyPicker (flat — REMOVED, replaced by FindingsTreePicker B2), @@ -123,7 +127,7 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo - [ ] PDF QA manual pass: full flow → export → re-import roundtrip - Fonts embed, JSON attached, multi-SVG grid OK, locale FR + EN exports - [x] Docker build + compose up smoke test (VPS cold build validated — BLK-005, 990c8e7; local smoke not separately logged) -- [ ] env-var brand identity verified +- [x] env-var brand identity verified (tour 2026-07-12: docker run APP_BRAND_NAME=TourCheck → env.js correct, non-root; hostile-quotes case covered by 0214ae1) - [x] README finalize (install, dev, Docker, env vars, locale, MIT) - [x] CHANGELOG 0.1.0 entry - [x] docs/PATHOLOGIES-FORMAT.md — schema doc + authoring guide (initial shipped 70f21cc 2026-05-20; refreshed for v2.0 boolean-only contract 2026-05-21 — scope section, 5 taxonomy patterns, structural rules, breaking-change notice, horse stats, changelog v1.0→v2.0) @@ -144,9 +148,9 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo ## Memory cross-refs -- BDR-001..BDR-008 — decisions registry -- LRN-001..LRN-010 — learnings registry -- BLK-001..BLK-004 — blockers (all resolved) +- BDR-001..BDR-022 — decisions registry +- LRN-001..LRN-031 — learnings registry +- BLK-001..BLK-005 — blockers (all resolved) Apply when implementing B-phase: - LRN-004 (data-anno-special opaque to parser) — zone IDs in JSON must match SVG `data-anno-id` diff --git a/CLAUDE.md b/CLAUDE.md index 867d2086..cb995b81 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -29,7 +29,7 @@ MVP species: equine only. Open-source MIT. | State | Zustand | 5 | | Validation | Zod | 3 | | PDF | pdf-lib | 1.17 | -| SVG raster | canvg | 4 | +| SVG raster | native Image/canvas (no dependency) | — | | Animation | motion | 11 | | Tests | vitest + happy-dom + @testing-library/react | 3.x | | Deploy | Docker multi-stage → nginx:alpine | — | @@ -77,8 +77,8 @@ docker compose up --build docker compose down ``` -Note: pnpm binary at `~/.local/share/pnpm/bin/pnpm` on dev host (corepack broken). -Add it to PATH: `export PATH="$HOME/.local/share/pnpm/bin:$PATH"`. +Note: pnpm binary at `~/.local/bin/pnpm` on dev host (corepack broken). +It is normally already on PATH; otherwise `export PATH="$HOME/.local/bin:$PATH"`. --- @@ -113,7 +113,7 @@ osteo/ ├─ src/ │ ├─ app/ │ │ ├─ App.tsx ← root router -│ │ ├─ routes/{Home,NewReport,Editor,SvgEditor,NotFound}Route.tsx +│ │ ├─ routes/{Home,NewReport,Editor,Editors,SvgEditor,NotFound}Route.tsx │ │ └─ providers/ConfigProvider.tsx ← AppConfig context │ ├─ config/env.ts ← runtime config resolution │ ├─ domain/ @@ -139,20 +139,20 @@ osteo/ │ ├─ anatomy/ │ │ ├─ types.ts ← Bone, BoneCategory, BoneState │ │ ├─ svgConvention.ts ← parseSvgBones() -│ │ ├─ svgLoader.ts ← loadSvg(), svgToPngDataUrl() +│ │ ├─ svgLoader.ts ← loadSvg() │ │ └─ labels.ts ← boneLabel(bone, locale, fallback) │ ├─ components/ │ │ ├─ ui/{Button,Card,Dialog,Input,Label,Select,Textarea,Badge,Chip}.tsx │ │ ├─ canvas/{AnatomyCanvas,DetailModal}.tsx │ │ ├─ observation/{ObservationList,ObservationCard,FindingsTreePicker, -│ │ │ VertebraPicker,SeveritySelector, +│ │ │ VertebraPicker,SeveritySelector,LateralityPicker, │ │ │ FreeTextFindingInput}.tsx │ │ ├─ report/{ReportHeader,PractitionerForm,AnimalForm, │ │ │ ConclusionPanel,NextAppointmentPicker}.tsx -│ │ └─ brand/{Brand,LanguageSwitcher}.tsx +│ │ └─ brand/{Brand,AppHeader,Footer,LanguageSwitcher}.tsx │ ├─ pdf/ │ │ ├─ export.ts + import.ts + attachment.ts + fonts.ts -│ │ └─ render/{header,footer,observationPage,conclusionPage,svgToPng}.ts +│ │ └─ render/{header,footer,observationPage,conclusionPage,svgToPng,text,logo,linkAnnotation}.ts │ ├─ lib/{dates,id,assert,zoneMatch,spineZones}.ts │ ├─ styles/{index,tokens,svg-editor}.css ← Tailwind v4 CSS-first + SVG editor styles │ └─ main.tsx @@ -253,7 +253,7 @@ Runtime config ### Schemas - domain/schema/*.ts are the data contracts — never change without bumping version - All user-provided data goes through Zod parse before hitting the store -- ReportSchema.version = 1 for MVP; future breaking changes → version 2 +- ReportSchema.version = 2 (v1 attachments rejected at import with a typed error); future breaking changes → version 3 ### Stores - No direct store mutation outside Zustand actions @@ -302,7 +302,6 @@ Runtime config | zustand 5 | Lightweight global state | | zod 3 | Schema validation + type inference | | pdf-lib 1.17 | Pure-JS PDF generation + native attachments | -| canvg 4 | SVG → Canvas rasterization for PDF | | motion 11 | Animations (modals, toasts, observation cards) | | vitest 3 | Test runner | | happy-dom | DOM environment for tests | @@ -321,8 +320,8 @@ Runtime config - Never modify anatomy SVGs in public/species/ — they are source assets from the user. - Pathology DB entries must be source-cited before commit; client review required for MVP batch. - Ask before any change to importReportFromPdf or extractReportJson — these handle user data. -- After PDF roundtrip tests fail: check attachment bytes, then Zod validation, then pako decompression. -- pnpm binary: `~/.local/share/pnpm/bin/pnpm` on dev host. Add to PATH in shell profile. +- After PDF roundtrip tests fail: check attachment bytes, then Zod validation, then DecompressionStream inflation. +- pnpm binary: `~/.local/bin/pnpm` on dev host (normally already on PATH). ## Commit message convention