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.
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 liftdoes not prove the original is gone, and prints a claim it never measured. The check isglue_text.contains("original::")on the wired units' glue files plus a rebuild withoutoriginal.rs. A glue that runspython3 /abs/tcli.pywithstd::process::Commandgets "Fallback rate: 0.0% (0/68)" fromwire, passeslift, and the checklist linereplay ... 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 replayis 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-dumpis recorded as the expected database state, onlycontent-typeand text bodies are compared (A5a-09, A5a-10).app recordcopies 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*), andwirenever 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 toRUST_ANYTHING_FALLBACK_LOG.liftthen blocks on: (1) the glue file text containingoriginal::, (2) a non-generatedmain.rscontainingoriginal::, (3) failing build/gate/replay. It never looks forCommand::new, an interpreter crate (pyo3,rquickjs,deno_core,mlua...), a path into the original's folder, or areqwest-style proxy for HTTP apps that is kept under another module. After the checks pass, the checklist itemreplayis 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 returnsfallback: Noneand nothing is checked. - Failing scenario (reproduced,
e3): fixturetests/fixtures/cli/python;app record;app front-door; hand-written cratecheat-rs(oneidentityfn + test);app wire . cheat-rs --skip-gate --command copy ... --command tcli; gluerust/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). Thenapp lift .printed every linepass(fmt, clippy, test, replay in CI, assets) andLifted: ./rust/app is a pure Rust app. Renamingtcli.pyand 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:766else if !library && glue_text.contains("original::");lift.rs:1021literal"... fallback rate 0 (no fallback path left)";tests/app.rs:787-807does 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:
- Make
liftdo whattests/app.rs:787does: run the final replay with the original unreachable. Cheapest portable form:PATHreduced to the build's own directory plus system dirs without the interpreter (env_clear+PATH=/usr/bin:/binminusnode/python3/java/... found viawhichon the recordedrun[0]), and, where available, run it underprocess::Sandboxwith the repository path unreadable (bwrap--tmpfs <repo>/ sandbox-execdeny 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. - Replace the hard-coded
fallback rate 0text with what was measured, or drop the claim. - Add static signals as
Fail(not warn):std::process::Command/tokio::processinrust/app/srcand unit crates unless the recorded app itself spawns children (thenWarnlisting the call sites), absolute orCARGO_MANIFEST_DIR-relative paths into the repository,include_*!of the original's source files, and a dependency allow-list check onrust/app/Cargo.tomland the unit crates for embedded interpreters. - Mutation self-test (cheap, in
tests/app.rs): the cheat glue above must makeliftrefuse. Keep it as a regression test; it is 30 lines.
- Make
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 samecompare), unit testsrc/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\nand a\rat the end of every line;render_diffhas a "trailing newline" kind, butcompareonly calls it aftertext_matchesalready failed.lines("")andlines("\n")are both empty. - Failing scenario (reproduced,
e1,e2,e8): original printshello\nworld\n; builds printinghello\nworldandhello\r\nworld\r\nboth give1/1 cases passed. Original that prints nothing foremptyand a blank line forblank, port that swaps them: both pass. A writtenout.csvofa,b\n1,2\nvs port writinga,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 byapp recordnext to the normalizers). Default: compare bytes (after wildcard expansion). The wildcard matcher can work on\n-split lines that keep their\rand a flag for "ends with newline". Test: port variantsno-trailing-newline,crlf,empty-vs-blankof a three-line program must each failreplay; the existingmatching_follows_trycmdtest 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: onlyif let Some(expected) = &spec.removed),2878-2907(written: loops over the recorded files only),src/app.rs:2497and2025-2029(.out/and.removedexist 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.filesare ignored. When the original wrote nothing there is no.out/and no file check at all; when it removed nothing there is no.removedand 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:checkpassessandboxed = false,src/app.rs:2796). - Failing scenario (reproduced,
e1): original only prints; port prints the same and also writesevil.txtin the working directory and a file outside it:1/1 cases passed. - Fix: in
check, when the case has no.out/expectrun.filesempty (and no.removedexpect no removals); when it has one, reportunexpected file Xfor files not paired. Same for removed. Add a--no-unexpected-filesescape 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 inwrite_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 printsLoading\n...\nDone\npattern: src/[..]/x; port printsLoading\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 frommerge_noise, either escape it (choose an escape such as a private-use sentinel, and unescape on compare) or store the case withbinary = 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 leavetotal),src/main.rs:838-851(say_replaynever prints skipped),src/lift.rs:805-812(replay.passed != replay.total,skippedunused),docs/whole-apps.md:107("Read and edit them by hand"). - What happens: editing
statusto"skipped"(or deleting a case, or rewriting a.stdoutto match the port) changes the verdict.Skipped: 1appears only inreplay-report.md. Lift never checks.app driftwould catch an edited expectation (it replays the original), but nothing inreplayorliftruns 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 tostatus = "skipped": console2/2 cases passed, exit 0; report lineSkipped: 1. - Fix: (1) print
skipped Non the console and in--json, makeliftrefuse whileskipped > 0; (2) at record time write a SHA-256 of each case's files intorust-anything.json("digests": {"case": "..."});replayprintsN cases differ from their recording (edited by hand)andliftrefuses unless--accept-edited(which writes an audit entry); (3) haveliftrun the cheap half ofdrift(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:1132rust_checks= fmt, clippy, test, unsafe;ported_checkreadssrc/port.rsonly; nothing readsrust/app/src/units/*.rsexcept for theoriginal::/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_modulespreserves), 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 inrust/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/srcas well, and add held-out cases:liftgenerates 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(onlyenv_clearwhen a hand-edited toml saysinherit = false), no secret scan anywhere inapp.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.stdoutcontains the key;app replaywithAPI_TOKEN=otherfails the case. The same holds forHOME,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,HOMEset to the scratch dir,LANG=C.UTF-8,TZ=UTC,TMPDIRscratch) andenv_clearby default for both record and replay, with--inherit-env NAMEto 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 normalizesexpectedandactual). - Failing scenario (reproduced,
e4):--normalize timestamps; original printselapsed 00:00:05 on 2020-01-01 10:00 total 3every time; recorded aselapsed [..] on [..] total 3; a port printingelapsed 23:59:59 on 1999-12-31 23:59 total 3passes. 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:05must 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 onlyRUST_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_PROXYof the caller are inherited. Replay is never sandboxed (app.rs:2796), record only with--sandbox(opt-in,main.rs:179), and--sandboxcannot be combined with--effectson Linux (process.rs:393-399). - Failing scenario (reproduced,
e10):urllibPOST tohttp://hooks.example.test/ais recorded (http POST http://hooks.example.test/a), the same POST tohttps://...produces an empty.effectsand 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 clearNO_PROXY/no_proxyfor the case, so every client either recordsCONNECT host:443or fails closed. Test: an https POST in the effects test app must produce ahttps CONNECTeffect 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(onlycontent-type),1013(read_lineon non-UTF-8 SMTP DATA returns 0 -> the message is dropped),SETTLE2 s. - Failing scenario (reproduced,
e6):--db-dump "sqlite3 app.db .dump"wheresqlite3is missing:recordexits 0 with no warning,no-args.effectsisdb\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-Agentheaders 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
authorizationpresence,accept) and hash binary bodies. Warn at record time when--effectsis 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_staledeletes a previously recorded case that now times out;tests/app_stale.rs:327asserts 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-2000and2801(Killedis recorded asinterruptedand then any signal matches),tests/sandbox.rs:207-209(a sandboxed recording storesblockedas 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 recordand 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 recordexits non-zero (or--strictdefault 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. RecordKilledcases 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(thereplay in CIitem isPassunless key-order, unordered, renamed, db-reset or HTTP),docs/whole-apps.md:105-108. - What happens: trycmd knows
.toml/.stdin/.stdout/.stderr/.in/.outonly..effects,.removed,float_tolerance,float_filesand regex normalizers are not applied; the sinks are not started. - Reproduced (
e3): addedexample-003-div.effects("http POST http://sink/never-sent") andexample-003-div.removed(ghost.txt) next to a case;cargo testinrust/appstill passes. - Fix: in the
replay in CIitem,Warn(with the list) whenever the config has effects, removed files, float tolerance/files or custom normalizers, and name the exactapp replay --buildcommand CI must run; or generate the test to callrust-anything app replayinstead 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; onlyFailblocks),src/lift.rs:644-691(assets:Mark::Warn; regex only sees string-literal first arguments, notenv!("CARGO_MANIFEST_DIR")-built paths). - What happens:
lifted: truealthough 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-targetsto override, audit entry), and failassetswhen 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(SERVERmatches\.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.createServerfor OAuth callback becomes a "server" and the agent is told to build an axum front door first; a library with aparam(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::syntaxhelpers) before matching; require the shape to be backed by a manifest entry or a recorded case kind whenapp recordexists; 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;Valuesnoise 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_lossyfor strings read from Go/Java: a Go string holding invalid UTF-8 reaches the port as U+FFFD),817(f as i64saturates: a port returning1e30to anintslot becomesi64::MAXinstead of a mismatch error),518and549(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_valueI64: error whenfis outsidei64range;count: return an error instead of saturating.
A5a-18 [H5] [LOW] [WEAK] Front-door kill switch and replay environment
RUST_ANYTHING_UNIT_<NAME>=originalin 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 runsliftsees "N cases still fall back" without being told why. Print the variable whenreplay/liftfinds 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 saysFallback rate: x% (n/N cases answered by the original), andliftblocks onf.cases > 0(lift.rs:813-838). The rate is per case (a case that falls back after Rust read stdin counts once;run_with_stdinlogs before spawning,front_door.rs:389-399), the denominator is all non-skipped recorded cases, a build that never creates the log printsFallback rate: not reported by this buildandlifttreatsNoneas a blocker. What it cannot see is anything that bypassesoriginal::(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
liftcheck textual only? Yes for "the original is not needed"; the other checks (build withoutoriginal.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-checkmark units wired without replay?--no-checkand--skip-gaterecord the unit in the state and write the stub, but nothing marks it verified: the audit entry recordsskipped_gate, andliftre-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-rawexact DATA. See A5a-09/10 for what is missed.app shadowdrops effects entirely (documented,docs/whole-apps.md:242);tests/effects.rs:759-766even assertsmatched == 1for a build that mails twice. I did not readapp_shadow.rs.
Verification improvements for this area (ranked)
- 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:787for fixtures. - 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.
- Case integrity: digests of case files in
rust-anything.json; console showsskipped; lift refuses edited or skipped cases unless acknowledged and audited (A5a-05). - 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) assertingreplayfails for each. Any new leniency then needs a deliberate test change. - Record hygiene: secret scan and env allow-list (A5a-07), non-zero exit on timeout/unstable/
stale-by-timeout (A5a-11), failed
--db-dumpis an error and zero effects with--effectsis a warning (A5a-10), HTTPS proxy variables (A5a-09). - 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 inlift(A5a-06). - Make the lift checklist truthful: measured text instead of "fallback rate 0",
Warnfor 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_withwrites the log line before spawning the original,report_fallbackscreates the file so "0 fallbacks" is distinguishable from "not reported", declines throughrun_with_stdincount once per case, andreplay --casecomputes the rate over the selected case. liftblockers: 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 fullgate, hand-written viarust_checks+ported_check). A refused lift leaves the repository unchanged; the stage copy is kept for inspection.wire:--skip-gateis 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::Timeoutis 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_orderpairs lines by augmenting-path matching; the sorted-pair bug in the pitfalls file is not present, and the property tests insrc/app.rscover tolerance + wildcard.- Report determinism:
stable_pathsreplaces the temp dir and per-run folder names;--redactpath exists; case selection errors list the names. app front-doornever overwritesrust/app, rejects--portrecordings, and builds withRUST_ANYTHING_REPOset so a symlinkedrust/finds the original (tests/app_fresh.rs).- Record/replay stale handling is careful: hand-written cases are kept and named,
fs.basereads 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-dumpscripts,\r\nnormalization of dumps, saved responses replayed without the fixture file.