chore(memory): R5 owner decisions BDR-068, R5.1b/R5.2 contract, TODO, journal, LRN-071, EVAL-027

This commit is contained in:
bchanot committed 2026-10-22 21:24:05 +02:00
1 parent 6afc1e0a37
commit 5e114da2ce
7 files changed
+75 -4

No files matched your search

+8
View File
@@ -509,3 +509,11 @@ Decision: J1 + J2 declared PASS as a whole on iPhone Safari iOS (no per-check sp
Alternatives: wait for per-check iPhone measures (rejected by owner: device-level declaration suffices for merge, measures = follow-up); regenerate goldens on any gap (forbidden).
Recorded: RUST.md §10.15 (risk table + checks), PDF_IMPORT_HARDENING.md §7, R4_J1/J2_RESULTS + MINI_RECETTE, CHANGELOG headers, TODO R4.13.
Status: active; limits stay: no release 0.2.0, no deploy, no DNS/server change, no R5 before next owner signal, D2/D4/D5 deferred.
## BDR-068 | 2026-10-22 | R5 owner decisions: D-R5 = RFC 8785 of validated doc, aliases, F1 fix, byte-exact port, frozen SVG bytes
Context: owner validated R5.1 (« Validation R5.1, décision D-R5 et lancement du portage Rust »).
Decision: D-R5 = option B, convention `sha256-rfc8785-validated-v1` = sha256 of RFC 8785 canonical JSON of the validated document (defaults filled, canonical model), real RFC 8785 (UTF-16 key sort, ES number print, UTF-8, no Unicode normalisation, I-JSON refusals, Rust/JS deterministic) proven by official vectors + edge cases + independent differential; `v1` freezes the construction and validation rules (later defaults/schema never change v1 identity retroactively). Alias mechanism approved: Report v3 `sheet.documentSha256` stays 64 hex; new reports stamp current convention; old reports open with no rebase on identical document; aliases only from trusted frozen historical documents, never from an archive or bundle; unknown fingerprint ≠ official sheet; real anatomical change still migrates; no archive/fixture/oracle rewritten. F1 fix authorised first. Port byte-exact by default, differences declared one by one; fingerprint-bearing artifacts regenerated once at R5.6 only. Historical SVG bytes (horse.svg) kept, never re-serialised. `.prettierignore` on Rust-written generated paths, narrow, with a reproducible check. Upload tool reuses `ureq` (no reqwest by default) at R5.5. Slicing R5.1b to R5.7 validated; stop after R5.2.
Alternatives: A (Rust emitted bytes, re-ties identity to a serialiser), C (Rust reproduces Prettier bytes, keeps formatter chain); one-time visible rebase of every old archive (rejected: transparent alias possible).
Status: active. R5.1b + R5.2 done 2026-10-22; documentSha256, seed, report contracts untouched until R5.6; no merge, no package deletion, no 0.2.0, no deploy.
+7
View File
@@ -198,3 +198,10 @@ Action: owner checkpoint; floor 21 DELETED_TEST (R4.8 deletions, approved in bri
Method: 2 analyzer agents (pipeline inventory 43 files, fingerprint census: producers, consumers, 99 PDFs, docs), both refused to write files (role rule) → orchestrator saved reports; generator test (`MAKE_R5_ORACLES=1`) + freeze re-run green 6/6, anatomy 137, domain 262; Node scripts (matrix, PGlite jsonb) + scratchpad Rust binary on core crate: digests compared value by value; tie census 200k values.
Anomalies: R2 oracle test self-referential on number printing (LRN-070) → F1 undetected since R2; docs contradict (BDR-045 vs RUST.md §10.10 / TODO "will change once") → cross-reference added; analyzer inventory counted "10 anomalies" wrong in orchestrator draft (actual 27, records 825 not 690, 16 ledger artifacts) → corrected from oracle counts before commit.
Action: F1 fix proposed, owner go; D-R5 recommendation B + aliases; checkpoint delivered, STOP.
## EVAL-027 | 2026-10-22 | R5.1b + R5.2 gates: check:all, security, verifier
Method: check:all green 21:16:39 (app 434, core-wasm 58, domain 262, anatomy 141, supabase 40, curation suites, worker + images); security-auditor semgrep 129 rules / 36 files → PASS, 0 HIGH, 5 LOW; fresh verifier on contract `2026-10-22-rust-r5-f1-importer.md` → CONFORME 12/12 (ran cargo workspace + curation suites + import-equine --check itself, red-before proven by rustc probe).
Anomalies: LOW report.rs `Map` index panics on hand-built ImportResult → fixed (get chain) after verdict, importer suite + --check rerun green; LOW quadratic vertebrae scan, symlink-following `listed()` in --check, lint allows (accepted, operator inputs). check:all ran on pre-commit tree (code identical to 03bdb5e). Verifier floor note: plan B.3.5 "(proposal, not implemented)" heading from R5.1, intended.
Action: checkpoint R5.2 delivered, STOP before R5.3.
+4
View File
@@ -322,3 +322,7 @@ Owner: J1 + J2 PASS on computer, Android, real iPhone Safari iOS (declared as a
## 2026-10-22 (R5.1 freeze + D-R5 study)
Owner: R4 bilan validated, R5.1 authorised (freeze TS pipeline, study D-R5, stop before Rust pipeline + fingerprint change). Branch `feature/rust-r5-pipeline-core` from 9c0117a. Two analyzers (inventory, documentSha256 census) → `.claude/audits/R5_*.md`. Oracles `oracles/r5/{pipeline,ids,fingerprints}.json` via `r5.pipeline-oracles.test.ts` (MAKE_R5_ORACLES=1; 6 cases, determinism two runs, ledger vs committed). Study scripts `scripts/r5-fingerprints.mjs`, `packages/supabase/scripts/r5-jsonb-fingerprint.mjs`; throwaway Rust experiment (scratchpad) reproduced every draft digest byte-for-byte, JCS 40 lines no crate, RFC vectors pass; jsonb round trip keeps B only. Found F1: `js_number` tie rounding (Grisu up vs ES6 even; `840.1692504882812`, 7.4 % of float32 values; `zmij` matches) hidden by self-referential R2 oracle test → LRN-070, EVAL-026, not fixed (owner go). Plan `2026-10-22-rust-r5-pipeline-core.md`, RUST.md §11, TODO R5.1 ticked. Recommendation: B on validated form + alias mechanism (old `27c7…` stays valid, no visible migration). STOP at checkpoint. No Rust pipeline, no fingerprint change, no merge.
## 2026-10-22 (R5.1b F1 fix, R5.2 legacy importer in Rust)
Owner validated R5.1, decided D-R5 = B `sha256-rfc8785-validated-v1` + aliases, F1 go, byte-exact port, frozen SVG bytes, ureq at R5.5 → BDR-068. R5.1b aed6b1e: `js_number` digits from `zmij` (edge only, no new crate), V8 oracle 44,322 rows (1,552 mismatches before → 0), `zod_oracle` now checks oracle bytes (red on old printer), rust:check + wasm + check green, no oracle/golden/digest moved. R5.2 03bdb5e: `crates/core/src/curation` (feature `curation`, 3,187 lines: Prettier string width table transcribed, JSON layout rules, table alignment, slugify via icu_normalizer NFD, uuids, legacy importer, IMPORT-REPORT) + `import-equine --check|--out`; legacy-import/ byte-exact (6 files), pipeline.json legacy parts equal, 10 synthetic TS cases, 968 Prettier probes; declared refusals: emoji width, malformed SVG, wrong-typed catalog nodes. Docs 82f1664 (RUST.md §11.9-11.11, CHANGELOG), contract `2026-10-22-rust-r5-f1-importer.md`. Gates: check:all green 21:16:39, security PASS (5 LOW, report Map-index panic fixed), verifier CONFORME 12/12 → EVAL-027. STOP after R5.2 checkpoint.
+5
View File
@@ -524,3 +524,8 @@ Apply: when an implementation is swapped under a test that spied the old one, re
Found by R5.1 study. `js_number` (core json.rs) takes shortest digits from `format!("{:e}")` (Grisu): exact tie between two shortest candidates → Grisu picks upper, ECMAScript/Python/`zmij` pick even. `840.1692504882812` (= 840.16925048828125, float32-exact, Horse.svg legacy cx) → Rust `…813`. Rate: 7,401 / 100,000 float32-exact values in 0..2000, 769 / 100,000 random doubles, `zmij` (serde_json 1.0.154 formatter, locked) 0. Draft seed has no tie → every R2/R3/R4 suite green, but `sheet_contract.rs` `zod_oracle` computes expected = `to_js_pretty(oracle.output)` → same function both sides → blind. 134 JSON fixtures Node vs Rust pretty: 2 differ (legacy baseline, that value).
Apply: shortest-float port → take digits from `zmij`/ryu-class crate, never `{:e}`; tie vectors (float32-exact values) in unit tests; oracle expected must be the recorded JS text, never re-printed by the port under test. Any R5 importer emitting legacy coordinates needs the fix first.
## LRN-071 | 2026-10-22 | Prettier byte parity for generated JSON/Markdown is cheap: four layout rules + one width table, oracle-probed
R5.2 reproduced Prettier 3.8.3 `parser: json` over `JSON.stringify(v, null, 2)` and markdown table alignment in ~350 lines Rust, byte-exact on 968 synthetic probes + 7 seed files + 3 reports. Rules that mattered: objects always expanded (stringify newline after `{`), array breaks when >1 element and all elements arrays >1, or child breaks, or flat form + trailing comma > 80 cols; broken all-number arrays use `fill`, others one per line; `printNumber` drops `e+`; width = length if all bytes 0x20..0x7F else per code point (controls/combining/VS16 = 0, East Asian wide/fullwidth = 2) after RGI emoji replaced by spaces. Emoji table not reproduced → refuse (`UnsupportedWidth`), declared. Probe generator in TS (vitest, `MAKE_R5_ORACLES=1`) sweeping depth × key width × count × digits around the 80-col boundary found both bugs (`e+21` form, width fast path) before any real file did.
Apply: any port that must match a formatter's bytes: sweep the boundary with synthetic probes written by the formatter itself; transcribe tables from the installed package (same table lives in `index.mjs` and plugin), never from memory; refuse unreproduced classes loudly instead of approximating.
+3 -3
View File
@@ -306,9 +306,9 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo
- [ ] outside R4 (owner 2026-10-17, non-blocking): worker container ignores SIGTERM (Docker kill after 10 s; chore, e.g. `init: true`); README test counter stale (367 vs 1,015)
- [ ] R5 curation pipeline + importer + upload tool (plan `.claude/tasks/plans/2026-10-22-rust-r5-pipeline-core.md`, branch `feature/rust-r5-pipeline-core` from 9c0117a; owner 2026-10-22: R5.1 authorised, stop before any Rust pipeline code and before any `documentSha256` change; no merge without validation, no deletion of packages/anatomy or domain, no golden or historical change, no 0.2.0, no deploy, no SaaS feature): `packages/anatomy` + `packages/domain` deleted at the end, docs map; all before Step 13
- [x] R5.1 freeze + D-R5 study (2026-10-22): inventory `.claude/audits/R5_PIPELINE_INVENTORY.md`, census `.claude/audits/R5_DOCUMENT_SHA256_CENSUS.md`, oracles `crates/core/tests/oracles/r5/{pipeline,ids,fingerprints}.json` (generator `packages/anatomy/tests/r5.pipeline-oracles.test.ts`, `MAKE_R5_ORACLES=1`), study scripts `scripts/r5-fingerprints.mjs` + `packages/supabase/scripts/r5-jsonb-fingerprint.mjs`, RUST.md §11, anatomy 137/137, domain 262; F1 found: core `js_number` rounds exact ties upward (JS: to even; `zmij` matches), 1 legacy value, invisible on the draft, R2 contract test self-referential → checkpoint, STOP
- [ ] owner decisions at the checkpoint: D-R5 (A / B validated form / C; alias mechanism; convention name), F1 fix go, byte-preserving vs one-time regeneration per artifact, horse.svg frozen bytes vs re-clean, `.prettierignore` on `supabase/seed/**`, upload tool HTTP crate
- [ ] R5.1b F1 fix (`zmij` digits, tie unit tests, `zod_oracle` on the recorded JS text) after the owner's go
- [ ] R5.2 legacy importer in Rust + `import-equine` bin (legacy-import/ byte-exact, IMPORT-REPORT by table padding or parsed tables)
- [x] owner decisions (2026-10-22, BDR-068): D-R5 = B `sha256-rfc8785-validated-v1` (applied at R5.6 only), aliases from trusted frozen documents only, F1 go, byte-exact by default + declared differences, historical SVG bytes kept, `.prettierignore` on Rust-written paths + reproducible check, `ureq` preferred at R5.5; stop after R5.2
- [x] R5.1b F1 fix (aed6b1e): `zmij` digits; V8 oracle `oracles/r5/numbers.json` 44,322 rows (1,552 mismatches before, 0 after); 840.1692504882812 test; `zod_oracle` checks oracle bytes vs core compact print (red on old printer); consumers audited R2-R4: rust:check + wasm + check green, no oracle/golden/digest moved
- [x] R5.2 legacy importer in Rust (feature `curation`, `crates/core/src/curation/**`, 3,187 lines) + `import-equine --check | --out`: legacy-import/ 4 texts + 2 SVG byte-exact, pipeline.json legacy parts equal, raw report = pre-Prettier digest, determinism, 10 synthetic TS cases (2 byte-exact, 8 refused alike), format probes (968 JSON, 10 tables, slugs, uuids, Number, Math.round, key order); declared differences RUST.md §11.10; contract `.claude/tasks/contracts/2026-10-22-rust-r5-f1-importer.md` → checkpoint, STOP before R5.3
- [ ] R5.3 changeset applier, migration map, stats, seed SQL (draft JSON + SQL under the decided fingerprint, 825 records, 612 leaves)
- [ ] R5.4 review overlays + app drawings on the R3 layer/compose (parsed trees), CHANGELOG + REVIEW-REPORT
- [ ] R5.5 `upload-sheet-assets` bin + runbook (local stack run)
@@ -0,0 +1,43 @@
# Contract: R5.1b (F1 fix) and R5.2 (legacy importer in Rust, `import-equine`)
Base: 64d4595 on `feature/rust-r5-pipeline-core` (« chore(memory): R5 plan, pipeline inventory and documentSha256 census audits, TODO R5.1, journal, LRN-070, EVAL-026 »). Range: `64d4595..HEAD`; `<base>` below is 64d4595. Date: 2026-10-22.
## REQUEST (verbatim excerpts, owner, « Validation R5.1, décision D-R5 et lancement du portage Rust »)
« Je valide la correction du défaut d'arrondi de `js_number` dans le cœur Rust. La nouvelle implémentation doit reproduire les règles ECMAScript, notamment les égalités décimales exactes et les cas limites identifiés. Utiliser une implémentation éprouvée déjà présente dans l'écosystème du projet lorsque c'est approprié […]. Ajouter : un test caractérisant précisément le cas 840.1692504882812 ; des vecteurs couvrant les égalités d'arrondi ; des tests différentiels Rust / ECMAScript et des cas limites ; une référence indépendante pour éviter qu'une implémentation calcule elle-même son attendu. Auditer les consommateurs de `js_number` dans R2, R3 et R4. Conserver les oracles et goldens gelés. Si une divergence apparaît sur les corpus historiques, […] arrêter le portage avant toute modification de golden ou de contrat. »
« Par défaut, chaque fichier produit par Rust doit correspondre à l'ancien pipeline octet pour octet. Les différences éventuellement nécessaires doivent être déclarées individuellement […]. Ne pas modifier silencieusement les données métier pour satisfaire un oracle. »
« Je décide de conserver les octets de `horse.svg` et des autres assets historiques […]. » « Ne pas ajouter `reqwest` par défaut […]. Ce choix sera implémenté à R5.5, pas pendant R5.2. »
« Vérifier les cas limites de deterministicUuid, slugify, UTF-16, Math.round et Number(''). Ne pas se contenter de tests sur les données équines actuelles lorsque le contrat est générique et multi-espèces. »
« Conserver les tests TypeScript et les oracles gelés durant le portage. Ne pas modifier `documentSha256`, le seed officiel ou les contrats des bilans avant R5.6 […]. Ne supprime pas encore packages/anatomy ou packages/domain. »
## FILE SCOPE
- R5.1b: `crates/core/src/json.rs`, `Cargo.toml` and `crates/core/Cargo.toml` (`zmij`), `Cargo.lock` (one dependency edge), `crates/core/tests/json_numbers.rs`, `crates/core/tests/common/mod.rs` (`zod_oracle` raw-text check, `repo_path`), `crates/core/tests/oracles/r5/numbers.json`, `scripts/r5-number-oracle.mjs`
- R5.2: `crates/core/src/curation/**` (new), `crates/core/src/lib.rs` (module behind `curation`), `crates/core/src/bin/import_equine.rs` (new), `Cargo.toml` and `crates/core/Cargo.toml` (feature `curation`, `icu_normalizer`, optional `sha2`, bin, two test targets), `Cargo.lock` (one dependency edge), `crates/core/tests/{curation_format,curation_legacy}.rs`, `crates/core/tests/oracles/r5/{prettier-json,markdown-tables,js-semantics,legacy-synthetic}.json`, `packages/anatomy/tests/{r5.format-oracles,r5.legacy-synthetic-oracles}.test.ts`, `scripts/rust-check.sh` (the `curation` lines)
- Docs and memory: `docs/development/RUST.md` §11.9 to §11.11, `CHANGELOG.md` (Unreleased), this contract, `.claude/tasks/TODO.md`, `.claude/tasks/plans/2026-10-22-rust-r5-pipeline-core.md` (owner decisions), `.claude/memory/{decisions,journal,learnings,evals}.md`
Out of scope: `supabase/seed/**` (no generated or authored file changes), `apps/**`, `packages/**/src`, `packages/core-wasm/**`, the existing oracles (`crates/core/tests/oracles/*.json`, `oracles/r3/**`, `oracles/r4/**`, and the R5.1 files `oracles/r5/{pipeline,ids,fingerprints}.json`), `apps/app/tests/fixtures/**` (goldens, R4 digests), the gated readers (`crates/core/src/domain/{archive/read,report/rebase,report/read,session}.rs`, `crates/core/src/pdf/{read,json_js,import}.rs`), `crates/worker/**`, `pnpm-lock.yaml`; any deletion.
## ACCEPTANCE CRITERIA
1. F1 fixed with an existing implementation: `js_number`'s digits come from `zmij` (already in `Cargo.lock` through serde_json 1.0.154 before the base: `git show <base>:Cargo.lock | grep -A2 'name = "zmij"'`); `git diff <base> -- Cargo.lock` adds dependency edges only (`"zmij"` and `"icu_normalizer"` under `faunosteo-core`), no new `[[package]]`.
2. Independent reference: `crates/core/tests/oracles/r5/numbers.json` was written by Node (`scripts/r5-number-oracle.mjs`, `String(value)`, values as IEEE bits) and holds ≥ 40,000 rows including the bits `408a415aa0000000` → `840.1692504882812`; `crates/core/tests/json_numbers.rs` compares `js_number(f64::from_bits(..))` to every row and has a dedicated test for 840.1692504882812 (both signs) and the two other tie values of the study.
3. Red before, green after: on the base's `json.rs` the number suite fails (orchestrator run: « 1552 mismatches, first: 408a415aa0000000: 840.1692504882813 vs V8 840.1692504882812 ») and the strengthened `zod_oracle` fails `the_legacy_import_baseline_prints_as_zod_outputs_it`; after the fix both pass. The verifier checks by reading that `zod_oracle` compares the oracle's raw bytes with `to_js_compact(oracle) + "\n"` before using `to_js_pretty`.
4. R2 to R4 preserved: `git diff --stat <base> -- crates/core/tests/oracles/*.json crates/core/tests/oracles/r3 crates/core/tests/oracles/r4 apps/app/tests/fixtures crates/core/tests/conformance crates/core/tests/fixtures` is empty; the check:all log (path in the brief) shows the cargo suites (pdf_serialize, pdf_layout, anatomy_*, sheet_*, report_*, archive_*) and the app 434 / core-wasm 58 / domain 262 cases green.
5. Formatting parity, generic: `crates/core/tests/curation_format.rs` passes: the 968 Prettier JSON probes match except case 19 (emoji, refused with `UnsupportedWidth`), the 10 table probes match except case 5 (emoji, refused), the 7 generated JSON files of the seed print byte for byte, slugs (ids.json 801 rows + 22 edges) and uuids (6 + 7) match, `Number()` (39 texts), points (12), `Math.round` (18, bits kept), `trim` (8) and `Object.keys` order (3) match. The probes were written by Prettier and Node (`r5.format-oracles.test.ts`), not by Rust.
6. Importer parity: `crates/core/tests/curation_legacy.rs` passes: the 4 text files of `legacy-import/` byte for byte and the 2 SVG copies; every key of `pipeline.json`'s `legacy` section (sheetId, viewBoxes, stats, sourceDigests, assets, anomalies, issues, regionInferences, zoneStats, annotationRows) equal in the JavaScript compact form; the raw report's sha256 equals the ledger's `before_prettier_sha256`; two runs byte-equal; the 10 synthetic cases of `legacy-synthetic.json` (2 accepted: files byte for byte and every result part; 8 refused by the TypeScript: refused by Rust too).
7. Binary: `cargo run -p faunosteo-core --features curation --bin import-equine -- --check` prints `legacy-import: 6 files, 0 differences` and exits 0; `--out` refuses a non-empty folder (exit 2, nothing written); the binary never deletes a file (read `crates/core/src/bin/import_equine.rs`: no `remove_*` call).
8. Declared differences only: every behaviour where the port refuses what JavaScript accepted is listed in RUST.md §11.10 (emoji widths; malformed SVG, DTD or caps; non-string ids, non-array `children` / `categories` / `sources`; prototype-named keys) and none of them is reachable by the committed sources (criterion 6 proves the equine folder).
9. Gating: the curation code compiles only with feature `curation` (`#[cfg(feature = "curation")]` on the module; the bin and the two suites `required-features`); `crates/wasm/Cargo.toml` and `crates/worker/Cargo.toml` do not enable it; `scripts/rust-check.sh` runs clippy and tests with `--features curation`.
10. Scope held: `git diff --stat <base> -- supabase apps packages/core-wasm packages/domain packages/anatomy/src packages/supabase crates/worker pnpm-lock.yaml` is empty; `packages/anatomy` and `packages/domain` still exist; no `reqwest` anywhere in `Cargo.lock`; no deletion (`git diff --diff-filter=D --name-only <base>` empty); `documentSha256` and `sheet-ref.json` unchanged.
11. Suites: `pnpm check:all` exit 0 on the final code state (log ending `== all checks passed`); `pnpm rust:check` exit 0 with the curation lines; `git status --short` empty at the end.
12. Docs: RUST.md §11.9 (F1: fix, oracle, consumers audited with the result on R2 to R4), §11.10 (R5.2: modules, parity proofs, declared differences, binary), §11.11 (checkpoint R5.2, conditions for R5.3); CHANGELOG Unreleased lines for F1 and the importer; the owner's decisions recorded (BDR) with D-R5 = `sha256-rfc8785-validated-v1` not yet applied.
## CLARIFICATIONS
Q: emoji in a table cell or a JSON string: reproduce Prettier's RGI emoji table? / A: no: the table is not reproduced; a text holding an emoji candidate is refused (`UnsupportedWidth`), declared, and absent from every committed source (the only emoji of the sources, in `Horse.svg`, never reaches a generated text). [owner brief « Les différences éventuellement nécessaires doivent être déclarées individuellement »]
Q: the binary's command name and a pnpm script? / A: no new pnpm script at R5.2 (a public name is the owner's to choose); the bin is reached through cargo. [CLAUDE.md « a name that becomes public → ask »]
@@ -3,7 +3,7 @@
- date: 2026-10-22 | rev 1 (R5.1 only; the later slices are a proposal for the R5.1 checkpoint) | branch: `feature/rust-r5-pipeline-core` (cut from develop 9c0117a, R4 merged)
- spec: owner brief 2026-10-22 « Clôture R4 validée et autorisation R5.1 » (§A.0); `docs/development/RUST_ARCHITECTURE_REVIEW.md` II.2 rows "anatomy curation pipeline" and "upload-sheet-assets" (lines 299, 300), VI.1 row R5 (636), VI.3 (655), VI.4 (662 to 668), D-R5 (837, 873), Annex C D-R5 amendment (974); BDR-043, BDR-045; CLAUDE.md "Anatomical sheet model", "Schemas", archive-reader gate
- facts: `.claude/audits/R5_PIPELINE_INVENTORY.md` (the TypeScript pipeline), `.claude/audits/R5_DOCUMENT_SHA256_CENSUS.md` (the fingerprint), the oracles under `crates/core/tests/oracles/r5/`, the study scripts `scripts/r5-fingerprints.mjs` and `packages/supabase/scripts/r5-jsonb-fingerprint.mjs`
- status: R5.1 authorised (freeze and study, no Rust pipeline, no fingerprint change). Checkpoint report due at the end of R5.1; D-R5 decided by the owner on the evidence.
- status: R5.1 validated 2026-10-22; D-R5 decided (A.5); R5.1b and R5.2 done, checkpoint R5.2 pending; R5.3 on the owner's go.
- not in scope of R5.1: any Rust implementation of the pipeline, any change to `documentSha256` or to the readers, the deletion of `packages/anatomy` or `packages/domain`, any golden or historical reference regeneration, release 0.2.0, deployment, SaaS features.
# Part A. For the owner
@@ -35,6 +35,10 @@ The curation pipeline (legacy import, changeset application, migration map, CHAN
Stop and report when: a generated file does not reproduce from a fresh run (the golden test fails); an oracle generator would have to alter a committed generated file or golden; a study step needs a change to a gated reader; the branch would need a develop merge.
## A.5 Owner decisions (2026-10-22, BDR-068)
R5.1 validated. D-R5 = option B, convention `sha256-rfc8785-validated-v1`, applied at R5.6 only, proven by the RFC vectors, edge cases and an independent differential; `v1` freezes the construction and validation rules. Aliases of the historical fingerprints from trusted frozen documents only (never from an archive or a bundle); Report v3 `sheet.documentSha256` keeps 64 hex; an unknown fingerprint is never an official sheet; a real anatomical change still migrates. F1 fixed first (R5.1b), with an independent reference. Byte-exact reproduction by default, every difference declared. Historical SVG bytes kept (never re-serialised). `.prettierignore` on the Rust-written paths, narrow, with a reproducible check. `ureq` preferred for the upload tool (R5.5). Slicing B.5 validated; stop after R5.2 (checkpoint: F1 result and impact on R2-R4, importer parity, byte differences, tests and audits, residual risks, conditions for R5.3).
# Part B. The plan
## B.1 Inventory