chore: initial scaffold + design spec + implementation plan

Skeleton for Osteo Report MVP. Build passes, 7 smoke tests green, real
Horse.svg + Horse_head.svg in public/species/equine/. Zod schemas are
the contract; store/anatomy/pdf modules are typed stubs throwing
"not implemented" awaiting implementation.

Spec: docs/superpowers/specs/2026-05-18-osteo-report-mvp-design.md
Plan: docs/superpowers/plans/2026-05-18-osteo-report-mvp.md (23 phases, ~70 TDD tasks)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bastien ChanotandClaude Opus 4.7 committed 2026-05-18 20:55:10 +02:00
1 parent 12a3e48fdf
commit 8ca36b5ccd
104 files changed
+12448

No files matched your search

+105
View File
@@ -0,0 +1,105 @@
# TODO — Osteo Report MVP
## Status: Scaffold complete — ready for feature implementation
---
## Phase 1 — Skeleton (DONE)
- [x] Directory structure created
- [x] package.json + tsconfig + vite + vitest config
- [x] ESLint 9 flat config + Prettier
- [x] Zod schemas: report, observation, practitioner, animal, pathology
- [x] Species registry + equine manifest
- [x] Zustand store shape (stubs)
- [x] Anatomy types + empty parsers
- [x] PDF module stubs (export, import, attachment, fonts, render/*)
- [x] Component stubs (ui/*, canvas/*, observation/*, report/*, brand/*)
- [x] App router + ConfigProvider
- [x] Docker: Dockerfile + docker-compose + entrypoint.sh + nginx.conf
- [x] Env injection mechanism (window.__APP_CONFIG__)
- [x] Smoke tests pass
- [x] pnpm build passes
---
## Phase 2 — Core domain (next)
### 2a. Lib utilities
- [ ] `src/lib/id.ts` — generateId: already implemented (crypto.randomUUID)
- [ ] `src/lib/dates.ts` — formatDateFr: implement Intl.DateTimeFormat
- [ ] `src/lib/assert.ts` — already implemented
### 2b. Anatomy convention parser
- [ ] `src/anatomy/svgConvention.ts` — parseSvgBones: walk DOM, group by data-bone-id
- [ ] `src/anatomy/svgLoader.ts` — loadSvg: fetch + DOMParser inline
- [ ] Tests: valid SVG fixture → bones map; bad SVG → SvgConventionError
### 2c. Zustand store
- [ ] `src/state/reportStore.ts` — implement all actions
- [ ] `src/state/practitionerCache.ts` — localStorage read/write with Zod validation
- [ ] Tests: initReport, addObservation, updateObservation, hydrateReport
### 2d. Equine pathology DB
- [ ] `src/domain/species/equine/pathologies.ts` — 40-60 entries, source-cited
- [ ] Tests: all entries pass PathologySchema.parse() + have ≥1 source
---
## Phase 3 — UI components
### 3a. UI primitives
- [ ] Button, Card, Dialog, Input, Label, Select, Textarea, Badge, Chip, Toast
### 3b. Canvas
- [ ] AnatomyCanvas: inline SVG, delegated click listener, bone state colorization
- [ ] DetailModal: load detail SVG, click handler with detailSourceId
- [ ] ZoneTooltip: hover tooltip listing all observations owning the bone
### 3c. Observation panel
- [ ] ObservationList + ObservationCard
- [ ] ObservationEditor
- [ ] PathologyPicker + FreeTextPathologyInput
- [ ] VertebraPicker: region tabs + chip grid
- [ ] SeveritySelector
### 3d. Report forms
- [ ] PractitionerForm + AnimalForm (prefill from localStorage cache)
- [ ] ConclusionPanel + NextAppointmentPicker
- [ ] ReportHeader
---
## Phase 4 — Routes
- [ ] HomeRoute: CTAs + session draft card
- [ ] NewReportRoute: form → initReport → navigate /editor
- [ ] EditorRoute: split layout canvas + observation panel + export bar
- [ ] sessionStorage draft sync (osteo:draft)
---
## Phase 5 — PDF
- [ ] fonts.ts: fetch Inter + Fraunces TTF, embedFonts
- [ ] render/header + footer
- [ ] render/svgToPng: canvg → canvas → PNG bytes
- [ ] render/observationPage + conclusionPage
- [ ] attachment.ts: attachReportJson + extractReportJson
- [ ] export.ts + import.ts: full roundtrip
- [ ] Tests: attachment write+extract fixture
---
## Phase 6 — Docker deploy
- [ ] Verify pnpm-lock.yaml committed for --frozen-lockfile
- [ ] docker build smoke test on CI
- [ ] nginx.conf: PORT envsubst verified
---
## Phase 7 — QA
- [ ] Manual browser test: full report → export PDF → re-import
- [ ] Font embedding verified in PDF viewer
- [ ] Brand identity via env vars verified end-to-end