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.
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/enableprint 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.jsonis never deleted before the driver runs, so a port whose body isstd::process::exit(0)gets17/17 cases matchandGate passed(A1-01);recordwrites whatever lines the driver produced and never compares them with the cases it generated, so an original that callsprocess.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.jsondisables both the stale and the tamper checks (Gate passedon a recording with the failing cases deleted);diff,enable,reportandgonever check tampering at all andenable/reportnever 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-toleranceaccepts 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). Inapp 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 acceptsTypeErrorfor any original error; TS accepts any throw for any throw (A1-09). fuzzcan print0/0 fresh cases matchand exit 0 (A1-11); the gate'spanicscheck 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 insrc/harness_py.rs:162-182and in every otherharness_*.rs::diff(diff.jsonis built atcrate_dir/.rust-anything/diff.json; noremove_filebefore the run; onlyharness_go.rs:143removes something else).bench.jsonlikewise (harness.rs:1244-1266). - What happens: the driver writes
diff.jsononly at its very end. If the driver process exits 0 before that (the port or original callsexit(0),os._exit(0),process.exit(0)),runsees success and the previous run'sdiff.jsonis parsed as this run's result. - Failing scenario (reproduced,
e4): Python unitcheck(n)that raisesValueError/OverflowError. Write a correct port,build,diff->17/17 cases match. Replace the port body bylet _ = n; std::process::exit(0),build,diff-> still17/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 checksoutput.status.success(). - Fix / verification improvement: delete
outbefore spawning, and fail if it is missing or older than the spawn time; cross-checksummary.total == number of non-empty lines of cases.jsonlandpassed + failed == totalindiff_exact(one place, all languages). Mutation self-test intests/: port that callsexit(0)after one green diff must makedifffail.
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(summarizecounts the lines it finds),src/codegen_php.rs:292-296(catch (\JsonException $e) { continue; }),src/harness_py.rs:~513(except (KeyboardInterrupt, SystemExit): raise, sosys.exit(0)ends the driver with code 0). - What happens: the number of generated cases (
cases.len()) is never compared withrecorded 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.jsonlhas 14 lines; the port is later checked against only those 14 and the rest of the 40+traps never exist.recordalso overwrites a previous good recording (and saves a fresh fingerprint) with the truncated one. - Fix: in
record_cases(shared by 10 languages) fail whenrecorded + timed_out != cases.len()unless the driver reports the drop by index; print and persistgenerated / recorded / timed_out / droppedinrecorded-from.json(committed) and letgatefail whendropped > 0. Test: original that exits 0 on one input must makerecordexit 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_tamperedreturnNonewhenrecorded-from.jsonis missing or has nocases_hash),src/gate.rs:923-936(onlygatecallscases_tampered),src/main.rs:1269-1343(only thediffCLI prints "Stale recording"),src/main.rs:1520-1560(enablerunsharness::diffand checks onlyfailed/missing),src/card.rs:96-104(report/cardpublishesmatched/totalfromharness::diff). - What happens: (a)
rm port/recorded-from.jsonsilently turns off both checks (the code treats it as "recording made before fingerprints"); (b)harness::diffreturns no integrity information, so every consumer exceptgateignores staleness and edits ofcases.jsonl. - Failing scenario (reproduced,
e4b): port wrong forn > 1000;diff-> 14/17;enablerefuses. Delete the 4 failing lines fromcases.jsonl:diff->13/13 cases match(exit 0, no warning),enable->On: check runs in Rustand rewrites the original'sm.py.gatethen fails with "cases.jsonl changed sincerecordwrote it"; but afterrm recorded-from.jsonthe same gate printspass behavior 13/13andGate passed.with norecordingline at all. - Fix: make a missing
recorded-from.json(whilecases.jsonlexists) a failingrecordingcheck; movestale+cases_tamperedintoharness::diff_fulland return them inDiffOutcome(recording_problems) sodiffexit code,enable,report,cardandgoall see them. Also hash the recording where an agent cannot rewrite both sides in one command: append thecases_hashto the committedrust/audit.jsonlline (or compare withgit show HEAD:...). Test: delete/edit the file, assertdiff,enable,gateall 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 viawalk::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) importshelper.py(double).bridge,record. Changehelper.pyfromn * 2ton * 3:map --checksays "no original changed since it was recorded", exit 0 (recording::staleis the same functiondiffandgatecall). Changingmain.pyitself flips it to exit 1.tests/recording.rs:12-55only edits the unit file, so it never sees this. A port written for the old helper still goes100%andGate passed. - Fix: fingerprint the closure the tool already computes (
gate::with_local_imports, used for coverage), plus the language lockfile andnode --version/python --versionstrings, stored as a list of{path, hash}so the message can name the file. Test: change a helper outside the unit, assertstaleisSome.
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-1094andsrc/mcp.rs:1030-1038(saved intorust-anything.json),src/harness.rs:1410-1431(settlereads the saved value for every caller),src/gate.rs:960-964(gate callsdiffwithNoneand so inherits it).grep -i toleranceingate.rs,report.rs,card.rs,enable.rs,go.rsfinds 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.000000000002is 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-3unless--allow-loose-tolerance; count forgiven cases separately inDiffOutcomeand printN/N cases match (K within tolerance 1e-9, M with key order ignored)indiff,gate,report; gate fails if the manifest tolerance changed since the last passing gate (like the tests baseline). Test:--float-tolerance 0.9with a 1.5x port must not print a barematched.
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/.stderrfiles, with no escaping. - Failing scenario (reproduced,
a1): original printsresult: [..],...,end;app record; replay a "port" that printsresult: 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\nand one\rper line), used bytext_matches/compare(app.rs:2623-2650).render_diffhas a "(trailing newline: expected ..)" branch (app.rs:1043-1049) that is unreachable for these cases becausetext_matchesalready returned true. - Failing scenario (reproduced,
a2): original writeshello\nto stdout and\nto stderr. A build that writeshello(no newline) and nothing to stderr, orhello\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 printsresult: w w w(a random number of words) thendone. Afterapp recordthe expected stdout is[..]/done; a build printingCOMPLETELY DIFFERENT GARBAGE/done->1/1 cases passed.recordsays onlyNoise, 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 prefixresult: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 actualand nothing else; the recorded error is onlyString(error.message)); Pythonsrc/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 throwsRangeError/a custom class withcodepasses (class name,code,cause, custom fields are not recorded). DECISIONS L7 andhow-it-works.mdsay only that "messages are not compared", which understates it. Python: any port error whose type isTypeErroragrees with any original exception. - Failing scenario (reproduced,
e4): original raisesValueErrorforn < 0andOverflowErrorforn > 1000; the port returnsErr("TypeError: whatever")/Err("TypeError: x")for both ->17/17 cases match,Gate passed(gate failed only forfmt). WithKeyErrorinstead ofTypeErrorthe same port fails 6 cases, so the wildcard is specific toTypeError. - Fix: record
name(andcode) 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 ownErr("TypeError: ..."); document the rule in L7/M7. Test: port that always throwsTypeErrormust 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_buildhandles only Napi, Pyo3, PHP, C#, PowerShell, Swift;_ => return None),harness.rs:810-825(sources_newer_thanlooks only atCargo.tomlandsrc/**/*.rs). - What happens: for Wasm, Go, Ruby, Java, Kotlin and C,
diffafter editingport.rswithoutbuildcompares the previous binary (green or red) and prints a normal verdict. Path dependencies (a split port; pitfalls "gate checked less than it seemed") andbuild.rs/Cargo.lockchanges are also not seen for the kinds that do check.gaterebuilds, so the final gate is fine;diff,fuzz,bench, andapp replay --buildare not. - Fix: have
diffrun the (incremental, cheap)cargo builditself, or stamp the built library with a hash of all crate inputs and compare it. Test per kind: editport.rs, rundiffwithoutbuild, 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 iffailed > 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 anintparameter the whole generator space (12 values + traps) is already in the recording, so there is nothing "fresh" to find, yethow-it-works.mdpresents 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
--timeearly. 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 hasv.unwrap(); baselineFAIL panics):- any
#[cfg(test)]line, even on auseor helper, stops the scan (breakat line 194): put one above the code andpanicspasses; - a
//inside a string literal truncates the line (line.split("//")):let _u = "http://x"; Ok(v.unwrap())passes; - only the innermost
fnname 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 inPANICS.
- any
- Fix: parse
port.rswithsyn(skip only#[cfg(test)]items), attribute a panic to every exported fn that can reach it (call graph), require a non-empty reason and printN INFALLIBLE marksin 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_linelooks forthrow/raisein 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 accidentalTypeErrorfrom a generated wrong-type argument (15% of structured args are random JSON,harness.rs:1917-1921) rather than the intendedthrow. 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 alwaysNone. 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
.gitignorecontains.rust-anything/(seen ine4/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.jsonwritten, 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 therecordrun; the record command then says "the port need not match it there". - Fix: commit the baseline (put it in
recorded-from.jsonorrust/audit.jsonl), and writetimed_out,dropped,generatedcounts 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-58hashes the original file as it is;enableinserts a marked block into it (src/enable.rs:166-189). - Failing scenario (reproduced,
e5):record,build,enable, thendiff->Stale recording: m.py changed since it was recorded,17/17 cases matchbut exit 1;gate->FAIL recording;map --checkexit 1. Every enabled unit therefore trips the stale alarm in CI, which trains agents and people to re-runrecord(which legitimizes whatever the original is now) or to ignore the warning.disableflips it again. - Fix: strip the
enableblock (it has begin/end markers) before hashing, infingerprintand in the stored hash. Test: record, enable, assertstaleisNone; disable, assert stillNone.
A1-16 [H2] [LOW] [CONFIRMED by code] diff --redact is not "shapes only"
- Where:
src/mismatch.rs:550-566(redact_mismatchkeepsat.path;without_contextremoves onlycontext),mismatch.rs:132-152(key_pathembeds 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.mdsays 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 thecase/expected_hashfields; 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 bydiffandbuild/bench) callscmd.output()with no timeout, contrary to the pitfall "run every outside program throughcrate::process". A looping port hangsdiffforever (no false pass, but an unattendedgostalls).- 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 whilediffreplays all of them in one process. - Fix: route
runthroughprocess::outputwithRUST_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::applysetsTZ=UTConly with--pin-clock(src/pin.rs:103-116); otherwise the original runs under the recorder's TZ, locale,node/pythonand 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_CASEis 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,LANGand the pinned values inrecorded-from.json; warn on mismatch indiff.
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-emptyreasonturns 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:acceptedcounts entries used, not mismatches removed, so two identical mismatches explained by one entry leavefailedat 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 inreport.
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, soif (rare) return xor a ternary counts as hit with one branch never run. Coverage includeswith_local_importsfiles. 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,COOKIEare 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.jsonland print "N calls over the cap were not captured".
Verification improvements for this area (ranked)
- 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; checktotal == lines(cases.jsonl),passed + failed == total; computestale,tampered, "recorded-from.json missing" and stale-build there and return them inDiffOutcomesodiff's exit code,enable,report/card,goandgateall use the same answer. - Record completeness:
generated == recorded + timed_out + declared_drops, persisted in the committedrecorded-from.jsonand printed;recordrefuses to overwrite a good recording with a shorter one without--force. - Mutation self-tests, cheap and mechanical (add to
tests/): for a tiny unit per language, assertdiff/gateFAIL for each of: port body =exit(0); port always returns the first recorded value; port throwsTypeErrorfor every error case; port is 50% off with--float-tolerance 0.9; recording with 1 line deleted +recorded-from.jsonremoved; 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 existingcommonhelpers; today none of them exists (the existing tests only check that good ports pass and that error messages read well). - 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).
- Wildcards out of band (A1-06/08) and exact newline compare (A1-07).
- Error identity: record
error.name/codefor TS, tighten the Python TypeError rule. - Fingerprint closure + runtime (A1-04/18) with the
enableblock stripped (A1-15). - Gate
panics/error caseson a real parse (A1-12/13), and persist baselines in committed files (A1-14). fuzz: fail on an empty round, real random generators, honour--time.
Things checked and found sound (so nobody re-checks them)
record --count 0without inputs is refused before touchingcases.jsonl(harness.rs:343-353, tested).diffwith 0 recorded cases is an error, not a pass (harness.rs:1299-1302).record_caseswatchdog: 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.rskills the whole process group; thewaittimeout is fail-closed.DIFF_JSpass 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_stringagainst Node'sString(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_roundcases are right. cases_hashcovers exactly the firstnlines, so appendedfuzz --keepcases are allowed and edits/removals of earlier lines are detected (whenrecorded-from.jsonis present).fuzzrestorescases.jsonlon 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_knownmatches fn + args + the exactactual; a different wrong result still fails, and unused entries are reported (recording.rs:447-475);gatefails on them.mismatch.rsonly locates and groups differences (it never decides pass/fail); grouping ids are stable and index-free.cache.rsownership of package names under a file lock;stale_buildmtime check for napi/pyo3 works (the guard exists, A1-10 is about the kinds that lack it).pin.rsmulberry32 matches the Rust helper (tested against Node in the unit test).- Tolerance never forgives an integer against an integer, nor
3vs3.0(tolerance.rs:35-46), andline_closerequires identical text between numbers.