feat(domain): R5.6 prepared, fingerprint convention and registry inert, switch patch
canonical_json (RFC 8785), sheet_fingerprint behind feature fingerprint, TRUSTED_ALIASES (one equine pair), equivalence and check_declared; tests against the RFC vectors, the V8 numbers, an independent Node reference and the archives. No consumer wired: the switch is a rehearsed patch under .claude/tasks/plans.
This commit is contained in:
1 parent
1f8873dbce
commit
3b9a395d43
12 files changed
+1004
-1
No files matched your search
@@ -3453,3 +3453,53 @@ Closing gates round 2 (1ec9e1b): `pnpm check:all` green 03:51:55; targeted fresh
|
||||
behaviour (23 bypass probes refused, a census of 157 repository JSON files finds no authentic shape refused,
|
||||
`--features cli` 261 passed), ECARTS(2) formal: the `parse_envelope` error type and an audit-prose FLOOR line,
|
||||
both settled by a contract Clarification submitted to the owner.
|
||||
|
||||
### 11.19 R5.6 prepared: the fingerprint convention and its registry, not active (2026-10-24)
|
||||
|
||||
Owner brief « Validation R5.5, arbitrage D-R5.6 et préparation de la bascule ». Convention
|
||||
`sha256-rfc8785-validated-v1` confirmed; the core's compiled registry is the only alias authority; five
|
||||
consumers approved (`report/rebase.rs`, `archive/read.rs`, `session.rs`, `pdf/write/input.rs`,
|
||||
`pdf/compare/lines.rs`); Rust becomes the only generator at the switch. **Nothing is active**: no reader,
|
||||
writer or generated file uses the new module; `pnpm r5:import-equine --check` gives 0 differences and
|
||||
`documentSha256` stays `27c7383c…2660`.
|
||||
|
||||
**Committed (inert).** `domain/sheet/fingerprint.rs`: `canonical_json` (RFC 8785: UTF-16 member order,
|
||||
`js_number`, the `JSON.stringify` escape set, no normalisation, I-JSON numbers only), `sheet_fingerprint`
|
||||
(feature `fingerprint`: strict parse, R2 shape, zero integrity issue, JCS of the typed reading, SHA-256),
|
||||
`TRUSTED_ALIASES` (one entry: sheet `503dc301-…`, canonical `12d788727c1e532641bd5b3a7ecf39dbdd25e70350f8a76be5ca917b262874e2`,
|
||||
alias `27c7383c445c73dc2001ebf4794a3ea63d416910bbbaa0d7848dd720de7c2660`, convention of the alias
|
||||
`sha256-prettier-file-bytes-v0`), `equivalence` (Identical, TrustedAlias, Different; the pair must belong to
|
||||
the same sheet, either way round; raw values stay with the caller) and `check_declared` (a `sheet-ref.json`
|
||||
block must name `v1` and list only registered aliases of that sheet and canonical value).
|
||||
Tests `sheet_fingerprint` (9): the RFC vectors, the 44,322-row V8 number oracle, the independent Node
|
||||
reference (`scripts/r5-fingerprint-differential.mjs`, own canonicaliser, frozen once into
|
||||
`oracles/r5/fingerprint-differential.json`, 7 cases: ES number edges, UTF-16 key order, escapes, nesting,
|
||||
repeated keys), the draft's value recomputed equal to the frozen `b_rfc8785_validated`, invalid and
|
||||
malformed documents refused, the registry contract, and the census of the historical archives (147 PDF
|
||||
attachments and the JSON fixtures: 124 sheet stamps, 123 are the alias and open as the same document, the one
|
||||
other stays different).
|
||||
|
||||
**Prepared, not applied: `.claude/tasks/plans/r5-6-switch.patch`** (applies cleanly on this commit). The
|
||||
five consumers through `equivalence` (rebase skipped on the registered pair of the same sheet, the stamp kept;
|
||||
archive snapshot pair; export sheet match; `report-compare` prints both raw values for an alias match; `session.rs`
|
||||
needs no own change, it goes through the rebase), the generator stamping `sheet_fingerprint` and writing the
|
||||
descriptive block, the sheet load refusing a block that contradicts the registry (`loaded.rs`, `facade.rs`:
|
||||
`invalid_sheet`), `.prettierignore` on `legacy-import/` and `draft/`, and the rehearsal suite
|
||||
`fingerprint_consumers` (3: alias not rebased and stamp kept, real change and forged value rebased, archive pair
|
||||
kept and forged pair rejected). Rehearsal with the patch applied: `pnpm rust:check` green, `pnpm check:all` green
|
||||
14:32:05, then the files restored.
|
||||
|
||||
**Seed at the switch (measured with the patch, written to a scratch folder, never to the seed):**
|
||||
|
||||
| File | Before | After | Why | Check | Rollback |
|
||||
|---|---|---|---|---|---|
|
||||
| `draft/sheet-ref.json` | sha256 `2c0716f1…b285`, `document_sha256` `27c7…2660` | sha256 `03e7f6ab…623b`, `document_sha256` `12d7…74e2` + block `fingerprint` {`convention`, `aliases: [27c7…2660]`} | the convention | `--check` byte-exact against the regenerated folder; the load check | `git revert` |
|
||||
| `draft/report-migration-map.json` | sha256 `4139c51d…fce9`, `sheet.documentSha256` `27c7…` | sha256 `0e991bc2…2db`, `12d7…` | a migrated v2 report is stamped with the current value | same | `git revert` |
|
||||
| the 16 other files | unchanged | unchanged (`document.json`, `horse.svg`, `equine_draft.sql` compared byte for byte) | no content change | `--check` | n/a |
|
||||
|
||||
Found by the rehearsal, to settle in the switch: four suites fail with the generator switched. Two expect it
|
||||
(`curation_draft`: the draft files byte for byte against the TypeScript ledger, and the historical fingerprint
|
||||
test): at the switch they compare the two files under a declared rule (the fingerprint field and block only),
|
||||
the oracles untouched. Two are an order defect of the rehearsal (`curation_review`, drawings bound tests): the
|
||||
fingerprint validates the document before the drawings' resource bound applies; the switch computes it after
|
||||
that bound.
|
||||
Reference in new issue
Block a user