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:
1 parent
57b58b3af1
commit
f5307ce61c
5 files changed
+41
-12
No files matched your search
@@ -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.
|
||||
Reference in new issue
Block a user