chore(memory): R5.4 plan and contract

This commit is contained in:
bchanot committed 2026-10-23 11:12:50 +02:00
1 parent 0a78492d64
commit 43ce28a79b
2 files changed
+58 -1

No files matched your search

@@ -0,0 +1,52 @@
# CONTRACT: Rust R5.4, the review files of the draft (review drawings, CHANGELOG, REVIEW-REPORT) and the whole-draft `--check`
- date: 2026-10-23 | branch `feature/rust-r5-pipeline-core` | plan `.claude/tasks/plans/2026-10-22-rust-r5-pipeline-core.md` §B.5 row R5.4
- brief: owner 2026-10-23 « Validation R5.3 et autorisation conditionnelle R5.4 » §4 to §9 (conditions §1 met: R5.3 verifier CONFORME 13/13 on c6e0d85)
- predecessor: `.claude/tasks/contracts/2026-10-22-rust-r5-draft.md` (R5.3)
## Scope
Port `packages/anatomy/src/curation/{labels,changelog,review-report,overlay,app-review}.ts` and `stats.ts` `statRows` into
`crates/core/src/curation/draft/**` (feature `curation`), complete `render_draft_artifacts`, and make `import-equine --check`
compare the whole generated draft. Out of scope: the fingerprint convention (R5.6), the upload tool (R5.5), any change to
the seed, to `horse.svg`, to an oracle or golden, to a gated reader, to `packages/anatomy` or `packages/domain` sources.
## Clauses
C1. **No I/O in the core.** The new modules take values and texts; only `bin/import_equine.rs` touches the file system.
C2. **Markdown byte parity.** `CHANGELOG.md` and `REVIEW-REPORT.md` produced by the core equal the committed files byte for
byte; the raw texts (before the table alignment) equal the ledger's pre-Prettier digests of `oracles/r5/pipeline.json`.
Changes, categories, references, statistics, line order, Unicode, escapes (`\|`, newlines in cells) and the 120-unit
`compactValue` cut (UTF-16 units, `…`) as the TypeScript.
C3. **SVG drawings.** `review/annotations-{main,head}.svg` and `review/app-{main,head}.svg` are built on the core's tree from
the frozen `draft/assets/horse.svg` read by the core's one SVG reader (nothing removed), never re-cleaned; the prolog of
the source is kept verbatim. Each file is compared with the committed xmldom file byte for byte; where bytes differ, the
parsed trees are compared (element names, namespaces, attributes and values, text, element order) and every difference is
declared. The R3 owner decision (2026-10-15, a trigger without its own name carries the opened view's name per language)
is the one expected difference, on `app-main.svg`; any graphic difference is listed for the owner's validation.
C4. **Whole-draft `--check`.** `import-equine --check` compares every file of `draft/` (12) and `legacy-import/` (6) with
explicit criteria: byte identity; for a file with a declared tree rule, tree equality after that rule; it exits non-zero
when a file is missing, not produced, or differs without an authorised rule. The `PENDING_R5_4` list and its `shortcut:`
comment are gone. `--out` writes the 18 files (6 + 12) with the R5.3 protections.
C5. **Differential.** A TypeScript generator (`packages/anatomy/tests/r5.review-synthetic-oracles.test.ts`,
`MAKE_R5_ORACLES=1` → `crates/core/tests/oracles/r5/review-synthetic.json`) freezes, on mini-sheet cases, the raw and
formatted CHANGELOG, the raw and formatted REVIEW-REPORT, the review overlays and the app drawings; the Rust suite
reproduces each one (Markdown byte for byte; SVG as C3) or refuses as the declared refusal (emoji width).
C6. **Determinism.** Two runs give the same bytes for every file.
C7. **Frozen references untouched.** No change under `supabase/seed/**`, `apps/app/tests/fixtures/**`,
`packages/core-wasm/tests/n-1/**`, `crates/core/src/domain/**`, `crates/core/src/pdf/**`, `crates/core/tests/oracles/**`
(except the new `review-synthetic.json`); `documentSha256` stays `27c7383c…2660`; `horse.svg` bytes unchanged.
C8. **R5.3 protections kept and LOW carry-over.** Strict changesets, path and symlink protections, no overwrite or delete,
depth and resource bounds, R2 integrity gate unchanged; carried from the R5.3 final gate: the destination folder itself
identity-checked, cite membership hashed, a failed seed walk named as such, the stale test comment, the R5.3 doc nits.
C9. **Gates.** `pnpm rust:check` and `pnpm check:all` green; security auditor PASS on the diff; this contract CONFORME by a
fresh verifier; RUST.md §11.14 (R5.4) and §11.15 (checkpoint), CHANGELOG, CLAUDE.md. No merge, no R5.5, no fingerprint
switch, no release, no deploy.