# CONTRACT: R5.6 switch rehearsal (isolated), owner brief 2026-10-24 « Validation de la préparation R5.6 et corrections préalables à la bascule » - branch `feature/rust-r5-pipeline-core` at 943a25a (official state, inactive); patch `.claude/tasks/plans/r5-6-switch.patch` - rehearsal: detached worktree `/tmp/claude-1000/-home-bchanot-Documents-faunosteo/3571c861-cd6e-4751-a25e-c26da95beb85/scratchpad/r56wt` = 943a25a + the patch, seed switched there only ## Clauses S1. **M1 option 1.** On export, an old report whose stamp is the registered historical value of the same sheet, against the sheet's verified canonical value, archives a snapshot carrying the report's own stamp; only for the registered pair of the same sheet id, with the loaded sheet's `v1` value recomputed from its document at load; never from an archive's alias list; a new report keeps the canonical value. Tests cover the owner's 9 scenarios (old PDF import, no rebase, re-export coherent, current reader, frozen N-1 reader, labels/views/annotations/branding preserved, rollback reader, forged/unknown refused, real change rebases), not only hash equality. S2. **Scope.** Rust changes only in `report/rebase.rs`, `archive/read.rs` (unchanged allowed), `session.rs`, `pdf/write/input.rs`, `pdf/compare/lines.rs`, `sheet/loaded.rs`, `facade.rs`, `bin/report_compare.rs`, plus the `sheet/fingerprint.rs` module, the generator (`curation/draft/pipeline.rs`), Cargo/tests/scripts; archive and envelope checks not loosened; public errors kept where possible; N-1 readers untouched. S3. **v0/v1 loading.** A reference without a block is historical (v0): loads as before, unverified, no alias privilege, never `v1`. A present block is strict (known keys, `v1` convention, 64 lowercase hex, not an alias value, aliases only from the registry for this sheet and value, value recomputed from the document); any contradiction refused. S4. **Artifacts and oracles.** In the switched seed only `sheet-ref.json` and `report-migration-map.json` differ; their value and block are consistent with `v1`; `document.json`, `horse.svg`, `equine_draft.sql` byte-identical; no R2-R5 oracle or golden changed; O7, O10, the R2 Zod oracle, the R5.1 ledger and the app goldens run in their original (pre-switch) context, with a separate test of the post-switch behaviour; every declared difference targeted, tested, unable to hide an anatomical change. S5. **report:compare.** The alias line keeps the draft/published status and prints both raw values; other differences still reported. S6. **Generators.** `pnpm import:equine` → the Rust pipeline; `import:equine:legacy` → the TypeScript one; historical tests use the generator they refer to. S7. **Isolation.** The official branch state stays inactive (seed `27c7…`, no new convention active), no DB/Supabase mutation, no oracle regenerated, nothing deleted. S8. **Gates on the switched state.** `pnpm rust:check`, `pnpm check:all`, RFC 8785, Node differential, alias security, the five consumers + load checks, authentic archive parity, N-1 on re-exported archives, snapshot-bearing reports, real-change rebase, the two generated artifacts; security audit; fresh verifier. ## Clarifications - 2026-10-25 (owner « autorisation de correction M1, nouvelle répétition obligatoire »): scope extended by `domain/archive/snapshot_rules.rs`; the M1 decision moves into `build_sheet_snapshot` and `assert_exportable` (`pdf/write/input.rs`) returns to strict equality (unchanged from 943a25a). Rules added: an alias is granted only by `LoadedSheet::recognises_historical_stamp` (loader-verified `v1` value, private state, recomputed from the current document at the decision, registry pair, same sheet id); `"fingerprint": null` and malformed blocks refused; warnings never block a `v1` fingerprint (`is_publishable`), errors do; `canonical_json` bounded at 128 levels with a controlled error; the direct export API is tested, not only the application paths. Final state: worktree `/tmp/claude-1000/-home-bchanot-Documents-faunosteo/3571c861-cd6e-4751-a25e-c26da95beb85/scratchpad/r56final` (detached at 8e77e37 + the patch, seed switched by the patch). - 2026-10-25 (owner « Autorisation officielle de la bascule R5.6 »): S7 (isolation) is superseded for the activation: the owner authorised the official switch on `feature/rust-r5-pipeline-core` (commit 9e87016) with `equivalence` crate-private, stale comments fixed, the trust boundary documented, and the regeneration of exactly `draft/sheet-ref.json` and `draft/report-migration-map.json` (procedure: fresh temporary `--out`, comparison, the two files only, `--check`). The other S7 parts still hold: no database or Supabase mutation, no oracle regenerated, nothing deleted, no merge.