diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md
index 28eb41eb..4f0c1489 100644
--- a/.claude/tasks/TODO.md
+++ b/.claude/tasks/TODO.md
@@ -349,7 +349,15 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo
- [x] gates: security PASS (1 MEDIUM, 6 LOW), verifier ECARTS(3) = export grants alias without fingerprint_verified (fix needs snapshot_rules.rs, outside scope) → checkpoint, STOP, owner decision
- [x] R5.6 M1 correction + full rehearsal (owner 2026-10-25; snapshot_rules.rs authorised): recognises_historical_stamp, null block refused, warnings allowed, depth 128; fresh worktree r56final: rust:check + check:all 01:53:59 green; security PASS (LOW); verifier CONFORME 8/8 → checkpoint, STOP (activation on signal)
- [x] R5.6 D-R5 switch ACTIVE (owner go 2026-10-25, commit 9e87016): seed sheet-ref 03e7f6ab + migration map 0e991bc2 only, --check 0 diff, rust:check + check:all green, security PASS LOW, verifier ECARTS(1)=S7 wording → Clarification; BDR-070; rollback not transparent for post-switch reports (settle before user release) → checkpoint, STOP, no merge, no R5.7
- - [ ] R5.7 consumer census, domain fixtures moved, packages deleted, xmldom + prettier out of the lockfile, docs, ledger; `pnpm check:all`; merge only on the owner's signal
+ - [ ] R5.7 consumer census, domain fixtures moved, packages deleted, xmldom + prettier out of the lockfile, docs, ledger; `pnpm check:all`; merge only on the owner's signal (owner go 2026-10-25 « Validation R5.6 et autorisation R5.7 »: rollback limit accepted on the branch, no intermediate release; plan `.claude/tasks/plans/2026-10-25-rust-r5-7-cleanup.md`, contract `.claude/tasks/contracts/2026-10-25-rust-r5-7-cleanup.md`; stop at the checkpoint, no merge)
+ - [x] R5.7a census + matrices (LEDGER 407: 256 ported, 149 replaced, 2 deleted, 0 gap; FILES 112), 15 anatomy + 1 domain uncovered contracts ported first (+19 Rust tests, curation_leaves.rs new)
+ - [x] R5.7b `report-v2.*.json` → `crates/core/tests/fixtures/` (sha256 kept), Rust readers repointed
+ - [x] R5.7c deletion (anatomy, domain, TS upload script, legacy scripts, Dockerfile lines, lockfile by `pnpm install`)
+ - [x] R5.7d census tests (r4 xmldom inverted + non-vacuity, R5 census, ESLint ban)
+ - [x] R5.7e historical reproducibility documented and rehearsed (59521dc: git status clean, 144+262; 756b7ef: 2 files, 144+263) in a detached worktree
+ - [x] R5.7f docs (CLAUDE.md, WORKSPACE, packages/README, README, RUST.md §11.23, CHANGELOG, sheet model, SUPABASE, TEST_STRATEGY, PDF-FORMAT)
+ - [ ] R5.7g checks (frozen install, rust:check, check:all green 03:58:13, --check 0 diff, TS 943→546, Rust 364→383) + fresh security + fresh verifier → checkpoint, STOP
+ - [ ] owner action (non-blocking): `packages/{anatomy,domain}/node_modules` leftovers (git-ignored pnpm symlinks; recursive delete refused to Claude) → `rm -r packages/anatomy/node_modules packages/domain/node_modules && rmdir packages/anatomy packages/domain`
- [ ] DEV hardening (owner 2026-10-24, risk accepted temporarily, not scheduled): Supabase on CLI demo keys + 54321 LAN-open (rootless, UFW allow incoming, no 54321 rule) → own JWT secret/signing keys via env() or narrower 54321 rule before any untrusted device or user (ENVIRONMENTS.md §3.6); never these keys in production; `confirm_sheet_asset_upload` object check before public exposure
- [ ] separate chore (D-R7): form constraints module + PGlite `pg_constraint`/config.toml parity test
- [ ] Release 0.2.0 (branch release/0.2.0 = Steps 3–6, version.txt + package versions 0.2.0, CHANGELOG [0.2.0] 2026-10-11): deploy-trigger check done 2026-10-12 (CI = branches main/develop only, no tag trigger, no deploy job, docker job builds `faunosteo:ci` locally; hooks push only; DEPLOY.md deploy = manual on the VPS). Default 0.2.0 build carries NO sheet (SHEET_BUNDLE=none) → the live local tool must not be redeployed from main without `--build-arg SHEET_BUNDLE=draft`. Finish via /release-candidate (finish + tag span, tag push on explicit go); CHANGELOG back-merge conflict expected (Unreleased Step 7 above [0.2.0]). Awaiting the user's go.
diff --git a/.claude/tasks/contracts/2026-10-25-rust-r5-7-cleanup.md b/.claude/tasks/contracts/2026-10-25-rust-r5-7-cleanup.md
new file mode 100644
index 00000000..07e3bcf2
--- /dev/null
+++ b/.claude/tasks/contracts/2026-10-25-rust-r5-7-cleanup.md
@@ -0,0 +1,50 @@
+# CONTRACT: R5.7 consumer census and deletion of `packages/anatomy` and `packages/domain`, owner brief 2026-10-25 « Validation R5.6 et autorisation R5.7 »
+
+- branch `feature/rust-r5-pipeline-core`, base 756b7ef (R5.6 active since 9e87016)
+- plan `.claude/tasks/plans/2026-10-25-rust-r5-7-cleanup.md`
+
+## Clauses
+
+C1. **Census.** Every consumer of `packages/anatomy` and `packages/domain` outside them is listed (runtime and type
+imports, fixtures read by Rust, TS tests, oracles and goldens, pnpm scripts, build dependencies, seed scripts, docs,
+dev and check tools, historical references). Nothing still required by an active feature is deleted.
+
+C2. **Matrices.** `crates/core/tests/curation/FILES.tsv` names every deleted tracked file with its Rust counterpart or the
+reason it goes; `crates/core/tests/curation/LEDGER.tsv` has one row per TS case of both packages at 756b7ef (407), with the
+case's contract, old location, equivalent after the deletion, status ported / replaced / kept / deleted (with the
+justification), and the historical reference kept. No row is a gap: a contract still relevant and uncovered is ported first.
+
+C3. **Fixtures.** `report-v2.full.json` and `report-v2.minimal.json` move under `crates/core/tests/fixtures/` with their bytes
+unchanged (sha256 before = after, recorded); the Rust readers use the new place. No oracle, golden, frozen digest, migration
+data, N-1 reader or reference PDF is changed, regenerated or removed; a moved reference file keeps its sha256.
+
+C4. **Active checks preserved.** The contracts the brief §5 lists stay covered by tests that run in `pnpm rust:check` or
+`pnpm check:all` (sheet model validation, reference integrity, deterministic UUIDs, legacy catalog conversion, changeset
+application, migration map, statistics, seed SQL, SVG rendering, RFC 8785, historical aliases, PDF import and export, old
+archive compatibility); the application and interface suites keep passing; test counts before and after are measured and
+documented.
+
+C5. **Historical reproducibility.** The documentation names the reference commits of the TypeScript pipeline, the versions
+(Node, pnpm, dependencies), the historical generation and comparison commands, the isolated-worktree procedure and the expected
+sha256 of the artifacts; the procedure is rehearsed once; the old engine is not reintroduced in the current tree.
+
+C6. **Dependencies and scripts.** The two packages' own dependencies leave the lockfile through `pnpm install`; `@xmldom/xmldom`
+and `tsx` are gone; root `prettier` stays (used by `pnpm format` and `db:types`); `pnpm import:equine` stays the Rust pipeline;
+`import:equine:legacy` and `assets:upload:legacy` are removed; no other dependency changes major version; the lockfile installs
+with `--frozen-lockfile`.
+
+C7. **Census tests.** `r4.census.test.ts` proves xmldom and the TS engines are no active dependency, and cannot pass on a
+lockfile or tree that reintroduces them (a non-vacuity check); a census proves no production path (app, glue, supabase package,
+Dockerfile, Vite/TS config) imports a deleted engine, and that the two matrices agree with the tree.
+
+C8. **Docs.** CLAUDE.md, WORKSPACE.md, packages/README.md, RUST.md §11, CHANGELOG, TODO, the curation commands and the test
+registers are updated; the seed SQL header is kept (frozen bytes) and explained beside it; audits are append-only; the brief §10
+follow-ups stay tracked (rollback limit, DEV hardening, migration-map cascade debt, direct export API trust boundary, SQL checks
+before public exposure, accepted LOW items).
+
+C9. **Checks.** `pnpm install --frozen-lockfile`, `pnpm rust:check`, `pnpm check:all`, `pnpm import:equine --check` (0
+difference), the RFC 8785, alias and archive suites, PDF and `report:compare`, the N-1 reader, the moved fixtures, the sheet and
+seed integrity suites, and the absence of any import of the deleted packages, all green on the final state.
+
+C10. **Limits.** Branch only; no merge, no release, no deploy, no Supabase DEV data change, no migration, no new feature; no
+seed byte changed.
diff --git a/.claude/tasks/plans/2026-10-25-rust-r5-7-cleanup.md b/.claude/tasks/plans/2026-10-25-rust-r5-7-cleanup.md
new file mode 100644
index 00000000..aba6c16c
--- /dev/null
+++ b/.claude/tasks/plans/2026-10-25-rust-r5-7-cleanup.md
@@ -0,0 +1,43 @@
+# PLAN: Rust R5.7, consumer census, `packages/anatomy` and `packages/domain` deleted, guarantees kept
+
+- date: 2026-10-25 | branch `feature/rust-r5-pipeline-core` at 756b7ef (R5.6 active, 9e87016)
+- spec: owner brief 2026-10-25 « Validation R5.6 et autorisation R5.7 » (§1 to §13); plan R5 §B.5 row R5.7 and §B.6
+ (`.claude/tasks/plans/2026-10-22-rust-r5-pipeline-core.md`); RUST.md §11; BDR-068, BDR-070
+- contract: `.claude/tasks/contracts/2026-10-25-rust-r5-7-cleanup.md`
+- limits: no merge, no 0.2.0, no deploy, no Supabase DEV data, no migration, no SaaS feature, no oracle regenerated,
+ no seed byte changed, no major version bump; stop at the checkpoint (brief §12)
+
+## Facts at the start (756b7ef)
+
+- TS cases to retire: anatomy 144 in 22 files, domain 263 in 13 files (vitest JSON, all green).
+- Consumers outside the two packages: anatomy → root script `import:equine:legacy`, Dockerfile COPY, docs, Rust
+ module comments; domain → anatomy, Dockerfile COPY, the Rust suites reading
+ `packages/domain/tests/fixtures/report-v2.{full,minimal}.json` (`report_rules`, `archive_rules`), the app ESLint ban,
+ `r4.census.test.ts` (xmldom pinned under anatomy), docs, SQL migration comments (frozen, never edited).
+- `packages/supabase/scripts/upload-sheet-assets.ts` (`assets:upload:legacy`): TS upload tool, replaced by the Rust bin
+ at R5.5 (owner e2e PASS 11/11).
+- Root `prettier` stays (`pnpm format`, `db:types`, `db:types:check`); `tsx` only under anatomy; `@xmldom/xmldom`
+ only under anatomy.
+- The `report-v2.*.json` fixtures of domain are byte-identical to the app's copies (sha256 e96b0882…, ba79698c…).
+- Seed SQL header names `packages/anatomy`: frozen bytes (sha c5a24312…), kept, documented beside.
+
+## Subtasks
+
+1. Census + matrices: tests ledger `crates/core/tests/curation/LEDGER.tsv` (407 rows: ported / replaced / kept /
+ deleted, target, oracle, note), files matrix `crates/core/tests/curation/FILES.tsv` (every deleted file → its Rust
+ counterpart or reason). GAPs found by the mapping are ported before any deletion.
+2. Fixtures: `report-v2.{full,minimal}.json` → `crates/core/tests/fixtures/`, `git mv`, sha256 before = after; Rust
+ readers repointed.
+3. Ports of uncovered contracts (from the mapping), on frozen oracles, in Rust or durable vitest.
+4. Deletion: `packages/anatomy`, `packages/domain`, TS upload script + `assets:upload:legacy`,
+ `import:equine:legacy`, Dockerfile COPY lines, lockfile by `pnpm install`; Rust module comments that cite deleted
+ paths point at the reference commit.
+5. Census tests: `r4.census` xmldom assertion turned into "no importer, no package resolves xmldom", with a non-vacuity
+ check; new R5 census (packages gone, no production path imports a TS engine, ledger and files matrix consistent with
+ the tree); app ESLint ban extended to `@faunosteo/anatomy` and xmldom.
+6. Historical reproducibility: reference commits, versions, commands, isolated-worktree procedure, expected sha256 of the
+ 18 files; rehearsed once in a detached worktree.
+7. Docs: CLAUDE.md, WORKSPACE.md, packages/README.md, README.md, RUST.md §11.23, CHANGELOG, ANATOMICAL_SHEET_MODEL.md,
+ SUPABASE.md, TEST_STRATEGY.md, PDF-FORMAT.md (xmldom line stale), ANNOTATION-RENDERING.md; follow-ups kept (brief §10).
+8. Checks: frozen-lockfile install, rust:check, check:all, `import:equine --check`, targeted suites, census, counts.
+9. Gates: fresh security audit, fresh verifier on the contract; memory; checkpoint, STOP.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5fef03a0..c023545f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,11 @@ Versions follow [Semantic Versioning](https://semver.org/).
## [Unreleased]
+### Removed (2026-10-25, Rust R5.7: the TypeScript pipeline and domain packages)
+
+- `packages/anatomy` (legacy importer, curation pipeline, TypeScript renderer, `import-equine` CLI) and `packages/domain` (Zod schemas and rules) are deleted, with the TypeScript upload script `packages/supabase/scripts/upload-sheet-assets.ts` and the scripts `pnpm import:equine:legacy` and `assets:upload:legacy`. The Rust core does all of it: `pnpm import:equine` and `pnpm assets:upload` are unchanged for the user. `@xmldom/xmldom` leaves the lockfile; `tsx` is no longer a dependency of any package (pnpm keeps it only as an optional peer of vite); root Prettier stays (`pnpm format`, `db:types`).
+- Every one of the 407 TypeScript test cases is dispositioned in `crates/core/tests/curation/LEDGER.tsv` (ported, replaced by a frozen oracle, or deleted with its reason, none uncovered) and every deleted file in `crates/core/tests/curation/FILES.tsv`; the contracts the TypeScript alone still checked are ported to Rust (the 612 legacy leaves and 26 legacy annotations, region inference, the R5.1 artifact ledger, the generated folders' file list, the migration-map oracle entry by entry, review overlay removals, the halo filter, reserved and dollar-tag refusals). The `report-v2.*.json` fixtures moved to `crates/core/tests/fixtures/` with their bytes unchanged. No oracle, golden, digest or seed byte changed. The historical TypeScript pipeline stays replayable from commit 59521dc (official writer) or 756b7ef (last revision holding it) in a detached worktree (`docs/development/RUST.md` §11.23).
+
### Changed (2026-10-25, Rust R5.6: the sheet fingerprint convention `sha256-rfc8785-validated-v1`)
- The equine sheet's fingerprint is now the SHA-256 of the RFC 8785 canonical form of the validated document: `12d78872…74e2` in `draft/sheet-ref.json` (with a `fingerprint` block naming the convention) and in `draft/report-migration-map.json`, the only two seed files changed; `document.json`, the drawing and the SQL seed are byte-identical. The previous value `27c7383c…2660` stays recognised for this sheet only, through the core's compiled registry and a fingerprint recomputed from the loaded document: old reports and PDFs open with no message and no rebase, and a re-export keeps their stamp so older readers keep the archive. A report written after the switch, opened by a build from before it, is rebased with nothing lost. `pnpm import:equine` runs the Rust pipeline; the TypeScript generator stays as `pnpm import:equine:legacy` until R5.7 (`docs/development/RUST.md` §11.22).
diff --git a/CLAUDE.md b/CLAUDE.md
index 7773db9c..d43608c9 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -15,8 +15,8 @@ writes conclusion, and exports an A4 PDF. PDF carries the full JSON state as a n
attachment so importing it restores the session for a follow-up.
SPA deployed via Docker + nginx on Scaleway VPS. Backend foundation on Supabase
(PostgreSQL + Auth + RLS) since Step 3 of the SaaS plan: profiles, platform roles and
-audit log exist; Step 4 added the canonical anatomical sheet model (`packages/domain`,
-tables `species`, `anatomical_sheets` / `_versions` / `_assets`). Step 5 moved the
+audit log exist; Step 4 added the canonical anatomical sheet model (since R2 in
+`crates/core/src/domain/sheet`; the TypeScript `packages/domain` left at R5.7), tables `species`, `anatomical_sheets` / `_versions` / `_assets`). Step 5 moved the
application onto that model: the editor renders the bundled reference sheet (the
curated equine DRAFT, `SHEET_BUNDLE=draft`), writes Report v3 and imports v2 PDFs
through a generated migration map. Step 6 made the PDF an autonomous archive: the
@@ -40,8 +40,11 @@ Rust R2 moved the application's domain rules into `crates/core` (sheet, report a
archive contracts, integrity rules, sheet index, migration, rebase, snapshot, layered
archive reading, editor reducers, findings and vertebra rules, report operations),
reached through the wasm facade and `packages/core-wasm`, loaded lazily by the sheet
-pages only (`docs/development/RUST.md` §8); `packages/domain` is frozen for the PDF
-engine, the pipeline and the compare CLI.
+pages only (`docs/development/RUST.md` §8). R5 moved the anatomical pipeline (legacy
+importer, curation, migration map, review files, seed SQL, upload tool) into the core
+(feature `curation`); R5.6 switched the sheet fingerprint to `sha256-rfc8785-validated-v1`;
+R5.7 deleted `packages/anatomy` and `packages/domain` (`RUST.md` §11.23, test ledger
+`crates/core/tests/curation/LEDGER.tsv`).
MVP species: equine only. Open-source MIT.
---
@@ -74,8 +77,8 @@ MVP species: equine only. Open-source MIT.
## Build commands
-pnpm workspace: `apps/app` = the private application, `packages/domain` = pure
-Zod domain model (anatomical sheet document), `packages/supabase` = Supabase
+pnpm workspace: `apps/app` = the private application, `packages/core-wasm` = the
+Rust core in the browser (runtime, generated types, frozen N-1 reader), `packages/supabase` = Supabase
access layer (see `docs/development/WORKSPACE.md`). Every command
below runs from the repository root and delegates to the packages.
@@ -118,9 +121,9 @@ pnpm db:types:check # CI diff
# Reference sheet in the app: the dev server bundles the curated draft; a build does not
pnpm build:preview # SHEET_BUNDLE=draft build (manual validation, preview deployments)
pnpm preview:draft # same, then serves it
-pnpm import:equine --check | --out
# since R5.6 the official seed writer: the Rust pipeline (same as `pnpm r5:import-equine`), fingerprint `sha256-rfc8785-validated-v1`; `pnpm import:equine:legacy` = the TypeScript generator (pre-switch convention) until R5.7
+pnpm import:equine --check | --out # since R5.6 the official seed writer: the Rust pipeline (same as `pnpm r5:import-equine`), fingerprint `sha256-rfc8785-validated-v1`; the TypeScript generator left at R5.7 (replayed from a historical revision only, RUST.md §11.23)
pnpm r5:import-equine --check | --out # the Rust pipeline (R5.2 importer, R5.3 draft, R5.4 review files): compare the 18 generated files with the committed folders (bytes; app drawings under the declared R3 rule), or write /{legacy-import,draft} into an empty folder; never deletes (scripts/import-equine.sh, first run compiles)
-pnpm assets:upload [--check] # R5.5: uploads the sheet drawings of a generated seed folder to the LOCAL stack's private bucket (Rust `upload-sheet-assets`, feature `upload`; SUPABASE_URL local with a port, SUPABASE_SERVICE_ROLE_KEY typed, never printed; no overwrite, confirm after verify; run by hand, scripts/upload-sheet-assets.sh); the TypeScript one is `assets:upload:legacy` until R5.7
+pnpm assets:upload [--check] # R5.5: uploads the sheet drawings of a generated seed folder to the LOCAL stack's private bucket (Rust `upload-sheet-assets`, feature `upload`; SUPABASE_URL local with a port, SUPABASE_SERVICE_ROLE_KEY typed, never printed; no overwrite, confirm after verify; run by hand, scripts/upload-sheet-assets.sh)
pnpm e2e:sheet-assets # scripts/sheet-assets-e2e.sh: that tool against the local stack (upload, rerun, anon and wrong key, refused destinations); run by hand
pnpm report:compare ... # archive check: attachment vs its v3 reading, unresolved items flagged (docs/PDF-FORMAT.md); the core's `report-compare` binary since R4.7 (scripts/report-compare.sh, first run compiles)
@@ -172,7 +175,7 @@ pnpm test # vitest watch — dev loop
Test files live in `apps/app/tests/unit/*.test.ts(x)`; golden fixtures in
`apps/app/tests/fixtures/`. The 612 legacy catalog leaves run through the v2 → v3 migration
-in both `packages/anatomy` (against the draft document) and the app (sheet index + PDF roundtrip). Setup: `apps/app/tests/setup.ts` imports
+in the core (`crates/core/tests/curation_leaves.rs`, against the draft document) and the app (sheet index + PDF roundtrip). Setup: `apps/app/tests/setup.ts` imports
@testing-library/jest-dom. Suites run on the bundled reference sheet (`tests/helpers/sheet.ts`); frozen v2 fixtures under `tests/fixtures/`.
SQL: `supabase/tests/*.sql` (pgTAP) run by `packages/supabase/tests/db/pgtap.test.ts`
on PGlite (part of `pnpm test:run`) and by `pnpm db:test` on the real stack.
@@ -259,13 +262,7 @@ faunosteo/
├─ eslint.config.js, index.html, package.json (@faunosteo/app)
├─ tsconfig*.json, vite.config.ts, vitest.config.ts
│ (end of apps/app)
-├─ packages/domain/ ← @faunosteo/domain (pure, no DOM, zod only): anatomical-sheet (document, integrity rules, sheet-index), report (v3, v2 migration, rebase), archive (sheet snapshot, envelope v1, branding, labels, layered reader)
-│ ├─ src/anatomical-sheet/{schema,validate,create}.ts ← canonical sheet document + integrity rules
-│ └─ tests/{fixtures/horse-slice.ts,*.test.ts}
-├─ packages/anatomy/ ← @faunosteo/anatomy: legacy importer, curation pipeline, frozen TS annotation-layer renderer + view composer (`./render`: the pipeline until R5; no app and no PDF consumer since R4.8)
-│ ├─ src/legacy/{svg,catalog,regions,ids,report,importer}.ts, src/cli/import-equine.ts
-│ ├─ src/curation/{schema,targets,fields,ops,rename,apply,types,assets,labels,stats,changelog,review-report,overlay,seed,sources,pipeline}.ts ← changeset → draft
-│ └─ tests/ ← counts preserved, special cases, determinism, curation ops, golden artifacts
+│ (packages/domain and packages/anatomy deleted at R5.7: their sources resolve at 756b7ef, crates/core/tests/curation/{FILES,LEDGER}.tsv)
├─ packages/supabase/ ← @faunosteo/supabase
│ ├─ src/{index,client,database.types,anatomical-sheets,assets}.ts ← typed client, generated types, publish gate, avatar flow (closed AssetFailure kinds)
│ ├─ tests/e2e/avatar-flow.e2e.ts + vitest.e2e.config.ts ← real-stack end-to-end (`pnpm e2e:avatar`), skipped without the stack env
@@ -409,8 +406,8 @@ Database (Supabase)
### Annotation rendering
- docs/ANNOTATION-RENDERING.md is the source of truth: the drawing carries no annotation element, the markers are
- drawn from the document (Rust core for the canvas since R3, `crates/core/src/anatomy`; the frozen TS renderer
- `@faunosteo/anatomy/render` for the pipeline until R5, same output), with the attributes listed there
+ drawn from the document (the Rust core, `crates/core/src/anatomy`, for the canvas since R3, the PDF since R4 and
+ the pipeline's review drawings since R5), with the attributes listed there
- Every SVG the product draws goes through the core's one reader (`anatomy::svg::read_svg`): caps before any parse,
allowlist, reference graph; a product drawing with anything removed is refused at load, never repaired
- Never rely on element id, className or a label for click targeting or behaviour — always `data-anno-id`
@@ -421,8 +418,8 @@ Database (Supabase)
### Schemas
- The data contracts live in Rust since R2 (`crates/core/src/domain/{sheet,report,archive}`, Zod semantics
reproduced: strict where Zod was strict, optional absent, nullable required, Zod schema field order);
- `packages/domain` is frozen (no new logic) for the pipeline until R5 (the app no longer depends on it: R4.8),
- and its Zod copy under `packages/core-wasm/tests/n-1` is the permanent N-1 reader. Never change a contract
+ `packages/domain` was deleted at R5.7; its byte-identical Zod copy under `packages/core-wasm/tests/n-1` is the
+ permanent N-1 reader. Never change a contract
without bumping the version on a breaking change (additive optional fields keep it); a change touches the
Rust struct, the regenerated ts-rs types and the N-1 test
- Every report entering the store comes from the core (new report, draft restore, import, reducer outputs);
@@ -494,16 +491,16 @@ Database (Supabase)
- Avatar UI follows the validated mockup: photo in Mon compte (Informations personnelles), sidebar, drawer and top bar
link to Mon compte; JPEG / PNG / WebP only, never SVG; no signed URL for the owner-only avatar (download under RLS).
-### Anatomical sheet model (packages/domain + migration 20261008110000)
+### Anatomical sheet model (crates/core/src/domain/sheet + migration 20261008110000)
- `docs/development/ANATOMICAL_SHEET_MODEL.md` is the source of truth: document shape, issue codes, tables, RPCs.
- Ids are stable slugs never derived from labels; labels are `{ fr, en }` objects. Annotation → findings is the
explicit `finding_zone_id`; vertebral regions are ordered data with free codes. No label matching at runtime.
- A published version is immutable (trigger, every role). Change = new draft (`create_sheet_draft`) then
- `publish_sheet_version`. Integrity rule codes are shared by `validateSheetDocument` (TS) and
+ `publish_sheet_version`. Integrity rule codes are shared by `validate_sheet_document` (Rust core) 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 `draft/` (`pnpm import:equine --out` into an empty folder, then reviewed and copied; never edit `legacy-import/` or `draft/` by hand;
- the golden test fails on drift). Every content change goes through `curation/changes.json` (traced in CHANGELOG.md).
+ `curation_draft` / `curation_review` fail on drift, `pnpm import:equine --check` lists it). Every content change goes through `curation/changes.json` (traced in CHANGELOG.md).
It is a DRAFT until a platform admin publishes it after business review of `REVIEW-REPORT.md`.
- Sheet SVG bytes live in Storage bucket `anatomical-sheet-assets` as `.svg`; uploads are an operator task
(`pnpm assets:upload ` with the service key in env), never from the browser.
@@ -529,7 +526,9 @@ Database (Supabase)
Study and roadmap: `docs/development/RUST_ARCHITECTURE_REVIEW.md` (validated with
the amendments of Annex C). Done: R0, R1 (worker), R2 (domain core used by the app,
`docs/development/RUST.md` §8), R3 (anatomy core: SVG reader, layer, composition; editor canvas on it,
-RUST.md §9; validated and merged 2026-10-17). Next: R4 (PDF core), R5 (pipeline); release 0.2.0 unaffected.
+RUST.md §9; validated and merged 2026-10-17), R4 (PDF core, RUST.md §10; merged 2026-10-21). R5 (pipeline,
+RUST.md §11: R5.1 to R5.7, the TypeScript packages deleted) on `feature/rust-r5-pipeline-core`, not merged;
+release 0.2.0 unaffected.
- Any logic that can run in Rust with no significant loss (features, UX,
graphics, data compatibility, security, reliability, useful performance,
diff --git a/README.md b/README.md
index 8c401205..d9106969 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ full report JSON embedded as a native PDF attachment. Re-importing that PDF
restores the state for a follow-up.
Multi-species by design. The MVP ships the **horse** sheet: a canonical anatomical
-sheet document (drawing + annotations + findings catalog, `packages/domain`)
+sheet document (drawing + annotations + findings catalog, `crates/core/src/domain/sheet`)
generated and curated under `supabase/seed/anatomical-sheets/equine/`. Another
species is another sheet document, no code change.
See `docs/development/ANATOMICAL_SHEET_MODEL.md` §6 for how a sheet is produced.
@@ -93,7 +93,7 @@ docker compose up --build
```bash
pnpm typecheck # TypeScript strict, no emit
pnpm lint # ESLint 9 flat config, 0 warnings
-pnpm test:run # vitest run (domain, anatomy, supabase/PGlite, app)
+pnpm test:run # vitest run (core-wasm, supabase/PGlite, app)
pnpm build # tsc + vite build → apps/app/dist/
pnpm report:compare ... # archive PDF vs its v3 reading, unresolved items flagged (the core's binary; first run compiles)
pnpm rust:check # native: fmt, clippy -D warnings, cargo test, ts-rs export, cargo deny
@@ -152,8 +152,8 @@ faunosteo/ pnpm workspace (see docs/development/WORKSPACE.md)
├─ src/lib/ id, dates, assert utilities
├─ src/styles/ Tailwind v4 CSS + design tokens
├─ tests/unit/ vitest tests on the bundled sheet (+ frozen v2 fixtures)
-├─ packages/domain/ @faunosteo/domain: canonical sheet document + report document (v3, v2 migration)
-├─ packages/anatomy/ @faunosteo/anatomy: legacy importer, curation pipeline, annotation-layer renderer + view composer
+├─ packages/core-wasm/ @faunosteo/core-wasm: the Rust core in the browser (runtime, generated types, frozen N-1 reader)
+├─ crates/ Rust: core (contracts, rules, SVG, PDF, anatomical pipeline), wasm facade, worker
├─ packages/supabase/ @faunosteo/supabase: typed client, generated types, PGlite SQL test harness
├─ supabase/ CLI config, SQL migrations, local seed (incl. the equine sheet), pgTAP tests
├─ docker/ entrypoint.sh + nginx.conf
@@ -169,7 +169,7 @@ v0.1.0 MVP — implementation complete.
- `pnpm typecheck` ✅
- `pnpm lint` ✅
-- `pnpm test:run` ✅ — 367 tests across the workspace (domain, anatomy, supabase, app)
+- `pnpm test:run` ✅ — the vitest suites of the workspace (core-wasm, supabase, app); `pnpm rust:check` runs the Rust ones
- `pnpm build` ✅
The first species ships as the equine anatomical sheet: the historical
diff --git a/docs/ANNOTATION-RENDERING.md b/docs/ANNOTATION-RENDERING.md
index ea791925..924b6446 100644
--- a/docs/ANNOTATION-RENDERING.md
+++ b/docs/ANNOTATION-RENDERING.md
@@ -11,9 +11,9 @@ application draws the markers itself from the canonical document
annotations of one view into a ``
appended last to the view's `