Files
faunosteo/.claude/tasks/TODO.md
T
Bastien ChanotandClaude Opus 4.7 b7b094535e chore(memory): TODO + journal + BDR-009..011 + LRN-011..012
Mark B0/B1/B2/B5 done on TODO. Journal 2026-05-20 entry with the three
commit SHAs and a per-phase recap. Three new design decisions captured:
JSON snake_case kept in TS (BDR-009), snapshot labels at selection time
(BDR-010), hard-fail v1 PDF with FR-language message (BDR-011). Two new
learnings: Zod recursive schemas via z.lazy + explicit ZodType<T>
(LRN-011), once-per-session UX modal via sessionStorage flag (LRN-012).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 03:51:36 +02:00

6.9 KiB

TODO — Osteo Report MVP

Status (2026-05-20): findings tree refactor landed (B0+B1+B2) — i18n + full horse catalog next

Domain pivot bundle (B0 schema, B1 report v2, B2 UI/PDF) shipped on feat/findings-tree-v2. Editor now consumes the hierarchical SpeciesFindings tree; PDF roundtrip green; v1 legacy reports hard-fail with a French-language message.

107/107 tests green, lint 0, typecheck clean, vite build OK.


Phase A — DONE (kept for reference)

  • Scaffold (deps, configs, Docker, schemas, stubs)
  • Lib: id, dates, assert
  • Anatomy: parseSvgBones, loadSvg, svgToPng raster
  • Zustand store: full action set (initReport, hydrateReport, observation CRUD, conclusion/recommendations/nextAppointment setters, identity setters)
  • sessionStorage draft mirror + localStorage practitioner cache
  • UI primitives: Button, Card, Dialog, Input, Label, Select, Textarea, Badge, Chip
  • Canvas: AnatomyCanvas (data-state highlighting, async-mount safe), DetailModal
  • Observation chain: ObservationList, ObservationCard, PathologyPicker (flat — TO REPLACE), VertebraPicker, SeveritySelector, FreeTextPathologyInput
  • Report forms + edit-infos dialog + home nav
  • Routes: Home, NewReport, Editor (split layout + dialog), NotFound
  • PDF pipeline: fonts, header, observationPage (2-col SVG grid), conclusionPage, attachment.ts, export, import
  • Docker: Dockerfile, compose, entrypoint.sh runtime env, nginx SPA fallback
  • Brand identity via env (ConfigProvider)
  • Tests: 100/100 pass
  • Pathology JSON sample dropped at src/domain/species/equine/pathologies.json (schema v1.1, 3 zones: sphenoid/ssb/atm — placeholder before full-body)

Phase B — V1 REFACTOR (hierarchical findings + i18n)

B0. Domain model — Findings tree (DONE 2026-05-20)

  • Schema: src/domain/schema/findings.ts — FindingNodeSchema (recursive via z.lazy), ZoneFindingsSchema, SpeciesFindingsSchema, SourceRefSchema
  • Loader: src/domain/species/equine/pathologies.ts parses the JSON via SpeciesFindingsSchema.parse(data) at boot (fail-fast)
  • Species manifest: findings: FindingsLoader replaces pathologies in SpeciesManifest
  • JSON fix: species.id set to "equine" to match registry
  • Tests: tests/unit/species.equineFindings.test.ts (5 cases) replaces deleted species.equinePathologies.test.ts

B1. Report schema v2 — observation findings (DONE 2026-05-20)

  • ObservationSchema carries findings: Finding[] + freeTextFindings: string[]; old pathologyIds/freeTextPathologies removed
  • ReportSchema.version literal bumped 1 → 2
  • Store emptyObservation + initReport updated to the v2 shape
  • PDF import surfaces a distinct French-language IncompatibleReportVersionError message on v1 attachments (detected before Zod parse)
  • Schema + store + PDF tests updated; pathology.ts schema + test deleted

B2. UI — Findings tree picker (DONE 2026-05-20)

  • src/components/observation/FindingsTreePicker.tsx (breadcrumb, drill-down, leaf toggle, retour button, vet-referral ⚠ badge, description_fr surfacing)
  • scope_disclaimer modal shown once per session via osteo:disclaimer-shown sessionStorage flag
  • ObservationCard migrated — one picker per zone with a catalog entry, single FreeTextFindingInput below
  • PathologyPicker + FreeTextPathologyInput + their tests deleted; FreeTextFindingInput renamed equivalent kept
  • tests/unit/components.FindingsTreePicker.test.tsx covers navigation, leaf select, vet-referral flag, retour, deselect

B3. i18n FR/EN — site + PDF

  • Locale state: src/state/localeStore.ts Zustand: 'fr' | 'en', persisted in localStorage osteo:locale
  • i18n strings: src/i18n/{fr,en}.ts — UI strings dictionary
    • Migrate hardcoded French labels in components (buttons, headers, placeholders, toasts)
    • Helper hook useT() returning (key: string) => string
  • Language switcher: small FR/EN toggle in ReportHeader (next to Brand)
  • Findings rendering: components pick name_fr/name_en based on current locale
  • PDF render: exportReportToPdf(report, { locale }) parameter
    • All static PDF labels (eyebrow, section names) read from i18n dict
    • Findings rendered via labelFrSnapshot/labelEnSnapshot depending on locale at export
    • Date formatting locale-aware (formatDateFr → formatDate(date, locale))
  • Tests: locale switch updates labels; PDF roundtrip preserves locale snapshot

B4. PDF observationPage updates

  • Render findings instead of pathologyIds (list joined ·)
  • Show vet-referral icon next to flagged findings
  • scope_disclaimer footer on each obs page or first page only — decide
  • Update LRN-009-style layout still applies (text-area reservation)

B5. Stub cleanup (DONE 2026-05-20)

  • ZoneTooltip.tsx deleted (unused stub)
  • Toast.tsx deleted (unused stub — re-introduce later if notifications needed)
  • CLAUDE.md folder map updated — ObservationEditor/Toast/ZoneTooltip removed, FindingsTreePicker/FreeTextFindingInput/findings.ts added

Phase C — V1 SHIP gate

  • Author full horse.json (replacing 3-zone placeholder with all corps SVG zones)
  • PDF QA manual pass: full flow → export → re-import roundtrip
    • Fonts embed, JSON attached, multi-SVG grid OK, locale FR + EN exports
  • Docker build + compose up smoke test
  • env-var brand identity verified
  • README finalize (install, dev, Docker, env vars, locale, MIT)
  • CHANGELOG v1.0.0 entry
  • docs/PATHOLOGIES-FORMAT.md — schema doc + authoring guide for adding species
  • Scaleway VPS deploy (TLS + CI build/push/deploy)

Phase D — POST-V1 (not in MVP scope)

  • Capacitor wrap (iOS + Android)
  • Accounts + cloud sync (Supabase or self-host)
  • Multi-praticien (move localStorage cache to server profile)
  • RDV booking + push reminders
  • Other species (dog, cat, cow, goat, pig, chicken JSONs)
  • Pathology DB community contributions

Memory cross-refs

  • BDR-001..BDR-008 — decisions registry
  • LRN-001..LRN-010 — learnings registry
  • BLK-001..BLK-004 — 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
  • LRN-009 (pre-rasterize → reserve → grid) — keep applied in PDF observationPage
  • LRN-010 (gate DOM-mutate on async-mount) — relevant for any new SVG-mutating effect

Estimated effort

Phase Hours
B0. Findings schema + loader + tests 3
B1. ReportSchema v2 + store + PDF import 3
B2. FindingsTreePicker + disclaimer + integration 6
B3. i18n FR/EN site + PDF 5
B4. PDF observationPage update 2
B5. Stub cleanup 0.5
C. Full horse.json authoring (user) external
C. QA + docs + deploy 4
Total dev ~23h