feat(domain): equine legacy importer (packages/anatomy) + generated official equine sheet seed as draft

This commit is contained in:
bchanot committed 2026-10-09 00:38:48 +02:00
1 parent f4682cdba5
commit 52bfc11553
43 files changed
+18466 -33

No files matched your search

+9 -1
View File
@@ -198,12 +198,16 @@ faunosteo/
├─ packages/domain/ ← @faunosteo/domain (pure, no DOM, zod only)
│ ├─ src/anatomical-sheet/{schema,validate,create}.ts ← canonical sheet document + integrity rules
│ └─ tests/{fixtures/horse-slice.ts,*.test.ts}
├─ packages/anatomy/ ← @faunosteo/anatomy: one-off legacy importer (SVG + catalog → canonical document)
│ ├─ src/legacy/{svg,catalog,regions,ids,report,importer}.ts, src/cli/import-equine.ts
│ └─ tests/ ← counts preserved, special cases, determinism, golden artifacts
├─ packages/supabase/ ← @faunosteo/supabase
│ ├─ src/{index,client,database.types,anatomical-sheets}.ts ← typed client, generated types, publish gate
│ └─ tests/{client,anatomical-sheets}.test.ts, tests/db/ ← PGlite harness, shim, pgTAP runner, schema↔types test
├─ supabase/
│ ├─ config.toml, seed.sql ← CLI config (public schema only), local dev accounts
│ ├─ migrations/*.sql ← forward-only; foundation, profiles, platform_roles, anatomical_sheets
│ ├─ migrations/*.sql ← forward-only; foundation, profiles, platform_roles, anatomical_sheets, storage
│ ├─ seed/anatomical-sheets/equine/v1/ ← GENERATED by `pnpm import:equine`: document, id map, report, SVG copies, seed SQL
│ └─ tests/*.sql ← pgTAP: allowed + denied paths per policy
├─ packages/README.md ← shared packages index
├─ .gitea/workflows/ci.yml ← CI: install, typecheck, test, lint, build, docker
@@ -336,6 +340,10 @@ Database (Supabase)
`publish_sheet_version`. Integrity rule codes are shared by `validateSheetDocument` (TS) and
`private.sheet_document_issues` (SQL); add a rule on both sides and in the spec table.
- Document schema change → bump `SHEET_DOCUMENT_SCHEMA_VERSION`, extend the SQL CHECK on `document_schema_version`.
- Official equine sheet = generated seed (`pnpm import:equine`, never edit the output by hand; the golden test fails on drift).
It is a DRAFT until a platform admin publishes it after business review of `IMPORT-REPORT.md`.
- Sheet SVG bytes live in Storage bucket `anatomical-sheet-assets` as `<sha256>.svg`; uploads are an operator task
(`pnpm assets:upload <seed dir>` with the service key in env), never from the browser.
### Component stubs
- Scaffold stubs render <div>ComponentName placeholder</div>