chore(memory): /close — BDR-016 + LRN-020 + BLK-002 resolve + journal 2026-05-21

- BDR-016: pathologies.json v2.0 — boolean source of truth, generic
  vet description_fr purged, full 26-zone horse coverage.
- LRN-020: forward-compat Zod schema absorbs catalog version bump
  zero-code (optional fields + boolean-driven logic since B0).
- BLK-002 resolved — catalog no longer empty (612 leaves > 40-60 target).
- journal entry 2026-05-21 logs the in-place v2.0 swap, the hyoïde
  case alignment fix, and the doc refresh.
- TODO refreshed: Phase C item 1 (full horse.json) done,
  PATHOLOGIES-FORMAT.md v2.0 refresh done, B4 PDF observationPage
  marked partially done (scope_disclaimer footer still TBD).
This commit is contained in:
Bastien Chanot committed 2026-05-21 03:23:38 +02:00
1 parent 57b58b3af1
commit f5307ce61c
5 files changed
+41 -12

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ Status: resolved.
40-60 equine entries needed; source-cited from Merck Vet Manual, IMAIOS, PubMed, EVJ, WikiVet, LCAO.
Client osteo will review post-scaffold.
Status: open — Phase 2d.
Status: resolved 2026-05-21 — superseded by hierarchical v2.0 catalog, 26 zones / 792 nodes / 612 leaves / 41 vet-referral leaves authored by domain expert. Counts blow past original 40-60 target. Source citations not yet attached on every leaf (sources optional in schema) — content review still a client task but DB no longer empty.
---
+10
View File
@@ -125,3 +125,13 @@ ImportError carries `kind: 'invalid_pdf' | 'incompatible_version' | 'no_attachme
Alt rejected: keep FR messages, translate via err.message string match — brittle (any rewording breaks the lookup), spreads i18n knowledge into the catch site.
Alt rejected: pass `t()` into domain layer — wrong direction; domain should not know about React hooks or current locale.
Status: closed.
---
## BDR-016 | 2026-05-21 | pathologies.json v2.0 — boolean source of truth, generic vet description_fr purged
Catalog bumped v1.2→v2.0. `requires_vet_referral: true` boolean = sole source of truth for vet flag. Generic "orienter vers vétérinaire" descriptions purged on 25 leaves where boolean alone sufficed. `description_fr` kept on 16 leaves carrying differential cue (cause neuro/sinusale/ligamentaire/rotulienne/etc.). Horse coverage extended placeholder 3 zones → full 26 zones (9 head + 17 body), 792 nodes, 612 leaves, 41 vet-referral leaves. Schema_version "2.0".
**Why:** v1.2 had textual fallback (`description_fr.includes('vétérinaire')`) + boolean coexisting → redundant + ambiguous. v2.0 collapses to one signal.
**How to apply:** Any new species JSON authored at v2.0 — boolean on vet leaves only, description_fr only when it adds clinical differential beyond "see vet". Consumers MUST use boolean check, never textual scan.
Alt rejected: keep dual signal — wastes maintainer attention, drift risk between text and boolean.
Status: closed.
+11
View File
@@ -66,6 +66,17 @@ B3 (i18n FR/EN site + PDF) shipped on `feat/findings-tree-v2` via /ship-feature.
---
## 2026-05-21
User dropped catalog v1.2→v2.0 in place. pathologies.json now schema_version "2.0", 26 zones (was 3), 792 nodes, 612 leaves, 41 vet-referral leaves. Generic vet description_fr purged on 25 leaves; 16 kept with clinical differential.
- Zero code change needed: `findings.ts` Zod schema already optional description_fr + boolean requires_vet_referral since B0. FindingsTreePicker + PDF already read boolean (no textual fallback). 154/154 tests stay green, typecheck clean.
- One case mismatch noted then fixed by user: SVG Horse_head.svg `data-anno-name-fr="hyoïde"`→`"Hyoïde"`. JSON ↔ SVG strict equality now holds for all 26 zones (diff empty). Fuzzy matcher (lib/zoneMatch.ts) no longer needed for this pair but kept as safety net.
- BDR-016 (v2.0 catalog adoption), LRN-020 (forward-compat schema absorbed change), BLK-002 resolved capitalized.
- TODO Phase C item 1 "Author full horse.json" → done. B4 still has scope_disclaimer footer decision open.
- NEXT: B4 disclaimer footer call + C QA + Scaleway deploy.
---
## 2026-05-20 (session 2)
Iterated on the findings-tree branch — 11 more commits on top of B0+B1+B2.
+7
View File
@@ -153,3 +153,10 @@ Defining a helper like `const nameOf = (z) => locale === 'en' ? z.name_en : z.na
1. Inline the locale-conditional inside the memo body (no closure).
2. Wrap the helper in `useCallback([locale])` so it's referentially stable.
Inline is simpler when the helper is one expression. Apply: any closure that bridges a memoized computation to an outer hook value (store selector, prop, context). Same trap with `useEffect` deps.
---
## LRN-020 | 2026-05-21 | Forward-compat Zod schema absorbs catalog version bump zero-code
Catalog JSON went v1.2→v2.0 (semantic breaking change per author doc), but `findings.ts` Zod schema declared `requires_vet_referral` boolean + `description_fr` optional from B0 day-one. Result: v2.0 file dropped in, parses clean, 154/154 tests stay green, no schema edit, no consumer rewrite. Picker + PDF already keyed on boolean (no textual `description_fr.includes('vétérinaire')` fallback ever existed in our code), so the v2.0 "removed redundant text" change is a no-op at consumption site. Lesson: when authoring a Zod schema for external content, mark anything that "might or might not" appear as `.optional()` + make booleans authoritative early. The schema then forms a stable contract that absorbs author-side simplifications without code churn.
Apply: any data contract sourced from non-engineering authors (clinical, legal, marketing). Decouple presence-of-field from semantic-of-field; let the boolean drive logic, let text be display-only ornamentation.
+12 -11
View File
@@ -1,13 +1,13 @@
# TODO — Osteo Report MVP
## Status (2026-05-20): findings tree refactor landed (B0+B1+B2) — i18n + full horse catalog next
## Status (2026-05-21): catalog v2.0 + full 26-zone horse coverage in place — B4 polish + ship gate 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.
Domain pivot bundle (B0 schema, B1 report v2, B2 UI/PDF, B3 i18n) shipped on
`feat/findings-tree-v2`. Catalog upgraded v1.2→v2.0 by domain expert: 26 zones
(was 3), 792 nodes, 612 leaves, 41 vet-referral leaves. Zero code change needed
— schema was forward-compat since B0 (BDR-016, LRN-020).
107/107 tests green, lint 0, typecheck clean, vite build OK.
154/154 tests green, lint 0, typecheck clean, vite build OK.
---
@@ -74,10 +74,10 @@ with a French-language message.
### B4. PDF observationPage updates
- [ ] Render `findings` instead of `pathologyIds` (list joined `·`)
- [ ] Show vet-referral icon next to flagged findings
- [x] Render `findings` instead of `pathologyIds` (per-zone sections "CONSTATS — <ZONE>" + "CONSTATS LIBRES", joined `·` segmented)
- [x] Show vet-referral icon (⚠) next to flagged findings (observationPage.ts:407)
- [ ] `scope_disclaimer` footer on each obs page or first page only — decide
- [ ] Update `LRN-009`-style layout still applies (text-area reservation)
- [x] Update `LRN-009`-style layout still applies (text-area reservation kept)
### B5. Stub cleanup (DONE 2026-05-20)
@@ -89,14 +89,15 @@ with a French-language message.
## Phase C — V1 SHIP gate
- [ ] Author full `horse.json` (replacing 3-zone placeholder with all corps SVG zones)
- [x] Author full `horse.json` (placeholder → v2.0, 26 zones, 792 nodes, 612 leaves — done 2026-05-21)
- [x] Fix SVG case `data-anno-name-fr="hyoïde"` → `"Hyoïde"` in `public/species/equine/Horse_head.svg` (done by user 2026-05-21; 26 JSON names ≡ 26 SVG names strict)
- [ ] 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
- [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)
- [ ] Scaleway VPS deploy (TLS + CI build/push/deploy)
---