Files
faunosteo/.claude/tasks/contracts/2026-10-25-rust-r5-7-cleanup.md

72 lines
5.9 KiB
Markdown

# 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`
is gone; no workspace manifest declares `tsx`, no script runs it, and the lockfile may keep it only as a transitive optional peer
the package manager resolves itself (Clarification C6 below); 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.
## Clarification C6 (owner, 2026-10-25, brief « Validation R5.7 et dernière vérification pré-fusion » §1)
The first wording read « `@xmldom/xmldom` and `tsx` are gone ». The owner accepts explicitly that `tsx` stays named in
`pnpm-lock.yaml` when it is only an optional peer dependency of Vite. The objective C6 checks is: no old TypeScript pipeline
active; no functional import from `packages/anatomy` or `packages/domain`; no script kept that requires them; no direct `tsx`
dependency left without use; legitimate transitive or optional references of the package manager may stay. The lockfile is
not edited by hand and no override or exclusion is added to drop the name.
Measured path (`pnpm why tsx -r`, 2026-10-25): `tsx` 4.23.15 is reached only as the `peer` of `vite` 7.3.6 (vite declares
`tsx: ^4.8.1` under `peerDependencies` with `peerDependenciesMeta.tsx.optional: true`), through `vite`, `vitest`,
`@vitest/mocker`, `vite-node`, `@tailwindcss/vite` and `@vitejs/plugin-react-swc` in the devDependencies of `apps/app`,
`packages/core-wasm` and `packages/supabase`; its snapshot block carries `optional: true`; no importer lists it; no
root `node_modules/.bin/tsx` is linked (pnpm links the peer's bin under the
`node_modules/.bin` of `apps/app`, `packages/core-wasm` and `packages/supabase`; no script calls it; verifier precision 2026-10-25).
The exception does not hide a consumer: `r5.census.test.ts` still fails if a manifest declares `tsx` (any dependency field),
if a manifest script names `tsx`, `@faunosteo/{anatomy,domain}` or `packages/{anatomy,domain}` or ends in `:legacy`, if an importer block lists `tsx`, if the
`tsx` snapshot loses `optional: true`, or if any app, Vite, glue or Supabase-package source imports a deleted package; the
verifier checks these probes, not the lockfile name.