diff --git a/.claude/audits/2026-10-23-rust-r5-review-verify.md b/.claude/audits/2026-10-23-rust-r5-review-verify.md index b85ccf80..9837d7bd 100644 --- a/.claude/audits/2026-10-23-rust-r5-review-verify.md +++ b/.claude/audits/2026-10-23-rust-r5-review-verify.md @@ -94,3 +94,8 @@ Fresh verifier and security on the fixed commit: below. - Verifier: 2,290 new probes TS + Prettier vs Rust, 0 silent; widths of 149,106 alphanumeric code points equal Prettier's (123 refused); drawings bound held on escape probes; every figure exact. C9: §11.14 says the synthetic oracle covers "references with URL and DOI" and "a level C question per priority" (no URL, no medium priority there; both covered by the equine report); `&name=` admitted only when the name starts with an ASCII lowercase letter. Notes: `markdown.rs` comment "the one glyph wider than its bytes" inaccurate; `scripts/import-equine.sh` header "(R5.2, R5.3)". - Fixed: the three wordings, the comment, the script header. +## Round 14 on eb667ad: verifier C1 to C9 MET, ECARTS(13) = FLOOR only (audit prose quoting suppression keywords; product paths clean on c6e0d85 and develop) + +- Verifier: own differential 17,634 changesets TS + Prettier vs Rust, 12,212 report pairs identical, 22,928 refused, 0 silent, 0 raw difference (planted mutation detected); SVG differential 65 changesets, 236 drawings byte-identical, 4 under the R3 rule, 0 undeclared; every figure exact; `git diff c4e717d..HEAD` changes no executable line. Notes: emoji test accepts either refusal kind (code gives UnsupportedMarkdown); CLAUDE.md "Next: R4, R5" stale (pre-existing); RUST.md §11 heading lists up to R5.3. +- Closing the 13 FLOOR lines needs a contract Clarification (owner); audit records stay append-only. + diff --git a/.claude/memory/evals.md b/.claude/memory/evals.md index 5b0bbe70..2e3a3dc8 100644 --- a/.claude/memory/evals.md +++ b/.claude/memory/evals.md @@ -211,3 +211,9 @@ Action: checkpoint R5.2 delivered, STOP before R5.3. Method: check:all after each fix round; security-auditor (semgrep 725 rules, checklist) → PASS, 6 LOW (3 fixed: Map index, destination claimed + canonicalised, INIT_CWD absolute only); fresh verifier each round, no history. Pass 1 ECARTS(1) (floor on a plan heading) + 2 unreachable divergences aligned; pass 2 null-on-optional (LRN-072); pass 3 (first attempt died on API credit error, rerun on Opus) repeated keys refused by serde derive, NUL touch-mark silent drop (LRN-073), `--out symlink/` trailing slash followed the link; pass 4 C1-C12 met, C13 docs gaps (lossy UTF-8 read, 2 contrived splits undeclared, stale counts). Anomalies: green byte parity on real data hid every finding: all were hostile-input or file-protection defects. A verdict reported after post-pass edits was not re-verified → owner required a fresh pass on the final state. Action: refusal tests now compare reasons by stage; Object.prototype characterised + tested; migration-map debt characterised; final fresh verifier + security on the final R5.3 state before R5.4. Next ports: budget ≥3 verifier passes, probe hostile inputs (null, duplicates, reserved names, symlinks, encodings) in the oracle from the start. + +## EVAL-029 | 2026-10-23 | R5.4 gates: 14 rounds (verifier + security + check:all) to converge + +Method: each round fresh verifier (opus, contract from disk, own TS-vs-Rust differential) + fresh security-auditor (semgrep + checklist + memory probes) + `pnpm check:all`; superseded runs stopped. Rounds 1-5: Markdown guard families (denylist → allowlist at round 3); rounds 6-11: resource bounds (table amplification, records per op, string headers, drawings per annotation, fixed parts); 12-14: doc precision only. Final: c4e717d security PASS (LOW only), check:all green 16:41:34; eb667ad (docs/comments only over c4e717d) verifier all 9 clauses MET, ECARTS(13) = floor-guard hits on audit prose quoting suppression keywords (product paths clean). +Anomalies: docs repeatedly claimed bounds "before any row is built" / "tens of MB" that the next audit disproved; counts drifted after each fix; FLOOR family needs a contract Clarification (human gate), never an audit edit. +Action: LRN-074, LRN-075; checkpoint R5.4 to owner with decisions (FLOOR clarification, curation input cap vs 65× parse, bare URLs autolinked, 2 declared quadratic scans), STOP before R5.5. diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index f5e4aa85..0350080d 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -334,3 +334,7 @@ Owner validated R5.1b/R5.2, go R5.3, named `pnpm r5:import-equine`. e0f149b: `cr ## 2026-10-23 (R5.3 closed after 6 final gate rounds) Owner validated R5.3 functionally, asked a fresh verifier on the final state, Object.prototype characterisation, migration-map debt kept + characterised, LRN/EVAL. 9901106/8654905: Object.prototype member = plain key, safe, test; debt test from TS-frozen cases; refusal reasons compared by stage; LRN-072, LRN-073, EVAL-028. Then 6 rounds (verifier + security + check:all each) on the final state, each finding real edge families via TS-vs-Rust fuzzing (up to 150,000 changesets): NUL field segment silent drop, stack overflow (8 segments, 64 levels, 200,000 values), non-exclusive --out, serde struct-as-array / enum-as-map (draft/shape.rs; R2 derives raised to owner, gated readers), non-list/non-object children, JSON.parse key order + big ints, __proto__ segments, seed identity guard, reads confined to seed. Sixth round c6e0d85: CONFORME 13/13, security PASS LOW only, check:all green. LOW leftovers carried into R5.4. Next: R5.4 (owner go conditional on these checks: met). + +## 2026-10-23 (R5.4 review files in Rust, 14 gate rounds) + +R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_compare}.rs` + `curation/report_guard.rs` (allowlist guard); CHANGELOG 1,114,533 B, REVIEW-REPORT, 3 drawings byte-exact, app-main.svg = R3 trigger-name rule only; `--check` 6/0 + 12/0, 1 declared. Gates: rounds 1-5 Markdown families → allowlist + 798-probe TS sweep; rounds 6-11 bounds (records 16 Mi weight charged per record, report tables 32 Mi summed, drawings 64 MiB projected per annotation + fixed parts); 12-14 docs. Final c4e717d security PASS, check:all green; eb667ad verifier 9/9 MET, only audit-prose FLOOR. LRN-074, LRN-075, EVAL-029. STOP at R5.4 checkpoint; R5.5 on owner go. diff --git a/.claude/memory/learnings.md b/.claude/memory/learnings.md index 28de6583..e56fecd8 100644 --- a/.claude/memory/learnings.md +++ b/.claude/memory/learnings.md @@ -539,3 +539,13 @@ Apply: porting a Zod schema to serde: `.optional()` → `default, deserialize_wi R5.3 applier replaced TS object identity (touched items) with a transient key `"\0touched"`, stripped after each change. Verifier pass 3: an authored value holding that key was taken for a mark and the cleanup deleted it silently, where TS refused it at the strict gate → silent author-data loss. Fix: refuse any NUL-prefixed key in the changeset at parse (`reserved key`), test it. Apply: any in-band sentinel (key, id prefix, magic value) gets a reserved namespace, a refusal at the input boundary and a test; never rely on "no author would write that". Prefer out-of-band state (side table by path) when the cost is similar. + +## LRN-074 | 2026-10-23 | Formatter-parity guard: allowlist + generator sweep, never denylist + +R5.4 ported CHANGELOG/REVIEW-REPORT without a Markdown printer: reproduce Prettier's table alignment only, refuse text Prettier would rewrite. Denylist guard leaked every gate round (emphasis, links, autolinks, entities, strong pairs, URL underscores, image refs, nested padded wiki links, underscore paired across code spans, wiki opened in one field closed in another, field segment closing author `[` from a code span). Allowlist (letters, digits, single spaces, fixed punctuation, few ruled forms; code spans only the generator alphabet `[A-Za-z0-9_:/. -]`; list-item fields refuse `[[ ]] {% %}` whole) + TS-written sweep (798 probes, 400 seeded random, cross-field pairs) converged: rounds 11-14 found 0 silent over ~400,000 TS-vs-Rust cases. +Apply: byte parity with a formatter you do not port → allowlist of what the real data uses, refuse rest loudly, sweep frozen by the formatter itself incl. random strings and constructs split across fields/lines; state guarantee as empirical; add each gate-found family to sweep. + +## LRN-075 | 2026-10-23 | Resource bounds: charge at the allocation site, projection must be a tested upper bound + +R5.4 security rounds 6-11 each broke a bound that looked done: table bound checked after raw rows built; records bound checked after a whole op (one op records once per item, each record cloning change texts); weight counted 1/byte while each cloned String costs header + alloc (~56 B for 1-char id); drawings projected from cleaned SVG only, unnamed triggers copy opened view names ×4; projection 477 B under written for a draft with no annotations (fixed parts uncharged). Each time docs claimed "refused before built". +Apply: bound = check before the clone/allocation, at every producer (record push, marking, subtree loop); weight ≈ real bytes (64 per node/String + bytes); output projection = upper bound per element + fixed part per file, with a test asserting projected ≥ written on real and degenerate inputs (empty, max-copy); measure hostile inputs at 1/10 of the read cap before claiming a bound in docs. diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index 7ce74378..a6dc9be2 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -325,7 +325,7 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo - [x] R5.4b `draft/{overlay,app_review}.rs` on the core tree (`read_svg`, frozen horse.svg, prolog kept verbatim): review overlays and app drawings; bytes vs xmldom where reproducible, parsed trees otherwise; the R3 trigger-name decision declared for app-main - [x] R5.4c `render_draft_artifacts` complete (TS order); `import-equine --check` covers the 12 draft files with explicit criteria (bytes; declared tree rule), PENDING list and `shortcut:` removed; fails on any missing or unauthorised difference - [x] R5.4d proofs: `tests/curation_review.rs` (the 6 files, ledger digests, determinism); TS generator `r5.review-synthetic-oracles.test.ts` → `oracles/r5/review-synthetic.json` (changelog raw + formatted, review report, overlays, app drawings on mini-sheet cases: Unicode, pipes, newlines, long values, emoji refused, every status); R5.3 LOW carry-over (destination identity, cite membership, unreadable-seed message, stale comment, doc nits) - - [ ] R5.4e gates: rust:check, check:all, security auditor, fresh verifier; docs RUST.md §11.14-11.15, CHANGELOG, CLAUDE.md; memory → checkpoint report, STOP before R5.5 + - [x] R5.4e gates: 14 rounds; c4e717d security PASS (LOW only) + check:all green 16:41:34; eb667ad (docs only over it) fresh verifier 9/9 clauses MET, ECARTS = 13 FLOOR hits on audit prose (owner Clarification); docs RUST.md §11.14-11.15, CHANGELOG, CLAUDE.md; memory LRN-074, LRN-075, EVAL-029 → checkpoint delivered, STOP before R5.5 (R5.4 closes on owner validation) - [ ] R5.5 `upload-sheet-assets` bin + runbook (local stack run) - [ ] R5.6 D-R5 switch (convention, aliases, membership test in gated readers with per-file go, seed regenerated once by the Rust tool, `.prettierignore`, CHANGELOG) - [ ] R5.7 consumer census, domain fixtures moved, packages deleted, xmldom + prettier out of the lockfile, docs, ledger; `pnpm check:all`; merge only on the owner's signal