Files
faunosteo/.claude/tasks/contracts/2026-10-23-rust-r5-review.md
bchanot 2c445063a4 feat(supabase): R5.5 upload-sheet-assets in Rust, R5.4 caps and FLOOR clarification
Core rules curation::upload (manifest, local destination, bytes through the SVG reader,
plan from observed state); binary upload-sheet-assets over ureq (handshake, no overwrite,
confirm after verify, bounded retries, key never printed); pnpm assets:upload repointed,
e2e:sheet-assets for the local stack. 4 MiB cap on changes.json and references.json.
FLOOR clarification for audit prose with its negative proof.
2026-10-23 21:15:22 +02:00

71 lines
5.6 KiB
Markdown

# 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.
## Clarifications
- 2026-10-23 (gate round 2, C7): `crates/core/tests/oracles/r5/markdown-sweep.json` is a second new oracle of this slice,
written by the TypeScript generator `packages/anatomy/tests/r5.markdown-sweep-oracles.test.ts` (`MAKE_R5_ORACLES=1`). It
freezes what Prettier does to authored Markdown, from which the port's `UnsupportedMarkdown` guard is derived (C2 read as
"byte for byte with the TypeScript, or a loud refusal declared in RUST.md §11.14"). It is added, never a frozen file
changed; C7 excepts it with `review-synthetic.json`.
- 2026-10-23 (owner « Validation R5.4 et autorisation conditionnelle R5.5 » §2, FLOOR): the `floor-guard.sh` hits on a
Markdown line under `.claude/audits/**` that only quote one of the guard's suppression keywords in prose (the audits
state that none was added) are requalified as descriptive mentions.
The clarification does not reach executable code, active contracts, production scripts, generated artefacts or a real
removal: those findings keep failing. Past audit reports are not edited. Proof: `scripts/floor-clarification-check.sh`
(requalifies by path and kind, then runs a throwaway repo where a real keyword in `src/*.ts`, `src/*.rs` and in an
active contract is still reported). Result on this branch vs develop: 20 findings, 19 requalified (audit prose), 1 kept:
a STUB marker in `.claude/memory/evals.md:205` (a quoted stub-marker phrase in a heading, append-only registry), outside the
owner's clarification, reported to the owner and not requalified.