14 KiB
14 KiB
Verification: Rust R5.3 draft pipeline (2026-10-22)
Contract .claude/tasks/contracts/2026-10-22-rust-r5-draft.md. Fresh verifier, report-only (persisted by the orchestrator: the agent has no write tool).
Pass 1: ECARTS(1)
- C1 to C12 MET, each with code references and proofs run by the verifier:
cargo test --features curation --test curation_draft6/6,curation_legacy5/5, the whole crate with--features curation --locked22 suites green, clippy-D warningsclean, fmt clean,import-equine --check12 files 0 differences (git status unchanged),--outinto amktemp -dfolder thendiff -r(legacy identical; draft identical but the three R5.4 entries), produceddocument_sha256=27c7383c…2660= sha256 of the produceddocument.json, 8 refusal and success probes of--out, anatomy 142/142, domain 262/262,tsc --noEmitclean. - C13 partial by design:
pnpm check:alland the security gate were the orchestrator's (both green / PASS); docs present (RUST.md §11.12 and §11.13, CHANGELOG, CLAUDE.md). - Gap: the floor scan flagged the plan heading of §B.3.5 (
.claude/tasks/plans/2026-10-22-rust-r5-pipeline-core.md:94, pre-existing at HEAD, R5.1), whose status words read as an unfinished marker. Resolved: heading reworded to "(approved at A.5, applied at R5.6)", the status BDR-068 records. - Semantic fidelity (beyond the declared
setwithoutvalue): no reachable divergence. Four unreachable ones: (1)id_textprinted a non-string id as JSON text; aligned onjs_string(String()); (2)trimEndstripped U+0085; aligned on the core's exact JavaScript white-space set (is_js_space); (3) an added item with anullchild: TypeScript throws at the op, Rust refuses at the shape gate (both refuse; kept, declared in RUST.md §11.12); (4) a position beyond 2^64: both refuse "out of range", the printed number differs (kept, declared). - Reproduced quirks:
stripslices eight UTF-16 units ofop.to;apply_recordreadsrecord.opwhatever the record target (declared observation, RUST.md §11.12).
Pass 2: ECARTS(3)
- C1, C3 to C12 MET (proofs rerun: fmt, clippy, curation_draft 6 + curation_legacy 5,
--check12 files 0 differences, 11--outprobes incl. a symlinked parent printing the canonical path and a dangling symlink refused,diff -r, anatomy 142, domain 262). - C2 NOT MET: JSON
nullon the optionalscope(set, cite),position(add, move) andfield(add) parsed as absent by serde; Zod.optional()refused it. Not reached by the committed changeset. C13 NOT MET on the same root (undeclared). Fixed: those fields deserialised throughjs::present(absent accepted,nullrefused); three refused synthetic casesschema-null-{scope,position,field}added to the generator (58 cases: 9 compared, 49 refused alike). - Floor: the pass 1 record above quoted the flagged words; reworded.
- Fidelity details, outcome-identical: re-homing candidates on a
Vecwhere TS used aSet(aligned: deduplicated);annotation_namesreads a non-string name as empty, duplicate ids first-wins (kept: the legacy import writes strings and unique ids); unlisted counter keys keep insertion order (kept: enum strings);parseViewBoxerror quoting (kept: both refuse). - Doc line count corrected (2,689).
Pass 3: ECARTS(4) (first attempt stopped by an API credit error before any check; rerun on Opus)
- C1, C4 to C10, C12 MET (fmt, clippy, curation_draft 6 + curation_legacy 5,
--check12/0,--out+diff -r, anatomy 142, floor clean, a TypeScript probe of 14 changesets and 2 references files). - C2: three accept/refuse splits at parse, undeclared: (a) a repeated key outside
opsrefused by serde's derive whereJSON.parsekeeps the last value; (d) a lone surrogate escape; (e) nesting deeper than 128. Fixed (a): both files parsed throughjs::parse_jsonthen read into the typed shape (testa_repeated_key_keeps_its_last_value_as_json_parse_does); declared (d), (e) in RUST.md §11.12. - C3: (b) a field path ending in
__proto__: TypeScript swallowed the write, Rust refuses at the gate: declared. (c) an authored"\u0000touched"key: TypeScript refused at the gate, Rust took it for a touch mark and the cleanup dropped it silently: a defect, fixed by refusing any NUL-prefixed key in the changeset at parse (testa_reserved_touch_mark_key_in_an_authored_value_is_refused). - C11:
--out <symlink>/(trailing slash) followed the link into an empty folder: fixed, the destination is rebuilt from its components before the symlink check (probed:alink/andalink//refused, rc 2, target left empty). - C13: the splits above undeclared, and §11.13 claimed a leftover mark would be refused by the gate while the cleanup removed it: both corrected.
- The verifier asked the orchestrator to run a probe harness it had written in the scratchpad (its own run was refused by the permission layer); not run: the cases are covered by the tests above and the declared table.
Pass 4: ECARTS(1), on C13 only
- C1 to C12 MET (fmt, clippy, curation_draft 8 + curation_legacy 5,
--check12/0,--out+diff -r, refusal probes incl.symlink/andsymlink/.rc 2,pnpm r5:import-equine --checkrc 0, anatomy 142, floor clean). - C13: undeclared (a) invalid UTF-8 in changes.json / references.json: TS lossy, Rust refused. Fixed:
read_textlossy, as R5.2 kept for the catalog. Declared: (b)1e400in a discarded value, (c) an inheritedObject.prototypemember in a field path; corrected (c') the NUL-key row, (d) test and line counts (8 tests, 2,718 lines). - Notes kept: synthetic refusals assert
is_erronly (the contract asks no reason);scripts/import-equine.shcalled directly without INIT_CWD resolves a relative--outfrom the repository root (pnpm sets INIT_CWD). - Not re-verified by a fresh verifier after these corrections (docs plus the one-line lossy read);
pnpm check:allrerun green on the final code (00:10:03),--check12 files 0 differences.
Final round on 8654905 (owner 2026-10-23: fresh verifier on C1 to C13 + fresh security)
- Verifier ECARTS(2): C3 and C13, one defect. A
setfield path whose segment starts with NUL (name.\u0000touched, any settable holder, self or subtree) was written and then stripped with the touch marks: author value lost, a record claiming the write; TypeScript refused it at the gate. C1, C2, C4 to C12 MET (15 + 200 tests,--check0/12, 14 destination probes, floor clean). - Security PASS (
.claude/audits/2026-10-23-rust-r5-draft-security-final.md): MEDIUM-1 a 20,000-segment field path (40 KB changes.json) overflowed the stack; MEDIUM-2--outwrites not exclusive after the claim; LOW-1 the NUL field path (same as the verifier); LOW-2..and parents created before a failed claim; LOW-3 a destination inside the seed accepted; LOW-4 INIT_CWD and direct-run base; LOW-5 non-UTF-8 argument panic; LOW-6 clippy disallowed list partial (pre-existing); LOW-7 the test allow line (convention). - Fixed: NUL segment refused at the op (
reserved key); field paths capped at 8 segments; document depth capped at 64 levels after every op (iterative walk);--out:..refused, parent must exist, destination inside the seed refused, destination printed before writing, every foldercreate_dir, every filecreate_new;args_os. Documented: direct-run base (LOW-4). Kept: LOW-6 (pre-existing lint scope, out of R5.3), LOW-7 (test convention). Tests added: field-path refusals and 20,000 segments refused without crash, 40 nested adds refused at the bound, 8--outrefusals against the built binary with nothing written. - Next: a fresh verifier and a fresh security audit on the fixed commit.
Second final round on 314cf04
- Verifier ECARTS(3): C2, C3 (one family) and C13. serde's derives accept a struct written as a positional array and a unit enum written as a one-key map, in changes.json, references.json and the curated document (gate through the R2 derives); Zod refused all. 55,000-changeset random differential (TS generator, Rust probe): 7,436 accepted on both sides byte-identical, 335 mismatches, all this family but one message (
document has no "categories"vsdocument has no list "categories"). C1, C4 to C12 MET (18 tests, 203 crate tests,--check0/12, refusal probes, floor clean). Note: the same derives sit in the R2 report and archive contracts (unverified there). - Security PASS (
.claude/audits/2026-10-23-rust-r5-draft-security-final2.md): MEDIUM memory amplification (no cap); LOW quadratic depth walk,--checkand reads following symlinks, residual TOCTOU,write_exclusiveany component, lossy normalisation, test aimed at the real seed, suppressions context, lint list gaps. - Fixed:
draft/shape.rs(typed reading serialised back, compared by shape) on both authored files and the gate; 10 changesets + 2 references files frozen from TS (all refused by TS, refused alike); missing-list message aligned; reads: regular file, 16 MiB cap;listeddoes not follow links;write_exclusiveplain names, root re-checked; seed guard as pureinside+ unit test, integration test no longer targets the seed. Kept, declared in §11.13: memory amplification, quadratic walk, single-user TOCTOU residual, lossy UTF-8 and repeated keys. Raised to the owner: the R2 derive leniency in the gated readers.
Third final round on 42bbc48
- Verifier ECARTS(2), C3 + C13, one family: a null or primitive among the children of an added item. TS: TypeError where walked (refused), skipped by a reference rename's citation walk (accepted if later removed), gate if kept. Rust: tolerated by touch/walk (accepted), refused by rename's item_at_mut. Three splits; §11.12 claimed "both refuse" for the null child, false. Differential: 82,000 random changesets, 13,758 accepted identical (document, records, stats, map), 63 schema + 34 references probes agree. C1, C2, C4 to C12 MET (19 tests).
- Security PASS (
.claude/audits/2026-10-23-rust-r5-draft-security-final3.md), LOW only: reads follow folder links out of the seed; shape comparison ignores array length; a folder appearing after the claim accepted; seed guard wiring untested;set name.fr.xrecordsbefore: null; lint allows (context). - Fixed: non-object children refused at the add (3 TS-frozen cases, 1 declared refusal); reads confined to the canonical seed; array length compared; only folders this run created;
claim_destination(typed, seed)+ fixture unit test. Declared: replaced-stringbefore(TS same), memory factor ~2x TS.
Fourth final round on 6c0fe88
- Verifier ECARTS(2), C3 + C13: records differ (document identical) on array index keys in authored values or field segments (JSON.parse puts them first) and on integers beyond 2^53 (JSON.parse rounds; a Rust record held 9007199254740993 while document.json printed ...992); §11.12 declared-case count wrong. C1, C2, C4 to C12 MET; 25,000 random changesets: 0 accept/refuse splits, 4,331 accepted identical.
- Security PASS (
.claude/audits/2026-10-23-rust-r5-draft-security-final4.md): MEDIUM a present non-listchildrenreplaced by[](author data lost); LOW--checklists through a top-level folder link, mount alias of the seed, walk cost understated (8.2 MB file ~36 s, cap-bound worst case ~45 min), fixture in shared temp, context items. - Fixed:
text::js_normalize(key order + big integers at parse) andtext::js_insert(field path writes); non-listchildren/categoriesrefused at add,children_pathnever replaces;--checkrequires each generated folder to be the seed's own;inside_by_identity(dev, ino of every ancestor);MAX_DOCUMENT_VALUES200,000; fixture under target/. Cases frozen from TS: 2 key-order, 1 integer, 1 declared non-list children; Rust tests: big integer from raw text, value bound.
Fifth final round on 3ece1a6
- Verifier ECARTS(2), C3 + C13: a
__proto__segment in a field path: at the end, TS recordsbefore: {}(setter ignored the primitive) where Rust recorded null and kept a plain key; in the middle, TS polluted Object.prototype and refused, Rust accepted when overwritten; RUST.md claimed the inherited-member family refused by TS at the op, false for__proto__; test count stale (15 vs 13). C1, C2, C4 to C12 MET; 120,000 random changesets: 40,494 accepted identical, no other undeclared split. - Security PASS (
.claude/audits/2026-10-23-rust-r5-draft-security-final5.md): LOW identity guard covers the seed folder only (a subfolder alias passes), quadratic id comparisons (parse_references 31 s at 160,000), seed SQL formatting (checked), test allow (context). - Fixed:
__proto__segment refused at the op (reserved key), declared case frozen from TS (the non-polluting one; the polluting one tested in Rust only, it would corrupt the generator's process); identity guard over every folder of the seed tree; HashSet in assert_declared, distinct, duplicates; docs rows and counts.
Sixth final round on c6e0d85: CONFORME 13/13 (R5.3 closed)
- Verifier CONFORME: C1 to C13 MET on the committed state
c6e0d85(23 curation tests,--check12/0 via cargo and pnpm,--out+diff -r, 21 destination probes, anatomy 142, floor clean; TS-vs-Rust differential on 70,073 changesets: 9,397 accepted identical, 0 Rust-only accepts, TS-only accepts all declared families). - Security PASS (
.claude/audits/2026-10-23-rust-r5-draft-security-final6.md), LOW only: destination folder itself not identity-checked (needs an empty seed folder + a hand mount; none exists), one linear membership in cite (doc precision), seed SQL formatting (checked), test allow (context). - check:all green 10:54:50 on
c6e0d85. - Carried into R5.4 (not applied to the verified state): destination identity check, cite membership hashed, "seed folder unreadable" message, stale test comment, doc nits (inherited row: remove form too; 200,000-value row in the table; line count 2,908; set-without-value counted among schema refusals).