Skip to content

Rewrite your app in Rust, piece by piece, checked against the original at every step. Works with TypeScript, JavaScript, Python, Go, Ruby, Java, C, PHP, C#, Kotlin, PowerShell and Swift.

31.6 KB
Raw Blame

Record/diff comparison core (audit id A1)

Scope and coverage ledger

Assigned files, all read in full (every line):

File Lines Read
src/harness.rs 3358 1-3358
src/recording.rs 597 1-597
src/tolerance.rs 232 1-232
src/js_number.rs 121 1-121
src/mismatch.rs 776 1-776
src/drift.rs 391 1-391
src/fuzz.rs 384 1-384
src/from_tests.rs 439 1-439
src/error_paths.rs 471 1-471
src/process.rs 763 1-763
src/pin.rs 315 1-315
src/cache.rs 361 1-361
tests/recording.rs 989 1-989
tests/float_files.rs, record_cwd.rs, record_timeout.rs, diff_before_build.rs, diff_missing_folder.rs, error_resolution.rs 107+55+124+213+43+227 all
docs/how-it-works.md, DECISIONS.md 350+132 all

Read only in part, because the comparison logic that matters lives there (these are other auditors' files; treat my findings there as "needs the owner's confirmation", though each was reproduced by running the tool): src/app.rs lines 195-372, 805-1135, 2520-2720 (wildcards, noise merge, text compare); src/harness_py.rs 135-200 and 495-640 (Python diff driver, same); src/codegen_php.rs 268-330 (PHP record loop); src/main.rs 1030-1440 and 1500-1600 (record/diff/fuzz/enable CLI paths and exit codes); src/gate.rs 700-806 and 900-1060 (tests baseline, behavior check); src/enable.rs 57-210; src/card.rs 85-150; src/walk.rs filtered. Not read: the other harness_*.rs, harness_swift record loop (own loop), android_device.rs, the other 20k lines of app.rs.

Experiments: I copied the existing debug binary into /tmp/claude-0/-home-user-rust-anything/3155f14a-830f-5883-9a8b-e7611d724b3a/scratchpad/A1/ra and used throw-away projects e1..e5, t1, a1..a3 in that folder (not in the repo; cargo output went to the user cache, not to the repo's target/). Nothing in the repo was modified except this report.

Summary

  • No finding is CRITICAL, but seven are HIGH and each lets diff/gate/enable print a green result for a wrong or unverified port. All were reproduced end to end.
  • The largest class is "the verdict is not tied to this run or to the whole recording": diff.json is never deleted before the driver runs, so a port whose body is std::process::exit(0) gets 17/17 cases match and Gate passed (A1-01); record writes whatever lines the driver produced and never compares them with the cases it generated, so an original that calls process.exit(0) yields a silently truncated recording that still says "Recorded 14 cases ... 100% coverage" (A1-02).
  • Recording integrity checks are optional and local. rm recorded-from.json disables both the stale and the tamper checks (Gate passed on a recording with the failing cases deleted); diff, enable, report and go never check tampering at all and enable/report never check staleness (A1-03). The fingerprint covers only the unit's own files, not imports, data, lockfiles or runtime (A1-04).
  • Looseness is hidden. --float-tolerance accepts anything below 1 (0.9 passed a port that is 50% off), is saved in the manifest and is shown by no diff/gate/report line (A1-05). In app replay, an original that prints [..] or a ... line records a wildcard that matches anything (A1-06); a missing final newline and CRLF are not compared (A1-07); a line that differs between the two recording runs in token count becomes a whole-line wildcard (A1-08). Python accepts TypeError for any original error; TS accepts any throw for any throw (A1-09).
  • fuzz can print 0/0 fresh cases match and exit 0 (A1-11); the gate's panics check can be switched off by a stray #[cfg(test)] or a // inside a string (A1-12).

Findings

A1-01 [H1] [HIGH] [CONFIRMED] The diff verdict is read from a file the driver may not have written this run

  • Where: src/harness.rs:1554-1556 (run(&mut cmd, "node")?; read_to_string(&out)), the same shape in src/harness_py.rs:162-182 and in every other harness_*.rs::diff (diff.json is built at crate_dir/.rust-anything/diff.json; no remove_file before the run; only harness_go.rs:143 removes something else). bench.json likewise (harness.rs:1244-1266).
  • What happens: the driver writes diff.json only at its very end. If the driver process exits 0 before that (the port or original calls exit(0), os._exit(0), process.exit(0)), run sees success and the previous run's diff.json is parsed as this run's result.
  • Failing scenario (reproduced, e4): Python unit check(n) that raises ValueError/OverflowError. Write a correct port, build, diff -> 17/17 cases match. Replace the port body by let _ = n; std::process::exit(0), build, diff -> still 17/17 cases match, exit 0; gate -> pass behavior 17/17, pass ported, Gate passed. (clippy/fmt were satisfied).
  • Evidence: run() (harness.rs:2332-2347) only checks output.status.success().
  • Fix / verification improvement: delete out before spawning, and fail if it is missing or older than the spawn time; cross-check summary.total == number of non-empty lines of cases.jsonl and passed + failed == total in diff_exact (one place, all languages). Mutation self-test in tests/: port that calls exit(0) after one green diff must make diff fail.

A1-02 [H1][H6] [HIGH] [CONFIRMED for TS; code-read for Python/PHP] record never checks that every generated case was recorded

  • Where: src/harness.rs:2204-2304 (record_cases: (Some(status), _) if status.success() => break), harness.rs:545-589 (summarize counts the lines it finds), src/codegen_php.rs:292-296 (catch (\JsonException $e) { continue; }), src/harness_py.rs:~513 (except (KeyboardInterrupt, SystemExit): raise, so sys.exit(0) ends the driver with code 0).
  • What happens: the number of generated cases (cases.len()) is never compared with recorded lines + timed_out.len(). Any early exit with status 0, and any case a driver silently drops (PHP non-UTF-8 result), shrinks the recording with no message. All the later cases, including all trap cases (appended last), vanish. Coverage is computed from what ran, so it still prints 100%.
  • Failing scenario (reproduced, t1): export function f(n: number) { if (n === 42) process.exit(0); return n * 2 }, record --count 40 -> Recorded 14 cases (0 threw), Coverage: the recorded cases ran 4 of the original's 4 lines (100%), exit 0. cases.jsonl has 14 lines; the port is later checked against only those 14 and the rest of the 40+traps never exist. record also overwrites a previous good recording (and saves a fresh fingerprint) with the truncated one.
  • Fix: in record_cases (shared by 10 languages) fail when recorded + timed_out != cases.len() unless the driver reports the drop by index; print and persist generated / recorded / timed_out / dropped in recorded-from.json (committed) and let gate fail when dropped > 0. Test: original that exits 0 on one input must make record exit non-zero. pitfalls.md "A broken port passed because its case was never recorded" is the manual version of this check; make it mechanical.

A1-03 [H1][H4] [HIGH] [CONFIRMED] Staleness and tamper checks are opt-in, bypassable, and absent from diff, enable, report, go

  • Where: src/recording.rs:302-333 (stale, cases_tampered return None when recorded-from.json is missing or has no cases_hash), src/gate.rs:923-936 (only gate calls cases_tampered), src/main.rs:1269-1343 (only the diff CLI prints "Stale recording"), src/main.rs:1520-1560 (enable runs harness::diff and checks only failed/missing), src/card.rs:96-104 (report/card publishes matched/total from harness::diff).
  • What happens: (a) rm port/recorded-from.json silently turns off both checks (the code treats it as "recording made before fingerprints"); (b) harness::diff returns no integrity information, so every consumer except gate ignores staleness and edits of cases.jsonl.
  • Failing scenario (reproduced, e4b): port wrong for n > 1000; diff -> 14/17; enable refuses. Delete the 4 failing lines from cases.jsonl: diff -> 13/13 cases match (exit 0, no warning), enable -> On: check runs in Rust and rewrites the original's m.py. gate then fails with "cases.jsonl changed since record wrote it"; but after rm recorded-from.json the same gate prints pass behavior 13/13 and Gate passed. with no recording line at all.
  • Fix: make a missing recorded-from.json (while cases.jsonl exists) a failing recording check; move stale + cases_tampered into harness::diff_full and return them in DiffOutcome (recording_problems) so diff exit code, enable, report, card and go all see them. Also hash the recording where an agent cannot rewrite both sides in one command: append the cases_hash to the committed rust/audit.jsonl line (or compare with git show HEAD:...). Test: delete/edit the file, assert diff, enable, gate all fail.

A1-04 [H1] [HIGH] [CONFIRMED] The recording fingerprint covers only the unit's own files

  • Where: src/recording.rs:23-58 (fingerprint: a file unit hashes that one file; a folder unit hashes files under the folder, gitignore-respecting via walk::filtered).
  • What happens: transitive imports outside the unit, data files read at run time, dependency/lockfile versions and the runtime (node/python version, TZ, ICU) are not in the hash. A behaviour change anywhere else leaves the recording "fresh".
  • Failing scenario (reproduced, e1): main.py (calc) imports helper.py (double). bridge, record. Change helper.py from n * 2 to n * 3: map --check says "no original changed since it was recorded", exit 0 (recording::stale is the same function diff and gate call). Changing main.py itself flips it to exit 1. tests/recording.rs:12-55 only edits the unit file, so it never sees this. A port written for the old helper still goes 100% and Gate passed.
  • Fix: fingerprint the closure the tool already computes (gate::with_local_imports, used for coverage), plus the language lockfile and node --version / python --version strings, stored as a list of {path, hash} so the message can name the file. Test: change a helper outside the unit, assert stale is Some.

A1-05 [H1][H2] [HIGH] [CONFIRMED] --float-tolerance can be almost 1, is persisted, and is invisible in every verdict

  • Where: src/tolerance.rs:11-21 ((0.0..1.0) allowed; near = |e-a| <= tol * max(|e|,|a|,1)), src/main.rs:1090-1094 and src/mcp.rs:1030-1038 (saved into rust-anything.json), src/harness.rs:1410-1431 (settle reads the saved value for every caller), src/gate.rs:960-964 (gate calls diff with None and so inherits it). grep -i tolerance in gate.rs, report.rs, card.rs, enable.rs, go.rs finds no line that prints it.
  • Failing scenario (reproduced, e3): def scale(x: float) -> float: return x * 2.0 + 0.5; record --float-tolerance 0.9; port returns (x * 2.0 + 0.5) * 1.5 (50% off everywhere). diff -> 23/25 cases match; the 2 left are only the huge values that Python records as {"$float": "1.8e+16"} strings, which the tolerance cannot touch. Nothing says "23 matched only within tolerance 0.9". The same check also forces key-order-insensitive comparison for every language except TS/Python (harness.rs:1415-1426: ignores_key_order(opts) || !preserve_key_order), so with a tolerance set a Ruby/PHP/Java hash returned in a different key order is forgiven.
  • Also: integral Python floats are recorded as {"$float": "-2.0"}; a port result -2.000000000002 is a "type" mismatch, so the tolerance is inert exactly there (conservative, but it makes the tolerance look like it works on the non-integral cases only).
  • Fix: cap at e.g. <= 1e-3 unless --allow-loose-tolerance; count forgiven cases separately in DiffOutcome and print N/N cases match (K within tolerance 1e-9, M with key order ignored) in diff, gate, report; gate fails if the manifest tolerance changed since the last passing gate (like the tests baseline). Test: --float-tolerance 0.9 with a 1.5x port must not print a bare matched.

A1-06 [H1] [HIGH] [CONFIRMED] In app replay, a recorded literal [..] or ... line is a wildcard

  • Where: src/app.rs:879-898 (line_matches: any [..] in the expected text), app.rs:989-1006 (text_matches: an expected line equal to ... matches any number of lines); recorded outputs are stored raw as .stdout/.stderr files, with no escaping.
  • Failing scenario (reproduced, a1): original prints result: [..], ..., end; app record; replay a "port" that prints result: 12345 WRONG, garbage 1, garbage 2, end -> 1/1 cases passed, exit 0.
  • Realistic triggers: CLIs that print trycmd/regex/template syntax, help text with a lone ... line, markdown/ellipsis output.
  • Fix: do not store wildcards in-band. Keep the recorded text literal and put wildcard spans in the .toml/config ({case, field, line, byte range}), or escape literal occurrences when recording (and unescape when comparing). Test: record an original that prints [..] and a lone ..., replay a different output, assert failure.

A1-07 [H1] [MEDIUM] [CONFIRMED] app replay does not compare trailing newlines, CR/LF, or blank-vs-empty output

  • Where: src/app.rs:814-822 (lines() strips one final \n and one \r per line), used by text_matches/compare (app.rs:2623-2650). render_diff has a "(trailing newline: expected ..)" branch (app.rs:1043-1049) that is unreachable for these cases because text_matches already returned true.
  • Failing scenario (reproduced, a2): original writes hello\n to stdout and \n to stderr. A build that writes hello (no newline) and nothing to stderr, or hello\r\n, -> 1/1 cases passed. An empty stdout equals a stdout of one blank line.
  • Fix: compare bytes (or the exact line list including the final-newline flag) unless a normalizer opts in; locate() already has a "trailing newline" kind to report it.

A1-08 [H1] [MEDIUM] [CONFIRMED] Two-run noise detection turns a whole line into a wildcard when token counts differ

  • Where: src/app.rs:1073-1076 (merge_line: if ta.len() != tb.len() { return "[..]" }), app.rs:1100-1135 (merge_noise: unequal insert/delete blocks become one ... line that matches any number of lines).
  • Failing scenario (reproduced, a3): original prints result: w w w (a random number of words) then done. After app record the expected stdout is [..] / done; a build printing COMPLETELY DIFFERENT GARBAGE / done -> 1/1 cases passed. record says only Noise, Values (...): c1 (stdout): it does not show which lines became wildcards or how much of the output is now unconstrained.
  • This is documented ("look at every one") but the tool makes looking hard and the widening is far larger than the noise.
  • Fix: align by tokens (LCS) so only the differing tokens become [..] and the literal prefix result: stays; print the resulting expected line for every wildcarded line; warn/fail when wildcard share of a case's output exceeds a threshold; a third run to confirm the noise class.

A1-09 [H1][H2] [MEDIUM] [CONFIRMED] Error equality is far weaker than the docs say

  • Where: TS DIFF_JS (src/harness.rs:2819-2821: 'error' in expected && 'error' in actual and nothing else; the recorded error is only String(error.message)); Python src/harness_py.rs:560-567: error_type(actual) in (error_type(expected), "TypeError").
  • What happens: TS: a port that throws a plain Error("x") where the original throws RangeError/a custom class with code passes (class name, code, cause, custom fields are not recorded). DECISIONS L7 and how-it-works.md say only that "messages are not compared", which understates it. Python: any port error whose type is TypeError agrees with any original exception.
  • Failing scenario (reproduced, e4): original raises ValueError for n < 0 and OverflowError for n > 1000; the port returns Err("TypeError: whatever") / Err("TypeError: x") for both -> 17/17 cases match, Gate passed (gate failed only for fmt). With KeyError instead of TypeError the same port fails 6 cases, so the wildcard is specific to TypeError.
  • Fix: record name (and code) of thrown errors for TS and compare them; in Python accept the TypeError wildcard only when the error comes from the generated PyO3 argument extraction (distinct marker/exception subclass), not from a port's own Err("TypeError: ..."); document the rule in L7/M7. Test: port that always throws TypeError must fail the ValueError cases.

A1-10 [H6] [MEDIUM] [CONFIRMED by code] diff tests whatever library is on disk for most targets

  • Where: src/harness.rs:789-808 (stale_build handles only Napi, Pyo3, PHP, C#, PowerShell, Swift; _ => return None), harness.rs:810-825 (sources_newer_than looks only at Cargo.toml and src/**/*.rs).
  • What happens: for Wasm, Go, Ruby, Java, Kotlin and C, diff after editing port.rs without build compares the previous binary (green or red) and prints a normal verdict. Path dependencies (a split port; pitfalls "gate checked less than it seemed") and build.rs/Cargo.lock changes are also not seen for the kinds that do check. gate rebuilds, so the final gate is fine; diff, fuzz, bench, and app replay --build are not.
  • Fix: have diff run the (incremental, cheap) cargo build itself, or stamp the built library with a hash of all crate inputs and compare it. Test per kind: edit port.rs, run diff without build, expect an error.

A1-11 [H2][H6] [MEDIUM] [CONFIRMED] fuzz can report 0/0 fresh cases match, exit 0, and the cases are not very fresh

  • Where: src/fuzz.rs:201-217 (if fresh.is_empty() { break; }, which also ignores --time), src/main.rs:1415-1418 (exit failure only if failed > 0), src/harness.rs:2089-2166 (value() draws from 31 strings, 12 ints, 14 floats).
  • Failing scenario (reproduced, e4): fuzz ./port --cases 200 --time 3 -> Seed 271716431, 0/0 fresh cases match (1 round), exit 0, immediately. For an int parameter the whole generator space (12 values + traps) is already in the recording, so there is nothing "fresh" to find, yet how-it-works.md presents fuzz as finding "what the recording missed".
  • Fix: exit non-zero (or at least print "no fresh inputs: the generator is exhausted") when a round yields 0 cases; add real random values (random ints/floats/strings of random length, mutated recorded inputs) to the salted generator; do not stop --time early. Test: a unit with one int param must produce fresh cases for --cases 200.

A1-12 [H4][H6] [MEDIUM] [CONFIRMED] The gate panics check is easy to switch off

  • Where: src/error_paths.rs:185-218 (panics), error_paths.rs:259-269.
  • What happens (all three reproduced on e4, port that has v.unwrap(); baseline FAIL panics):
    1. any #[cfg(test)] line, even on a use or helper, stops the scan (break at line 194): put one above the code and panics passes;
    2. a // inside a string literal truncates the line (line.split("//")): let _u = "http://x"; Ok(v.unwrap()) passes;
    3. only the innermost fn name is blamed, so .unwrap() in a private helper called by the failing export passes (fails.contains(&p.function)); Gate passed. Also // INFALLIBLE: needs no reason text and any comment line above suffices; unimplemented!( is not in PANICS.
  • Fix: parse port.rs with syn (skip only #[cfg(test)] items), attribute a panic to every exported fn that can reach it (call graph), require a non-empty reason and print N INFALLIBLE marks in the gate detail. Test: the three snippets above.

A1-13 [H2] [MEDIUM] [CONFIRMED] "A recorded failing case for every error path" is per function, from the function's own body

  • Where: src/error_paths.rs:113-149 (raise_line looks for throw/raise in the export's own braces/indent), error_paths.rs:221-256 (failed.contains(&r.export)).
  • What happens: how-it-works.md (gate row) and the check's own text say "every error path". The code requires one failing case per function, and the first thrown error may be an accidental TypeError from a generated wrong-type argument (15% of structured args are random JSON, harness.rs:1917-1921) rather than the intended throw. A function that fails only through a callee or an unparsed shape reports "the original fails on purpose nowhere" as a pass (error_paths.rs:239-240); C is always None. The brace matcher counts only " and backtick as string quotes, so a '{' in TS can shift ranges.
  • Fix: say "per function" in the docs, or implement per-site coverage (instrument or use V8/coverage lines that the recorded failing cases reach: the coverage data is already collected for TS). Show "N throw sites, M reached" in the detail.

A1-14 [H6][H5] [MEDIUM] [CONFIRMED] State the gate relies on is gitignored, and dropped inputs are not persisted

  • Where: generated .gitignore contains .rust-anything/ (seen in e4/port/.gitignore); src/gate.rs:260 (TESTS_BASELINE = .rust-anything/tests.json), gate.rs:771-785 (missing baseline -> passed: true), known_diffs_added (gate.rs:727-733, missing baseline -> 0), src/harness.rs:2302 (timed-out.json written, never read by gate/report/card/map).
  • What happens: in a fresh clone or a fresh agent container (the common case) there is no baseline, so "fewer tests", "more ignored", "known-diffs added since last gate" cannot fire. The inputs left out by the 10 s per-case limit (case_timeout, machine-speed dependent: a slow CI box records fewer cases than a fast laptop) live only in the ignored folder and appear only on the terminal of the record run; the record command then says "the port need not match it there".
  • Fix: commit the baseline (put it in recorded-from.json or rust/audit.jsonl), and write timed_out, dropped, generated counts there; gate prints them. Test: gate in a fresh checkout reports "no baseline" as a warning, not a pass.

A1-15 [H2][H3] [MEDIUM] [CONFIRMED] After enable, the fingerprint reports a false "stale recording"

  • Where: src/recording.rs:23-58 hashes the original file as it is; enable inserts a marked block into it (src/enable.rs:166-189).
  • Failing scenario (reproduced, e5): record, build, enable, then diff -> Stale recording: m.py changed since it was recorded, 17/17 cases match but exit 1; gate -> FAIL recording; map --check exit 1. Every enabled unit therefore trips the stale alarm in CI, which trains agents and people to re-run record (which legitimizes whatever the original is now) or to ignore the warning. disable flips it again.
  • Fix: strip the enable block (it has begin/end markers) before hashing, in fingerprint and in the stored hash. Test: record, enable, assert stale is None; disable, assert still None.

A1-16 [H2] [LOW] [CONFIRMED by code] diff --redact is not "shapes only"

  • Where: src/mismatch.rs:550-566 (redact_mismatch keeps at.path; without_context removes only context), mismatch.rs:132-152 (key_path embeds key text, e.g. $["[email protected]"]), mismatch.rs:524-533 (args/results hashed with 64-bit FNV, not a secure hash).
  • What happens: how-it-works.md says no values or arguments, safe to paste; object keys that are data (Record<string, T>) and missing/extra key names are printed, and an FNV-64 of a short string is brute-forceable.
  • Fix: replace key text with a hash or <key> in redacted paths; use a keyed or truncated SHA-256 for the case/expected_hash fields; add a test with a key that is a secret.

A1-17 [H6][H5] [LOW] [CONFIRMED by code] Several run paths have no time limit; recording restarts change state

  • harness::run (harness.rs:2332, used by diff and build/bench) calls cmd.output() with no timeout, contrary to the pitfall "run every outside program through crate::process". A looping port hangs diff forever (no false pass, but an unattended go stalls).
  • After a per-case timeout the driver restarts in a fresh process at the next case (harness.rs:2294-2297), so a stateful original (module-level cache/counter) records later cases from fresh state while diff replays all of them in one process.
  • Fix: route run through process::output with RUST_ANYTHING_COMMAND_TIMEOUT; when a timeout restart happened, mark the cases after it as "state restarted" in the recording report.

A1-18 [H5] [LOW] [PLAUSIBLE] Environment is not part of the recording

  • pin::apply sets TZ=UTC only with --pin-clock (src/pin.rs:103-116); otherwise the original runs under the recorder's TZ, locale, node/python and ICU versions, none of which are saved. Replaying on another machine can fail (conservative) or, if the port hard-codes the recorder's zone, pass only where recorded. RUST_ANYTHING_CASE is also exposed to the port while pinned, so a port could look up answers by case index (contrived; the literals check would see a table).
  • Fix: store node --version, python --version, TZ, LANG and the pinned values in recorded-from.json; warn on mismatch in diff.

A1-19 [H4] [LOW] [CONFIRMED] known-diffs.jsonl has no cap and its alarm needs a baseline

  • src/recording.rs:410-475, src/gate.rs:735-752: any number of entries with any non-empty reason turns mismatches into passes; the "added since the last passing gate" note needs the local baseline (A1-14) and the gate still passes. Minor accounting bug: accepted counts entries used, not mismatches removed, so two identical mismatches explained by one entry leave failed at 1 with an empty mismatch list (conservative).
  • Fix: fail (or require --accept-known-diffs N) when entries exceed a small share of the cases; print the reasons in report.

A1-20 [H2] [LOW] [CONFIRMED by code] Coverage is line coverage that over-counts, and it is printed even for a truncated recording

  • src/recording.rs:241-253: a line is "reached" when any non-whitespace character on it lies in a covered V8 range, so if (rare) return x or a ternary counts as hit with one branch never run. Coverage includes with_local_imports files. Coverage exists only for TS/JS. Combine with A1-02: "100%" after a truncated recording.
  • Fix: use V8 block ranges to mark a line reached only when its first code range has count > 0 and report "lines with an unreached branch" separately.

A1-21 [H1] [WEAK] Lossy codec corners (JS)

CODEC_JS enc (harness.rs:2541-2568): sparse-array holes and null are the same JSON (v.map keeps holes, JSON.stringify writes null); results are awaited on both sides, so a sync original and a Promise-returning port compare equal; class instances compare as their own enumerable fields; a returned Error compares by message only. Each can hide a difference callers see. Improvement: add $hole, record isPromise, and ctor name to the codec and compare them.

A1-22 [H6] [LOW] [CONFIRMED by code] Secret refusal is name-based; --from-tests caps are silent

  • src/harness.rs:355-367: only names containing SECRET, TOKEN, PASSWORD, PASSWD, PASSPHRASE, CREDENTIAL, API_KEY, PRIVATE_KEY (value >= 8 chars). DATABASE_URL, *_KEY, AUTH, DSN, COOKIE are not covered, and no content scan (ghp_, sk-, AKIA, PEM headers) runs.
  • src/from_tests.rs:22-23, 106-113: captured calls are capped at 1000 per function (and 5000 in the injected hook) without a message.
  • Fix: add a content scan on cases.jsonl and print "N calls over the cap were not captured".

Verification improvements for this area (ranked)

  1. One integrity layer in harness::diff_full (fixes A1-01, A1-03, A1-04, A1-10, A1-15 consumers): delete the output file before the driver runs and require a fresh one; check total == lines(cases.jsonl), passed + failed == total; compute stale, tampered, "recorded-from.json missing" and stale-build there and return them in DiffOutcome so diff's exit code, enable, report/card, go and gate all use the same answer.
  2. Record completeness: generated == recorded + timed_out + declared_drops, persisted in the committed recorded-from.json and printed; record refuses to overwrite a good recording with a shorter one without --force.
  3. Mutation self-tests, cheap and mechanical (add to tests/): for a tiny unit per language, assert diff/gate FAIL for each of: port body = exit(0); port always returns the first recorded value; port throws TypeError for every error case; port is 50% off with --float-tolerance 0.9; recording with 1 line deleted + recorded-from.json removed; helper outside the unit changed; original that exits 0 on one input; original that prints [..]; stdout without final newline. Each is a one-screen test using the existing common helpers; today none of them exists (the existing tests only check that good ports pass and that error messages read well).
  4. Make looseness visible and bounded: cap the tolerance, count forgiven cases, show tolerance / key-order / known-diffs / wildcard counts in every "N/N match" line (diff, gate, report, card, MCP result).
  5. Wildcards out of band (A1-06/08) and exact newline compare (A1-07).
  6. Error identity: record error.name/code for TS, tighten the Python TypeError rule.
  7. Fingerprint closure + runtime (A1-04/18) with the enable block stripped (A1-15).
  8. Gate panics/error cases on a real parse (A1-12/13), and persist baselines in committed files (A1-14).
  9. fuzz: fail on an empty round, real random generators, honour --time.

Things checked and found sound (so nobody re-checks them)

  • record --count 0 without inputs is refused before touching cases.jsonl (harness.rs:343-353, tested). diff with 0 recorded cases is an error, not a pass (harness.rs:1299-1302).
  • record_cases watchdog: partial last lines are cut at the last \n, a timed-out case is skipped and the driver resumes at the next index; the progress file/timeout logic is correct apart from A1-17 (harness.rs:2204-2304). process.rs kills the whole process group; the wait timeout is fail-closed.
  • DIFF_JS pass condition: precedence is (!panicked && both-error) || (both-ok && same), so a Rust panic never agrees with an original error; missing exports fail and are listed; class scenarios compare every step (harness.rs:2783-2828).
  • Number-to-text: I compared the formatting logic of js_number::number_to_string against Node's String(x) on 39,992 random and boundary doubles using the same shortest-digit source in Python: 0 differences. (Tie-breaking of the digit source itself is the known pitfall and is not re-tested here.) math_round cases are right.
  • cases_hash covers exactly the first n lines, so appended fuzz --keep cases are allowed and edits/removals of earlier lines are detected (when recorded-from.json is present). fuzz restores cases.jsonl on every exit (Restore), refuses to keep cases that hold a secret value, and its key normalization is order- and 1/1.0-insensitive as tested.
  • apply_known matches fn + args + the exact actual; a different wrong result still fails, and unused entries are reported (recording.rs:447-475); gate fails on them.
  • mismatch.rs only locates and groups differences (it never decides pass/fail); grouping ids are stable and index-free.
  • cache.rs ownership of package names under a file lock; stale_build mtime check for napi/pyo3 works (the guard exists, A1-10 is about the kinds that lack it). pin.rs mulberry32 matches the Rust helper (tested against Node in the unit test).
  • Tolerance never forgives an integer against an integer, nor 3 vs 3.0 (tolerance.rs:35-46), and line_close requires identical text between numbers.