diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index e3bc9951..37ecb52d 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -356,3 +356,9 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp - Fingerprint module inert + 9 tests; Rust draft value = frozen 12d7…74e2 first try. Switch as rehearsed patch (green), tree restored, --check 0 diff. - Rehearsal found: fingerprint before drawings bound (order), loaded.rs/facade.rs outside approved files. STOP before switch. - Correction: "patch rehearsed green" was false (green run predated generator/load parts; patch broke report-compare build). Verifier caught it; patch fixed, docs corrected. Lesson → EVAL-031. + +## 2026-10-25 (R5.6 rehearsal) +- Owner: M1 option 1, 8-file scope, v0 kept without alias privilege. Rehearsed in detached worktree, seed switched there only (copy approved by owner at prompt). +- M1 in input.rs; equivalence one-way + fingerprint_verified (v1 recomputed at load, sha2 in wasm). Goldens reproduced byte-exact on switched sheet. +- Original contexts via pre-switch fixtures (O7, O10, R2, ledger, TS + app goldens); check:all 00:56:22 green switched. +- Slip: `pnpm format` rewrote append-only audits in worktree → reverted. Never format over .claude/. diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index 1111e437..4b0eafcc 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -343,6 +343,10 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo - [x] `domain/sheet/fingerprint.rs` + `sheet_fingerprint` tests (RFC, V8, Node differential, draft 12d7…, registry, census 123/124 alias) - [x] switch patch `.claude/tasks/plans/r5-6-switch.patch` (5-consumer wiring rehearsed green rust:check + check:all 14:32:05; whole patch: 4 curation tests fail on current seed, +3 on switched seed, RUST.md §11.19), files restored - [x] gates on 3b9a395: check:all 14:41:00, security PASS (M1 snapshot stamp → owner, M2 block strictness partly fixed), verifier ECARTS(2) (report-compare build in patch fixed, false "rehearsed green" corrected) → checkpoint, STOP (switch on signal) + - [ ] R5.6 rehearsal (owner 2026-10-24 « corrections préalables à la bascule »; contract `.claude/tasks/contracts/2026-10-25-rust-r5-6-rehearsal.md`; isolated worktree, branch inactive) + - [x] M1 option 1 (input.rs), directional equivalence + fingerprint_verified, v0/v1 load rules, report-compare status, generator order + - [x] original contexts (O7, O10, R2 Zod, R5.1 ledger, TS golden, app goldens) + separate post-switch tests; rust:check + check:all 00:56:22 green on switched state + - [ ] gates: security, fresh verifier → checkpoint, STOP (activation on signal) - [ ] R5.6 D-R5 switch (convention, aliases, membership test in gated readers with per-file go, seed regenerated once by the Rust tool, `.prettierignore`, CHANGELOG) - [ ] 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 - [ ] 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 diff --git a/docs/development/RUST.md b/docs/development/RUST.md index 38cc96da..068338cb 100644 --- a/docs/development/RUST.md +++ b/docs/development/RUST.md @@ -3527,3 +3527,49 @@ sheets carry none); refusing it at the switch means giving every test sheet a bl (over 50 attachments, over 30 alias stamps), not the exact 147/124/123; 11 of the RFC's 24 appendix numbers are not in the V8 oracle (they print right in a probe, unpinned); the `report-compare` alias line drops the draft/published status the plain line shows. + +### 11.20 R5.6 rehearsed in isolation on the switched seed (2026-10-25) + +Owner brief « Validation de la préparation R5.6 et corrections préalables à la bascule ». Contract +`.claude/tasks/contracts/2026-10-25-rust-r5-6-rehearsal.md`. The final patch `.claude/tasks/plans/r5-6-switch.patch` +(28 files) was applied, with the seed switched, in a detached worktree of 943a25a under the session +scratchpad; the branch's own state stays inactive (seed `27c7…`, nothing active). + +**M1, option 1.** `pdf/write/input.rs` `keep_the_report_stamp`: after `assert_exportable`, an old report on +the registered historical value of the same sheet, exported against the canonical value, archives a +snapshot carrying the report's own stamp; a new report keeps the canonical value. The equivalence is one +way (`equivalence(sheet, stamped, current)`: an old stamp against the canonical value, never the +reverse) and needs the loaded sheet's `fingerprint_verified` (set only when a `v1` block was checked +against the registry and its value recomputed from the document at load, `loaded.rs` +`check_reference`; hashing is no longer feature-gated, the wasm module carries `sha2`). `archive/read.rs` +stays strictly equal: the M1 envelope holds one value, so no archive check is loosened. + +**v0 and v1.** No block: a historical reference, loaded as before, unverified, no alias privilege, never +`v1` (even with the canonical value: an old stamp then rebases). A block: known keys only, `v1`, 64 +lowercase hex, never an alias value, aliases only from the registry for that sheet and value, value +recomputed from the document; any contradiction is `invalid_sheet`. + +**Original contexts kept, new behaviour tested apart.** The pre-switch `sheet-ref.json` and migration +map are frozen under `crates/core/tests/fixtures/r5-6/pre-switch` and proven the TypeScript's files +against the R5.1 ledger. O7 (`pdf_import`), O10 (`pdf_compare`), the R2 Zod oracle (`r2-oracles`), the R5.1 +ledger (`r5.pipeline-oracles`), the TypeScript golden (`seed.golden`) and the app goldens (v2 reports taken +as migrated before the switch) run in that context, unchanged. Declared rule `R5.6-fingerprint-v1`: in +the two files only the fingerprint moves from alias to canonical value and `sheet-ref.json` gains the +block (`curation_draft`, byte-exact through the generator's formatter); `report-compare` prints the alias +line, status kept, both raw values, only for a report read as is (77 O10 rows; a migrated v2 report +carries the canonical value and keeps the plain line); a report on another document still prints `!!`. + +**Results on the switched state.** `pnpm rust:check` green; `pnpm check:all` green 00:56:22; `--check` +0 differences on 18 files. Suites: `r5_6_switch` 8 (the owner's nine scenarios: old PDF import, no +rebase, coherent re-export, current reader, pre-switch bundle, labels/views/annotations/branding kept, +new report canonical, forged and case-changed stamps, mixed envelope still rejected, real content change +rebases, load refusals), `sheet_fingerprint` 10 (census pinned: 147 attachments, 124 stamps, 123 alias), +vitest `r5-6.n-1` (the frozen N-1 scanner and Zod readers keep the re-exported snapshot and its +content) and app `r5-6.switch` (2). The app goldens and R4 digests are reproduced byte for byte by +re-exporting the historical reports on the switched sheet. Rollback: the pre-switch build's own +`report-compare` (this branch, unpatched) reads the re-exported PDF with the snapshot kept, matching the +bundled sheet. Generators: the Rust `--out` gives exactly the two switched files; the TypeScript +generator (`import:equine:legacy`) still writes the pre-switch files (`seed.golden`). + +Not done: the patch is not applied to the branch; `pnpm format` must never run over `.claude/` (it +rewrote the append-only audits in the worktree, reverted there).