Files
faunosteo/.claude/memory/decisions.md
T
Bastien ChanotandClaude bffa6fba26 chore(memory): /close — BDR-012/013 + LRN-013..016 + journal 2026-05-20 (session 2)
Capture the second-session findings-tree iteration learnings before
they fade:

Decisions
- BDR-012 species auto-discovery via Vite import.meta.glob default-export
  contract (alternatives: hardcoded registry, runtime registerSpecies()).
- BDR-013 SVG↔JSON zone bridge via fuzzy FR/EN label match (alternatives:
  rename SVG ids, add new data-anno-finding-zone attribute).

Learnings
- LRN-013 import.meta.glob + default-export as a plugin-discovery pattern.
- LRN-014 normalize + Levenshtein recipe for human-string cross-walk.
- LRN-015 per-source try/catch beats wrapping a loop with one outer catch.
- LRN-016 pdf-lib subset-font output: latin1/utf-8 bytes-grep won't find
  user-visible text — extract the JSON attachment or test through a
  refactored helper instead.

Journal
- Logs the 11 commits between b7b0945 and 70f21cc with one-line summaries
  + cross-refs to the new registry entries.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-20 06:21:39 +02:00

5.1 KiB
Raw Blame History

Decisions Registry

Format: BDR-XXX | Date | Title | Rationale | Alternatives | Status


BDR-001 | 2026-05-18 | React SPA exception for tool app

Tool is practitioner-only, no public indexing needed → SPA valid per CLAUDE.md rule. Alt: Next.js SSR rejected — no server, static deploy only. Status: closed.


BDR-002 | 2026-05-18 | SVG inline via DOMParser, not img/object

Inline SVG = full CSS control, pointer-events, data-* access. img/object = sandboxed, no DOM access, no click delegation. Status: closed.


BDR-003 | 2026-05-18 | PDF attachment via native pdf-lib attach()

Native EmbeddedFiles (afRelationship:Data) = proper PDF spec, survives re-save in Acrobat. Alt: custom metadata → rejected (non-standard, stripped by some viewers). Status: closed.


BDR-004 | 2026-05-18 | Runtime identity via window.APP_CONFIG

Build-time VITE_APP_* → baked into bundle; runtime injection via entrypoint.sh → no rebuild needed for brand changes. Order: runtime > build-time > defaults. Status: closed.


BDR-005 | 2026-05-18 | Vertebra picker: region tabs + chip grid

≥40px touch targets, multi-select, per-region toggle. Alt: flat list → too long for 54 total vertebrae. Status: closed.


BDR-006 | 2026-05-18 | Drag-reorder: up/down buttons, not DnD

DnD on mobile unreliable; ↑/↓ buttons accessible + simple. Status: closed.


BDR-007 | 2026-05-18 | pnpm 11 used instead of pnpm 9

pnpm@9 not available on host; corepack resolved 11.1.3. Package.json engine constraint set to >=9 for Docker (Docker uses corepack latest). Status: closed — deviation accepted.


BDR-008 | 2026-05-19 | PDF page layout — branded heading pattern

Each PDF page leads with bold-uppercase accent eyebrow (size 9), Times 22 title, 2pt × 48pt accent rule under title. Section labels follow same eyebrow style (uppercase bold accent) above their values. Observation severity rendered as filled color-coded pill (sage / amber / red) next to the obs number. Alts: plain text titles only — rejected (overlapped header rule + read unstyled). Status: closed.


BDR-009 | 2026-05-20 | Findings JSON keeps snake_case in TS, observation snapshot uses camelCase

JSON catalog fields (name_fr/name_en/description_fr/requires_vet_referral/...) stay snake_case in TS types/Zod schema — no transform layer. Domain-expert authored, reads natural in JSON, zero remap cost. Observation Finding snapshot uses camelCase (labelFrSnapshot/labelEnSnapshot/requiresVetReferral) per app convention. Alt: Zod transform to camelCase everywhere — rejected (extra layer, hides JSON shape, no real upside for a static catalog). Status: closed.


BDR-010 | 2026-05-20 | Observation findings snapshot labels at selection time

Finding stores labelFrSnapshot + labelEnSnapshot copied from leaf at click time. Exported reports remain readable years later even if catalog renames/restructures leaves. Path[] still carried for future re-link/migration. Alt: lookup labels on render via path — rejected (breaks already-exported PDFs if catalog edits). Status: closed.


BDR-011 | 2026-05-20 | v1 PDF import — hard-fail with version-specific FR message

importReportFromPdf detects data.version !== 2 BEFORE strict Zod parse, throws IncompatibleReportVersionError, wrapped into ImportError with explicit "v{n}, incompatible avec v2, réexportez..." message. No retro-compat shim (no prod PDFs in the wild). Alt: silent generic ImportError — rejected (user can't tell why import failed). Alt: v1→v2 migration adapter — rejected (no install base to justify cost). Status: closed.


BDR-012 | 2026-05-20 | Species auto-discovery via Vite import.meta.glob

src/domain/species/registry.ts uses import.meta.glob('./*/index.ts', { eager: true }) and registers every module that default-exports a SpeciesManifest. Drop-folder onboarding: scaffold writes index.ts with export default <id>, no registry edit needed. Duplicate id → warn + first wins. Missing default export → silently skipped. Alt rejected: hardcoded SPECIES_REGISTRY map — forced edits in two places, broke "single source of truth" per species folder. Alt rejected: explicit registerSpecies() runtime helper — extra import boilerplate per species, no compile-time check that registration runs. Status: closed.


BDR-013 | 2026-05-20 | SVG↔JSON zone bridge via fuzzy FR/EN label match

SVG data-anno-id values stay opaque generator strings (point-mpb..., zone-...). JSON catalog keys are stable human zone names (sphenoid, atm). Bridge runs at observation render: matchZoneFindings normalizes both sides (lowercase + NFD-strip accents + alphanum-only) and scores EN-exact → FR-exact → substring → Levenshtein within max(2, floor(maxLen*0.25)) tolerance. EN first because no accent normalization edge cases. Alt rejected: rename SVG data-anno-id to JSON keys — couples opaque SVG generator output to human-meaningful catalog, brittle across SVG re-exports. Alt rejected: add new data-anno-finding-zone attribute on every hitbox — forces SVG edit per species, double-source for the same info already in name_fr/en. Status: closed.