Files
faunosteo/.claude/audits/2026-10-22-rust-r5-draft-verify.md
T

5.8 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_draft 6/6, curation_legacy 5/5, the whole crate with --features curation --locked 22 suites green, clippy -D warnings clean, fmt clean, import-equine --check 12 files 0 differences (git status unchanged), --out into a mktemp -d folder then diff -r (legacy identical; draft identical but the three R5.4 entries), produced document_sha256 = 27c7383c…2660 = sha256 of the produced document.json, 8 refusal and success probes of --out, anatomy 142/142, domain 262/262, tsc --noEmit clean.
  • C13 partial by design: pnpm check:all and 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 set without value): no reachable divergence. Four unreachable ones: (1) id_text printed a non-string id as JSON text; aligned on js_string (String()); (2) trimEnd stripped U+0085; aligned on the core's exact JavaScript white-space set (is_js_space); (3) an added item with a null child: 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: strip slices eight UTF-16 units of op.to; apply_record reads record.op whatever 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, --check 12 files 0 differences, 11 --out probes incl. a symlinked parent printing the canonical path and a dangling symlink refused, diff -r, anatomy 142, domain 262).
  • C2 NOT MET: JSON null on the optional scope (set, cite), position (add, move) and field (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 through js::present (absent accepted, null refused); three refused synthetic cases schema-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 Vec where TS used a Set (aligned: deduplicated); annotation_names reads 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); parseViewBox error 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, --check 12/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 ops refused by serde's derive where JSON.parse keeps the last value; (d) a lone surrogate escape; (e) nesting deeper than 128. Fixed (a): both files parsed through js::parse_json then read into the typed shape (test a_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 (test a_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/ and alink// 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, --check 12/0, --out + diff -r, refusal probes incl. symlink/ and symlink/. rc 2, pnpm r5:import-equine --check rc 0, anatomy 142, floor clean).
  • C13: undeclared (a) invalid UTF-8 in changes.json / references.json: TS lossy, Rust refused. Fixed: read_text lossy, as R5.2 kept for the catalog. Declared: (b) 1e400 in a discarded value, (c) an inherited Object.prototype member 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_err only (the contract asks no reason); scripts/import-equine.sh called directly without INIT_CWD resolves a relative --out from 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:all rerun green on the final code (00:10:03), --check 12 files 0 differences.