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.

33.8 KB
Raw Blame

Whole-app verification: CLIs (audit id A5a)

Scope and coverage ledger

All line counts are from wc -l. "Read" means read with the Read tool, every line, in chunks.

File Lines Read
src/app.rs 3995 1-3995 (100%)
src/effects.rs 1806 1-1806 (100%)
src/whole_app.rs 821 1-821 (100%)
src/wire.rs 1013 1-1013 (100%)
src/lift.rs 1199 1-1199 (100%)
src/front_door.rs 1463 1-1463 (100%)
docs/whole-apps.md 369 1-369 (100%)
tests/app.rs 1521 1-1521 (100%)
tests/app_fresh.rs 213 1-213 (100%)
tests/app_stale.rs 456 1-456 (100%)
tests/effects.rs 769 1-769 (100%)
tests/sandbox.rs 251 1-251 (100%)

Read only in part, to answer a specific question (not a coverage claim): src/main.rs (say_replay, recorded_summary, AppCmd::Record), src/process.rs (Sandbox::wrap), src/gate.rs (rust_checks, ported_check, stubs), src/audit.rs (lifted), src/http.rs (fallback bookkeeping lines), skills/rust-anything/whole-app.md lines 150-260, docs/STATUS.md (grep). NOT read: src/app_shadow.rs, src/front_door_http.rs, src/http.rs (beyond the lines above), src/library.rs, src/mime.rs, src/tolerance.rs, src/drift.rs. Anything said about them below is inference from their callers.

Note on src/wire.rs: it is the binary wire codec for the Go/Java bridges, not the app wire command (that is front_door::wire). I audited it as assigned; it is only loosely about whole apps.

Experiments (all in /tmp/claude-0/-home-user-rust-anything/3155f14a-830f-5883-9a8b-e7611d724b3a/scratchpad/A5a/e1..e10), run with a copy of the already-built target/debug/rust-anything 5.0.2. Nothing was built or changed inside the repository. e3 is a full app record -> front-door -> wire -> lift run.

Summary

  • app lift does not prove the original is gone, and prints a claim it never measured. The check is glue_text.contains("original::") on the wired units' glue files plus a rebuild without original.rs. A glue that runs python3 /abs/tcli.py with std::process::Command gets "Fallback rate: 0.0% (0/68)" from wire, passes lift, and the checklist line replay ... fallback rate 0 (no fallback path left) is a hard-coded string. Reproduced end to end (A5a-01). The repo's own test hides the original before the final replay; the product does not.
  • app replay is lenient in ways that matter for real ports. A missing trailing newline, CRLF for LF, and an empty stdout vs a blank line all pass, for stdout, stderr and written files (A5a-02). Files the build writes that the original did not write, and files it deletes, are never checked (A5a-03). A literal ... or [..] in the original's output becomes a wildcard (A5a-04).
  • Recordings can be edited or silenced without a trace. status = "skipped" removes a case from the console count (2/2 passed, the skip shows only inside the report file), lift ignores it, and nothing detects a hand-edited .stdout (A5a-05).
  • Effects are narrower than the docs suggest. HTTPS never reaches the sink (no HTTPS_PROXY), a failing --db-dump is recorded as the expected database state, only content-type and text bodies are compared (A5a-09, A5a-10). app record copies environment secrets into committed files and inherits the caller's environment (A5a-07).
  • The fallback-rate arithmetic itself is sound (per case, counted when the glue declines through original::run*), and wire never marks anything verified. The weak point is only what lift accepts as "no fallback".

Findings: 18 in all: 1 CRITICAL, 5 HIGH, 8 MEDIUM, 4 LOW (A5a-01 to A5a-18; 14 CONFIRMED by experiment or code trace, 4 PLAUSIBLE/WEAK).

Findings

A5a-01 [H1][H2][H4] [CRITICAL] [CONFIRMED] lift accepts a front door that still shells out to the original, and prints "fallback rate 0 (no fallback path left)" without measuring it

  • Where: src/lift.rs:756-781 (the textual checks), src/lift.rs:1013-1024 (the hard-coded claim), src/front_door.rs:389-399 (the only place a fallback is logged), src/app.rs:3172-3201 (rate), docs/whole-apps.md:165-166,171-180, src/mcp.rs:765, README.md:126.
  • What happens: a fallback is counted only when code calls original::run/run_with_stdin, because that is the one function that appends to RUST_ANYTHING_FALLBACK_LOG. lift then blocks on: (1) the glue file text containing original::, (2) a non-generated main.rs containing original::, (3) failing build/gate/replay. It never looks for Command::new, an interpreter crate (pyo3, rquickjs, deno_core, mlua...), a path into the original's folder, or a reqwest-style proxy for HTTP apps that is kept under another module. After the checks pass, the checklist item replay is written as "{}/{} cases pass against the lifted binary, fallback rate 0 (no fallback path left)" regardless of what the lifted binary does; the lifted binary has no fallback hook, so replay returns fallback: None and nothing is checked.
  • Failing scenario (reproduced, e3): fixture tests/fixtures/cli/python; app record; app front-door; hand-written crate cheat-rs (one identity fn + test); app wire . cheat-rs --skip-gate --command copy ... --command tcli; glue rust/app/src/units/cheat.rs = Command::new("python3").arg("<repo>/tcli.py").args(&args).status(). Output: 68/68 cases passed / Fallback rate: 0.0% (0/68). Then app lift . printed every line pass (fmt, clippy, test, replay in CI, assets) and Lifted: ./rust/app is a pure Rust app. Renaming tcli.py and replaying the "pure" binary: 0/68 cases passed. A side effect of the textual check: a comment that mentions `original::` in the glue blocks the lift (false positive), which shows how it is decided.
  • Evidence: lift.rs:766 else if !library && glue_text.contains("original::"); lift.rs:1021 literal "... fallback rate 0 (no fallback path left)"; tests/app.rs:787-807 does the missing step (std::fs::rename(repo.join(original), &hidden) before replaying the lifted binary), but only in the test, only for the fixtures.
  • Fix / verification improvement:
    1. Make lift do what tests/app.rs:787 does: run the final replay with the original unreachable. Cheapest portable form: PATH reduced to the build's own directory plus system dirs without the interpreter (env_clear + PATH=/usr/bin:/bin minus node/python3/java/... found via which on the recorded run[0]), and, where available, run it under process::Sandbox with the repository path unreadable (bwrap --tmpfs <repo> / sandbox-exec deny file-read* on it). Fail the lift if the pass count drops. Where no sandbox exists, move the original's files aside as the test does.
    2. Replace the hard-coded fallback rate 0 text with what was measured, or drop the claim.
    3. Add static signals as Fail (not warn): std::process::Command/tokio::process in rust/app/src and unit crates unless the recorded app itself spawns children (then Warn listing the call sites), absolute or CARGO_MANIFEST_DIR-relative paths into the repository, include_*! of the original's source files, and a dependency allow-list check on rust/app/Cargo.toml and the unit crates for embedded interpreters.
    4. Mutation self-test (cheap, in tests/app.rs): the cheat glue above must make lift refuse. Keep it as a regression test; it is 30 lines.

A5a-02 [H1] [HIGH] [CONFIRMED] Newlines are not compared exactly: missing trailing newline, CRLF vs LF, empty vs blank line all pass (stdout, stderr and written files)

  • Where: src/app.rs:814-822 (lines), src/app.rs:990-1007 (text_matches), src/app.rs:2564-2589 (compare), src/app.rs:2895 (written files go through the same compare), unit test src/app.rs:3384 (assert!(text_matches_exact("a\r\nb", "a\nb\n")) documents it as intended "trycmd matching").
  • What happens: both sides are split with lines(), which drops one trailing \n and a \r at the end of every line; render_diff has a "trailing newline" kind, but compare only calls it after text_matches already failed. lines("") and lines("\n") are both empty.
  • Failing scenario (reproduced, e1, e2, e8): original prints hello\nworld\n; builds printing hello\nworld and hello\r\nworld\r\n both give 1/1 cases passed. Original that prints nothing for empty and a blank line for blank, port that swaps them: both pass. A written out.csv of a,b\n1,2\n vs port writing a,b\r\n1,2: 1/1 cases passed. The same applies to stderr.
  • Fix: keep trycmd-style leniency only if the user opts in (--lenient-newlines, saved in the config, printed by app record next to the normalizers). Default: compare bytes (after wildcard expansion). The wildcard matcher can work on \n-split lines that keep their \r and a flag for "ends with newline". Test: port variants no-trailing-newline, crlf, empty-vs-blank of a three-line program must each fail replay; the existing matching_follows_trycmd test gets its last assertion inverted.

A5a-03 [H1] [HIGH] [CONFIRMED] Files the build writes or deletes beyond what the original did are never compared

  • Where: src/app.rs:2853-2877 (removed: only if let Some(expected) = &spec.removed), 2878-2907 (written: loops over the recorded files only), src/app.rs:2497 and 2025-2029 (.out/ and .removed exist only when non-empty), src/app.rs:645-665 (walk_files: regular files under the working directory only).
  • What happens: for each recorded file the build must produce a matching one; extra files in run.files are ignored. When the original wrote nothing there is no .out/ and no file check at all; when it removed nothing there is no .removed and deletions by the build are not checked. Directories, symlinks, permissions, and anything outside the working directory ($HOME, /tmp, absolute paths) are not seen, in record or replay (replay is never sandboxed: check passes sandboxed = false, src/app.rs:2796).
  • Failing scenario (reproduced, e1): original only prints; port prints the same and also writes evil.txt in the working directory and a file outside it: 1/1 cases passed.
  • Fix: in check, when the case has no .out/ expect run.files empty (and no .removed expect no removals); when it has one, report unexpected file X for files not paired. Same for removed. Add a --no-unexpected-files escape only for apps with genuinely timing-named output (those already have normalizers + pair_files). Mutation test: port that writes an extra file / deletes a fresh file must fail.

A5a-04 [H1] [HIGH] [CONFIRMED] A literal ... line or [..] in the original's output becomes a wildcard at replay

  • Where: src/app.rs:879-898 (line_matches), src/app.rs:998 (if *line == "..."), no escaping in write_case (src/app.rs:2022).
  • What happens: wildcards are in-band. Recorded text that really contains ... (progress, truncation, a Markdown list) or [..] (globs, rustc-style output, Python slices in reprs) is treated as "any number of lines" / "any text".
  • Failing scenario (reproduced, e9): original prints Loading\n...\nDone\npattern: src/[..]/x; port prints Loading\nGARBAGE\nMORE GARBAGE\nDone\npattern: src/WHATEVER/x: 1/1 cases passed.
  • Fix: record-time check: if the settled expected text contains [..] or a ... line that did not come from merge_noise, either escape it (choose an escape such as a private-use sentinel, and unescape on compare) or store the case with binary = true-style exact comparison and print "case X contains literal wildcard text: compared exactly". Test: the scenario above must fail on the port.

A5a-05 [H4] [HIGH] [CONFIRMED] Cases can be hand-edited or skipped with no integrity check; skips are invisible on the console and to lift

  • Where: src/app.rs:2480-2490 (status = "skipped" -> Expect::Skip), 3143-3146, 3174-3177 (skipped cases leave total), src/main.rs:838-851 (say_replay never prints skipped), src/lift.rs:805-812 (replay.passed != replay.total, skipped unused), docs/whole-apps.md:107 ("Read and edit them by hand").
  • What happens: editing status to "skipped" (or deleting a case, or rewriting a .stdout to match the port) changes the verdict. Skipped: 1 appears only in replay-report.md. Lift never checks. app drift would catch an edited expectation (it replays the original), but nothing in replay or lift runs it, and the skill text ("change a case only with the user's approval") has no mechanical backing.
  • Failing scenario (reproduced, e2): three cases, port wrong on one; set that case to status = "skipped": console 2/2 cases passed, exit 0; report line Skipped: 1.
  • Fix: (1) print skipped N on the console and in --json, make lift refuse while skipped > 0; (2) at record time write a SHA-256 of each case's files into rust-anything.json ("digests": {"case": "..."}); replay prints N cases differ from their recording (edited by hand) and lift refuses unless --accept-edited (which writes an audit entry); (3) have lift run the cheap half of drift (the original against the cases) once, since edited expectations no longer match the original. Test: edit one .stdout, expect refusal.

A5a-06 [H4] [HIGH] [PLAUSIBLE] Glue and rust/app are not scanned for hard-coded recorded outputs or embedded runtimes

  • Where: src/lift.rs:843-864 (gate is run on unit crates only), src/gate.rs:1132 rust_checks = fmt, clippy, test, unsafe; ported_check reads src/port.rs only; nothing reads rust/app/src/units/*.rs except for the original::/stub text.
  • What happens: any literal table keyed by argv/stdin that returns the recorded stdout, kept in the glue (or in a helper module keep_helper_modules preserves), passes replay at 0% fallback, gate (the unit crate is clean), fmt, clippy, test and lift. The pitfalls file shows the unit-level gate has recorded-literal checks; the app-level glue has none. Cases are plain files in rust/app-cases/ so generating such a table is mechanical. I did not run this variant (A5a-01's run proves the same blind spot with a subprocess), hence PLAUSIBLE.
  • Fix: run the recorded-literal/hard-coded scan the unit gate uses on rust/app/src as well, and add held-out cases: lift generates 20-50 fresh traps from the saved inputs with a different seed, runs original and lifted binary, and compares (a differential check the table cannot know).

A5a-07 [H5][H2] [MEDIUM] [CONFIRMED] app record inherits the whole environment and writes secrets and host details into committed case files

  • Where: src/app.rs:186 (inherit_env: true), 487-507 (only env_clear when a hand-edited toml says inherit = false), no secret scan anywhere in app.rs/effects.rs/http.rs (grep: none), vs the unit recorder that fails on secret-like values (pitfall "A recording held a secret from the environment").
  • Failing scenario (reproduced, e5): API_TOKEN=sk-live-0123456789abcdef app record ... for a program that prints it: rust/app-cases/no-args.stdout contains the key; app replay with API_TOKEN=other fails the case. The same holds for HOME, USER, LANG, TZ, PATH: record and replay verdicts depend on the caller's shell; parallel cases (par_map, up to 8 threads, src/app.rs:667) also share $HOME, /tmp, ports and caches.
  • Fix: port the secret scan from the unit recorder (fail and delete the case files when a variable whose name matches the secret pattern appears in any output); record the env allow-list actually used (PATH, HOME set to the scratch dir, LANG=C.UTF-8, TZ=UTC, TMPDIR scratch) and env_clear by default for both record and replay, with --inherit-env NAME to add. Test: env API_TOKEN=... + print must fail record.

A5a-08 [H1] [MEDIUM] [CONFIRMED] Normalizers are applied to stable output and to the build's output, and are global

  • Where: src/app.rs:294-300 (apply), 1864 (record normalizes both runs even when equal), 2573-2574 (replay normalizes expected and actual).
  • Failing scenario (reproduced, e4): --normalize timestamps; original prints elapsed 00:00:05 on 2020-01-01 10:00 total 3 every time; recorded as elapsed [..] on [..] total 3; a port printing elapsed 23:59:59 on 1999-12-31 23:59 total 3 passes. Without the flag it fails. Custom --normalize n=\d+ hides every number in every case. Also applies to the names of written files.
  • Fix: normalize only where the two original runs actually differed (apply the regex, compare the two runs; if equal keep raw text), so stable values stay exact; or at least print, at record time, how many stable substrings each normalizer swallowed. Test: stable 00:00:05 must still be compared.

A5a-09 [H2][H6] [MEDIUM] [CONFIRMED] HTTPS never reaches the effect sink, although the docs say it is "recorded as CONNECT and refused"; the original may call the real network while recording

  • Where: src/effects.rs:382-409 (env() sets only RUST_ANYTHING_HTTP_SINK, HTTP_PROXY, http_proxy), src/effects.rs:780-786 (the CONNECT branch), docs/whole-apps.md:50-51. NO_PROXY, HTTPS_PROXY, ALL_PROXY of the caller are inherited. Replay is never sandboxed (app.rs:2796), record only with --sandbox (opt-in, main.rs:179), and --sandbox cannot be combined with --effects on Linux (process.rs:393-399).
  • Failing scenario (reproduced, e10): urllib POST to http://hooks.example.test/a is recorded (http POST http://hooks.example.test/a), the same POST to https://... produces an empty .effects and the real DNS lookup (failed URLError). On a machine with network the request goes out.
  • Fix: also set HTTPS_PROXY, https_proxy, ALL_PROXY, and clear NO_PROXY/no_proxy for the case, so every client either records CONNECT host:443 or fails closed. Test: an https POST in the effects test app must produce a https CONNECT effect line.

A5a-10 [H6] [MEDIUM] [CONFIRMED] Effects: a failing --db-dump is recorded as the expected database state; headers other than content-type, and binary bodies' content, are not compared; zero effects is never questioned

  • Where: src/effects.rs:437-448 ((db dump failed: exit status: 127) appended to the effects), src/effects.rs:741-746 (body_text: invalid UTF-8 -> (N bytes)), 825 (only content-type), 1013 (read_line on non-UTF-8 SMTP DATA returns 0 -> the message is dropped), SETTLE 2 s.
  • Failing scenario (reproduced, e6): --db-dump "sqlite3 app.db .dump" where sqlite3 is missing: record exits 0 with no warning, no-args.effects is db\n(db dump failed: exit status: 127)\n. A build with different database contents then passes this field on any machine where the dump fails the same way. Authorization, Accept, User-Agent headers of webhooks, and the content of a binary upload are never compared (documented as "method, URL, content type and body", but the docs do not say binary bodies compare by length only).
  • Fix: make a failed dump at record time an error (it is always a setup bug); at replay a failed dump is a failure of the case, not text. Compare a configurable header allow-list (default authorization presence, accept) and hash binary bodies. Warn at record time when --effects is on and no case produced an effect.

A5a-11 [H5][H6] [MEDIUM] [CONFIRMED by code] Recording degrades silently under load and with unstable originals; sandbox failures get baked into expectations

  • Where: src/app.rs:2298-2301 (timed-out cases are not written), 1729-1772 (drop_stale deletes a previously recorded case that now times out; tests/app_stale.rs:327 asserts that as desired), src/main.rs:1986-1994 (printed, exit 0), src/app.rs:1906-1910 (unstable cases are still written with the first run's status), src/app.rs:1994-2000 and 2801 (Killed is recorded as interrupted and then any signal matches), tests/sandbox.rs:207-209 (a sandboxed recording stores blocked as the expected output, replay is unsandboxed).
  • What happens: a loaded CI box with the default 30 s timeout drops the slow cases from the suite on app record and deletes the old ones, exit status 0; the next replay is smaller and greener. An original killed by the sandbox's CPU/memory limit is recorded as "killed by a signal", which a port that crashes (stack overflow, SIGABRT) also satisfies. Only two samples decide what is noise.
  • Fix: app record exits non-zero (or --strict default in CI/MCP) when any case timed out, was unstable, or a stale case was deleted because of a timeout; keep the old case on timeout. Record Killed cases with the signal number and compare it. Print the sandbox flag in the config and make replay warn when the recording was sandboxed and the build is not.

A5a-12 [H2] [MEDIUM] [CONFIRMED] The lifted cargo test (trycmd) is weaker than app replay, but the checklist says Pass

  • Where: src/lift.rs:380-410 (cases_test_rs), src/lift.rs:927-949 (the replay in CI item is Pass unless key-order, unordered, renamed, db-reset or HTTP), docs/whole-apps.md:105-108.
  • What happens: trycmd knows .toml/.stdin/.stdout/.stderr/.in/.out only. .effects, .removed, float_tolerance, float_files and regex normalizers are not applied; the sinks are not started.
  • Reproduced (e3): added example-003-div.effects ("http POST http://sink/never-sent") and example-003-div.removed (ghost.txt) next to a case; cargo test in rust/app still passes.
  • Fix: in the replay in CI item, Warn (with the list) whenever the config has effects, removed files, float tolerance/files or custom normalizers, and name the exact app replay --build command CI must run; or generate the test to call rust-anything app replay instead of trycmd.

A5a-13 [H6] [MEDIUM] [CONFIRMED by code] A lift can complete with checklist skip/warn for DECISIONS.md targets and assets

  • Where: src/lift.rs:567-632 (target_items: not installed -> Mark::Skip; only Fail blocks), src/lift.rs:644-691 (assets: Mark::Warn; regex only sees string-literal first arguments, not env!("CARGO_MANIFEST_DIR")-built paths).
  • What happens: lifted: true although a target the DECISIONS file requires was never built and a binary may read files from the original's folder through an absolute path.
  • Fix: refuse by default when a named target is skipped (--allow-unchecked-targets to override, audit entry), and fail assets when a compile-time path points inside the repository.

A5a-14 [H3] [MEDIUM] [PLAUSIBLE] analyze --whole-app shape/entry-point detection is regexes over source text, and the recommended answer is always "Yes"

  • Where: src/whole_app.rs:77 (SERVER matches \.listen\(, createServer\(, \bapp\.run\(, \$_GET\[, \blisten\(\s*\w+\s*,\s*\w+\s*\) anywhere, including comments and strings), 79-93 (ARGV, $argv, param( anywhere count as a CLI main), 364-370 (any server hit makes the whole app a "server"), 499-514 (decision D1 always recommends "Yes").
  • What happens: a CLI that embeds a small http.createServer for OAuth callback becomes a "server" and the agent is told to build an axum front door first; a library with a param( in a script is a "cli". Evidence (file:line) is printed, so it is checkable, but the "recommended answer" is not conditioned on anything. declared() (whole_app.rs:337) also returns an empty set when manifest discovery fails, which reads as "no dependencies".
  • Fix: strip comments/strings (the repo has lang::syntax helpers) before matching; require the shape to be backed by a manifest entry or a recorded case kind when app record exists; show the competing readings ("cli (bin) and server (listen in x.js:12): choose") instead of one. Print a note when discovery fails instead of silently reporting no dependencies.

A5a-15 [H5] [LOW] [PLAUSIBLE] Written-file detection uses length + mtime, not content

  • Where: src/app.rs:629-643 (FileStamp), 594-610.
  • What happens: a program that rewrites a pre-existing input file with the same length within the filesystem's timestamp granularity looks untouched, in record and in replay, so the change is not recorded and not compared. On this kernel (6.18, multigrain timestamps) I could not reproduce it (e7: 120 cases all detected); on older Linux (4 ms tick), HFS+ (1 s) or FAT (2 s) it can happen.
  • Fix: hash content instead of comparing mtime (files are small, cap at the existing 1 MiB rule).

A5a-16 [H1] [LOW] [CONFIRMED by code, disclosed on the console] Noise handling can swallow real differences

  • Where: src/app.rs:1072-1098 (merge_line: different token counts -> whole line [..]), 1117-1118 (different line counts -> ..., which also matches zero lines), 1850-1855.
  • What happens: two samples decide what is "noise". The console says "check these first" for Lines; Values noise on a stdout line that is mostly stable becomes [..] for the whole line.
  • Fix: record three or more runs when any noise is seen, and print the wildcard-ified expected text for the noisy cases in the record output (not only the case name).

A5a-17 [H1] [LOW] [PLAUSIBLE] Binary wire codec details (Go/Java bridges)

  • Where: src/wire.rs:425 (String::from_utf8_lossy for strings read from Go/Java: a Go string holding invalid UTF-8 reaches the port as U+FFFD), 817 (f as i64 saturates: a port returning 1e30 to an int slot becomes i64::MAX instead of a mismatch error), 518 and 549 (u32::try_from(n).unwrap_or(u32::MAX) writes a wrong length for >4 GiB values).
  • Impact is small (JSON recordings cannot hold invalid UTF-8; the pitfalls file already notes that such cases are dropped), but a port that returns an out-of-range number is not reported by diff.
  • Fix: write_value I64: error when f is outside i64 range; count: return an error instead of saturating.

A5a-18 [H5] [LOW] [WEAK] Front-door kill switch and replay environment

  • RUST_ANYTHING_UNIT_<NAME>=original in the caller's shell silently sends a unit back to the original (src/front_door.rs:614-632). It only raises the fallback rate, so it fails safe, but a developer who exports it and then runs lift sees "N cases still fall back" without being told why. Print the variable when replay/lift finds it set.

What app replay compares, and what is normalised or ignored (answer to the brief)

Aspect Compared how Normalised, ignored or lenient
Exit code exact Code(n); failed = any non-zero; interrupted = any signal (app.rs:2798-2803) a timeout is a mismatch; any signal matches any recorded signal
stdout, stderr text: trycmd matcher with [..] and ... (app.rs:990); binary (any non-UTF-8 in the recording): exact bytes trailing newline, \r\n, empty vs blank line (A5a-02); literal .../[..] (A5a-04); normalizer regexes applied to both sides (A5a-08); cwd path -> [CWD]
Written files each recorded file must exist and match (same matcher); paired by normalised name extra files, directories, symlinks, mode, anything outside cwd (A5a-03); a file rewritten with identical bytes
Removed files exact list, only when the original removed something the build removing more (A5a-03)
Effects (http/smtp/db) count, order and text of events, order-free when noisy (effects.rs) HTTPS (A5a-09), headers but content-type, binary content, a failing dump (A5a-10), effects after the process exits or after 2 s
Float tolerance relative tolerance on numbers in text lines applies to every number in the case
Skipped cases not counted (app.rs:3174) invisible on the console (A5a-05)
Fallback per case, from the log file the build appends to self-reported by the build (A5a-01)
State between cases fresh temp cwd per run, --fresh snapshot copied in environment, $HOME, /tmp, ports are shared (A5a-07)

Answers to the brief's other questions

  • Can a front door that falls back for hard cases report 100% replay while Rust does little? Yes by design when it reports it: 100% passed, fallback 100.0% is printed on one line each (main.rs:838-851), the report says Fallback rate: x% (n/N cases answered by the original), and lift blocks on f.cases > 0 (lift.rs:813-838). The rate is per case (a case that falls back after Rust read stdin counts once; run_with_stdin logs before spawning, front_door.rs:389-399), the denominator is all non-skipped recorded cases, a build that never creates the log prints Fallback rate: not reported by this build and lift treats None as a blocker. What it cannot see is anything that bypasses original:: (A5a-01) and what the corpus did not contain (production inputs outside the recorded cases still go to the original's clap-rejected path until the lift).
  • Is the lift check textual only? Yes for "the original is not needed"; the other checks (build without original.rs, gate on units, replay passes, fmt/clippy/test) are real but do not detect a subprocess, an interpreter or a path into the repository (A5a-01).
  • Can app wire / --no-check mark units wired without replay? --no-check and --skip-gate record the unit in the state and write the stub, but nothing marks it verified: the audit entry records skipped_gate, and lift re-runs gate on every unit and re-replays. Sound.
  • What if the recorded run itself failed or timed out? Timeouts: case dropped, exit 0 (A5a-11). Non-zero exit or a crash trace: recorded as the expectation (fail-safe, since a port will not print the same trace, but a broken environment yields a suite of tracebacks and a green original replay). Spawn failure of the run command: hard error. Unstable (exit code or files differ between the two runs): recorded anyway and listed.
  • Effect sinks: bodies or counts? Bodies (text) and counts and order for HTTP and SMTP; SMTP in parsed mode compares decoded parts (MIME framing ignored, by test), smtp-raw exact DATA. See A5a-09/10 for what is missed. app shadow drops effects entirely (documented, docs/whole-apps.md:242); tests/effects.rs:759-766 even asserts matched == 1 for a build that mails twice. I did not read app_shadow.rs.

Verification improvements for this area (ranked)

  1. Lift runs its replay with the original unreachable (A5a-01), plus a regression test with the subprocess glue. Single biggest gain; the test already exists in tests/app.rs:787 for fixtures.
  2. Exact-by-default comparison: newlines (A5a-02), unexpected files/removals (A5a-03), escaped literal wildcards (A5a-04). Each is a ten-line change plus a "port variant must fail" test.
  3. Case integrity: digests of case files in rust-anything.json; console shows skipped; lift refuses edited or skipped cases unless acknowledged and audited (A5a-05).
  4. Self-test corpus for replay itself: a table-driven test (tests/replay_mutations.rs) with one original and ~15 port mutants (no trailing newline, CRLF, extra file, extra delete, swapped stdout/stderr, different exit code, extra effect, literal ..., skipped case, edited case) asserting replay fails for each. Any new leniency then needs a deliberate test change.
  5. Record hygiene: secret scan and env allow-list (A5a-07), non-zero exit on timeout/unstable/ stale-by-timeout (A5a-11), failed --db-dump is an error and zero effects with --effects is a warning (A5a-10), HTTPS proxy variables (A5a-09).
  6. App-level cheat scan: run the unit gate's recorded-literal/shell-out checks on rust/app/src, dependency allow-list, and a held-out differential run in lift (A5a-06).
  7. Make the lift checklist truthful: measured text instead of "fallback rate 0", Warn for what trycmd cannot check (A5a-12), refuse on skipped targets (A5a-13).

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

  • Fallback accounting: run_with writes the log line before spawning the original, report_fallbacks creates the file so "0 fallbacks" is distinguishable from "not reported", declines through run_with_stdin count once per case, and replay --case computes the rate over the selected case.
  • lift blockers: no wired unit, glue still a stub (squashed whitespace check, so rustfmt wrapping does not hide it), original:: in the glue (text only, see A5a-01), front door not building, any failing case, fallback == None, fallback.cases > 0, gate failure per unit (bridge crates via full gate, hand-written via rust_checks + ported_check). A refused lift leaves the repository unchanged; the stage copy is kept for inspection.
  • wire: --skip-gate is recorded in the audit log; the kill switch only sends cases back to the original; a unit is never marked verified by --no-check.
  • Replay deadline handling: process-group kill covers descendants that keep pipes open (unit test replay_deadline_covers_descendants_that_keep_pipes_open); a timed-out build is a mismatch (Status::Timeout is never equal to a recorded code).
  • Text vs binary: a build that prints non-UTF-8 where UTF-8 was recorded fails (byte comparison); binary recordings are exact on both streams.
  • lines_match_in_any_order pairs lines by augmenting-path matching; the sorted-pair bug in the pitfalls file is not present, and the property tests in src/app.rs cover tolerance + wildcard.
  • Report determinism: stable_paths replaces the temp dir and per-run folder names; --redact path exists; case selection errors list the names.
  • app front-door never overwrites rust/app, rejects --port recordings, and builds with RUST_ANYTHING_REPO set so a symlinked rust/ finds the original (tests/app_fresh.rs).
  • Record/replay stale handling is careful: hand-written cases are kept and named, fs.base reads keep folders alive (tests/app_stale.rs), HTTP and CLI names do not clash.
  • Effects: rule matching, status validation, here-doc/redirect parsing of --db-reset/--db-dump scripts, \r\n normalization of dumps, saved responses replayed without the fixture file.