docs(docs): R5.3 third final round declared (RUST.md §11.12-11.13), security final3, verify record

This commit is contained in:
bchanot committed 2026-10-23 10:11:51 +02:00
1 parent 86273b6206
commit 6c0fe88725
3 files changed
+217 -9

No files matched your search

+23 -9
View File
@@ -2885,7 +2885,7 @@ until the switch; no fingerprint change; the cleaned `horse.svg` is read as froz
re-cleaned; the review drawings and the two Markdown reports are R5.4. Contract
`.claude/tasks/contracts/2026-10-22-rust-r5-draft.md`.
`crates/core/src/curation/draft` (2,846 lines, feature `curation`):
`crates/core/src/curation/draft` (2,877 lines, feature `curation`):
| Module | Ports |
|---|---|
@@ -2916,14 +2916,14 @@ Parity, every expectation written by the TypeScript (`tests/curation_draft.rs`,
- the 612 legacy leaves through the core's `read_report_document` on the produced map: 442
identical, 141 moved, 29 removed, every resolved leaf a leaf of the produced document, the
29 flagged paths exactly those the map sends to null, the FR snapshots kept;
- 74 synthetic changesets on the mini sheet (`oracles/r5/curation-synthetic.json`,
- 77 synthetic changesets on the mini sheet (`oracles/r5/curation-synthetic.json`,
generator `packages/anatomy/tests/r5.curation-synthetic-oracles.test.ts`): 11 accepted
cases (every op kind, numeric and anchored positions, subtree scopes with skipped equal
values, the review rule on levels A, B and C, the five rename cascades and a reference
rename, re-homing, two chained changes, the two migration-map debt cases below) byte for
byte on the formatted document, the records, the stats, the migration map and the seed
SQL; 61 refusals (23 schema, `null` on `scope`, `position` and `field` and the shape
family below included, 38 applier, integrity and shape gates included) refused alike, with
SQL; 63 refusals (23 schema, `null` on `scope`, `position` and `field` and the shape
family below included, 40 applier, integrity and shape gates included) refused alike, with
the same reason: the same message for an op or change refusal (change id and op index
included), the same stage for a schema or gate refusal; 7 references files refused alike;
two declared
@@ -2942,6 +2942,8 @@ reproduced byte for byte):
| a `set` field path ending in an inherited `Object.prototype` member (`name.constructor`, `name.toString`, `name.valueOf`…) | `readField` returned the inherited function and the record's `structuredClone` threw (`… could not be cloned`): change refused at the op | the member is an ordinary missing key: written, `before` recorded as null. Kept alone, the shape gate refuses it (every object of the sheet contract is strict). Replaced by a later op of the run (a `set name` on the same item), the change is accepted: the document is byte for byte the one the later op alone gives, one extra record traces the overwritten write. Nothing is bypassed: the settable table checks the first segment on both sides (`constructor` as a field: `unknown field`), no value is read through a prototype, the integrity gate runs on the final document (test `an_inherited_member_name_is_a_plain_key_and_bypasses_nothing`, five member names). Accepted by the owner 2026-10-23 |
| a `set` field path ending in `__proto__` (`name.__proto__`) | the prototype setter swallowed the write: change accepted, one record, the document unchanged (or, when the holder was absent, `description: {}` added by `writeField`) | the key is written and the strict document gate refuses it (the R5.2 family: a name of `Object.prototype` is a plain key) |
| an authored key starting with NUL (`"\u0000touched"`) in a value, or a field path segment starting with NUL (`name.\u0000touched`) | refused at the strict document gate when the key reaches the document, accepted when a later op overwrites or removes it | refused (`reserved key`): at parse for a value, at the op for a field path; the prefix is reserved for the applier's transient touch marks, which the cleanup strips at every depth, so a written key would be lost while a record claims it (found by the final gates, test `a_reserved_or_unbounded_field_path_is_refused_without_writing`) |
| a null, a string, a number or a boolean among the `children` or `categories` of an added item | a TypeError where a walk met it (`descendants`, the review marking: refused), silently skipped by a rename's citation walk (accepted when a later op removed the item), refused by the gate when it stayed | refused at the add (`… entry that is not an object`), whatever follows (three cases frozen from the TypeScript, one declared: `declared-children-string-renamed-then-removed`) |
| a `set` whose path goes through a string (`name.fr.x`): `writeField` replaces the string by an object | `before` recorded as undefined (null), the replaced string in no record; refused by the gate unless a later op overwrites the field | the same (kept, recorded here) |
| a field path of more than 8 segments (the deepest settable path has 2) | accepted, the gate refused the stray keys | refused at the op: a resource bound (20,000 segments overflowed the stack before it) |
| a document nested more than 64 levels after an op (the equine document has 10), by repeated `add` or `move`, or a deep value | accepted when valid | refused at the op: a resource bound checked after every op with an iterative walk (test `the_document_cannot_be_nested_past_the_bound_by_repeated_adds`) |
@@ -2987,8 +2989,9 @@ seed SQL built by string formatting as the TypeScript, from pipeline values only
suite's clippy allow line), `.claude/audits/2026-10-22-rust-r5-draft-security.md`. Fresh
verifier, three passes (`.claude/audits/2026-10-22-rust-r5-draft-verify.md`): pass 1 found
four unreachable divergences, two aligned (`String(id)` for finding targets, the exact
JavaScript `trimEnd` set), two kept as both sides refuse (an added item with a `null` child,
refused at a later stage; a position beyond 2^64, a different number printed); pass 2 found
JavaScript `trimEnd` set), one kept as both sides refuse (a position beyond 2^64, a different number printed; the
second, an added item with a `null` child, proved wrong by the third final round and
replaced by the non-object child row of the table); pass 2 found
one reachable divergence, `null` accepted on the optional `scope`, `position` and `field`
where Zod refused it, now refused alike (three synthetic cases added), and aligned the
re-homing candidates on a set (a path met twice counts once); outcome-identical details
@@ -3014,10 +3017,20 @@ authored files and the gate, plus a missing-list message) and security PASS (MED
LOW: quadratic depth walk, `--check` and reads following symbolic links, residual
check-then-use window, `write_exclusive` accepting any component, lossy normalisation, a test
aimed at the real seed). Fixed: the shape comparison; `document has no list` for a missing
list; every read a regular file under 16 MiB, never a link; `--check` lists a link without
list; every read a regular file under 16 MiB whose canonical path lies in the seed folder (a
link inside the seed is followed only if it stays there); `--check` lists a link without
walking into it; `write_exclusive` takes plain names only and re-checks the claimed folder;
the seed refusal tested on the pure check (`inside`), no test targets the real seed. Kept and
declared: the measured residual risks above.
declared: the measured residual risks above. Third final round on 42bbc48: verifier ECARTS(2)
(C1, C2, C4 to C12 met; 82,000 random changesets, 13,758 accepted identical; one family: a
non-object child of an added item, three splits, and the §11.12 sentence on the `null` child
wrong) and security PASS with LOWs only (reads following folder links out of the seed, the
shape comparison not enforcing array length, a folder appearing after the claim accepted, the
seed guard tested only as a bare function, `before: null` over a replaced string). Fixed:
non-object children refused at the add; reads confined to the seed by canonical path; array
length compared; only folders this run created are used; `claim_destination` takes the seed
and is tested on a fixture (`the_claim_refuses_a_destination_inside_the_seed_and_creates_nothing`).
Declared: the replaced-string `before`, the memory factor.
### 11.13 Checkpoint R5.3
@@ -3029,7 +3042,8 @@ refused it. Not probed on those readers, not changed: a fix there needs the owne
Residual risks, measured by the final security gate and kept: memory has no cap beyond the
16 MiB read bound (a hostile 211 KB changeset of subtree sets on a 2,000-node addition asks
for more than 2 GB, as the TypeScript's clones would); the depth check walks the document
for more than 2 GB; the port clones the op into every record where the TypeScript shared it,
about twice its memory); the depth check walks the document
after every op (a 2.4 MB changeset takes about 10 s); `--out` assumes a single-user machine
(a concurrent process able to write the destination's parent could still swap a component
between a check and its use, never overwriting: every file is `create_new`); invalid UTF-8