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.
Rust agent-skillsclaude-codeclicode-migrationcodexffigolangjavajavascriptmcpmigrationnapiperformanceportingpyo3pythonrewriterubyrusttypescript
Decisions
Choices made so far, with reasons. Each one can be revisited.
Product
| # | Decision | Reason |
|---|---|---|
| D1 | A toolkit your agent drives, not a translator that calls a model itself. | No model cost or vendor lock-in; works with any agent. The checks are the part an agent cannot do reliably. Same shape as REA. |
| D2 | TypeScript/JavaScript first. | No existing tool covers TS/JS to Rust. C/C++ and Python are crowded (DARPA TRACTOR, C2Rust, Depyler). |
| D3 | Core plus one plugin per source language: src/ts/, then src/lang/{python,c,go,ruby,java}.rs on tree-sitter. |
The plan, ordering, scoring and report are the same for every language; parsers, bridges and risks are not. |
| D4 | Written in Rust, parsing with oxc. | Fast (x18n, 27k lines, in about 0.1 s), and the tool uses the language it moves people to. |
| D5 | Shadow mode for every language. | Cloudflare FL2 ran old and new side by side in one process and moved traffic gradually. Tests prove a port; production traffic confirms it. |
| D6 | Name rust-anything (was carcinize). Java packages use rustanything, identifiers rust_anything/RustAnything, environment variables RUST_ANYTHING_*. |
Says what it does. The Rust trademark policy allows "Rust" in crate and repository names that refer to the language, as long as nothing looks official; the README says so. |
analyze
| # | Decision | Reason |
|---|---|---|
| A1 | A unit is a folder, or a file directly in a package's source root. | Folders are how most codebases mark modules; root files are usually standalone. |
| A2 | Skip node_modules, dist, build, out, target, coverage, fixtures, __fixtures__, __snapshots__, playground, examples, tool configs and .d.ts. |
Not product code; fixtures hold sample projects that would distort the plan. |
| A3 | .tsx, .jsx, .vue, .svelte, .astro, and code importing Vue/React/Svelte/Nuxt or vscode, is kept in JS. |
The prompt asked to flag UI-heavy parts; editor extension hosts make native modules painful. Their scripts are still parsed for imports. |
| A4 | Bridge: napi-rs when the unit or anything it imports needs Node, or its package's src/ does; wasm-bindgen otherwise. |
Portable code must keep running in browsers; Node-only code gets the faster native bridge. Build scripts next to src/ do not make a package Node-only. |
| A5 | Waves come from strongly connected components of the unit graph. | Leaves first means a Rust unit never calls back into JS; cycles must move together. |
| A6 | Risks are heuristics: method names like slice also match arrays. |
False positives cost a look; false negatives cost silent bugs. Each risk lists its first lines so a human or agent can check quickly. |
| A7 | Readiness = 100 - weighted risks (log of count) - size - fan-in - dependency penalties + test bonus. | Log keeps big files from drowning in counts; fan-in pushes widely-used units later, where a mistake costs more. |
| A8 | Priority = half readiness, half value (loops and string work per line, tests, size between 80 and 600 lines). | Readiness alone picks trivial declaration files. A first port should be safe and worth the bridge. |
| A9 | The library-to-crate table (src/crates.toml, every language) is hand-curated; unknown packages are reported as unknown, never guessed. |
The prompt: flag missing equivalents instead of hand-rolling silently. |
| A10 | JSON output carries schema: rust-anything/analyze@1. |
Agents read it; it is a wire contract and gets versioned. |
| A11 | laravel/framework maps to laravel-rust with fit partial, and --whole-app on a Laravel app proposes Laravel Rust over plain axum; the other PHP web frameworks stay axum with fit none. |
Laravel Rust (beta since December 2026) keeps the app's routes, models, jobs and mail in Laravel's shape, so the plan names a destination instead of "no Rust equivalent". It is 0.x, hence partial and an exact version pin. The other frameworks have no such counterpart. |
The loop
| # | Decision | Reason |
|---|---|---|
| L1 | bridge splits lib.rs (bindings) from port.rs (plain Rust, #![forbid(unsafe_code)]). |
Binding macros expand to unsafe code; the port itself never needs it, and it stays testable without a JS runtime. |
| L2 | bridge refuses to write into a non-empty folder, and refuses blocked/keep units without --force. |
A port in progress is the user's work; the plan's verdicts should not be bypassed by accident. |
| L3 | napi bindings catch panics and throw JS errors. | A panic unwinding into Node aborts the process; in shadow mode that would take the app down. |
| L4 | TS types map to String, f64, bool, Vec, Option; anything structured crosses as JSON. |
Faithful to JS (numbers are f64) and always compiles; the port can introduce real types behind the binding. |
| L5 | record generates deterministic inputs from parameter types, with edge-case corpora, and derives one string argument from another half the time. |
Reproducible recordings; search-like functions rarely hit on unrelated random strings. |
| L6 | Recording and diffing run in Node through generated scripts, with a lossless codec (undefined, NaN, -0, BigInt, Map/Set, key order, lone surrogates). |
The comparison sees exactly what a JS caller sees. Lone surrogates were found by the fixture tests: JS slice can split emoji. |
| L7 | A throw must be of the recorded error's type (TS/JS class name, Python exception class); messages are not compared unless the unit is recorded with record --messages, and a Rust panic never matches a recorded error. |
Error text is rarely a contract and would make every port fail on wording, but "any throw matches any throw" let a stub that always throws pass every error case. Recordings made before the type was saved still pass, with a counted note. Where the message is the contract, --messages is a property of the unit, so it is saved with the recording and diff and gate follow it; without it the verdict says how many recorded errors were checked by class only (#1073). |
| L8 | wasm builds use cargo + wasm-bindgen-cli (version-checked), not wasm-pack. |
wasm-pack downloads tools at run time, which fails offline and in locked-down CI. |
| L9 | Shadow mode returns the original's result, runs Rust second, and never lets Rust errors reach callers. | Shipping shadow code must not change behavior; only the report sees Rust. |
| L10 | The MCP server is a small hand-written JSON-RPC loop on serde_json. | The stdio transport needs four methods; an SDK would add churn for no gain. |
| L11 | go composes profile, bridge, record, diff, gate and enable; it picks the outermost portable exported function that takes arguments, and bridges that one function alone. |
One crossing per run instead of one per item, and a crate small enough to compile in seconds. A function without arguments (main) has nothing to record. |
| L12 | enable rebinds functions with a marked block in the original file, not by editing imports. |
Every caller switches at once, in any number of files, and removing the block restores the file byte for byte. Plain function declarations only: a const arrow cannot be rebound. |
| L13 | One shared cargo target folder, with each package name owned by one crate folder. | Dependencies compile once; ownership keeps two same-named crates from replacing each other's library (pitfalls). Front doors stay apart: every app binary has the same name. |
| L14 | gate fails a port that writes three or more recorded values the original never spells out, mentions the recording files, has fewer tests or assertions than at the last passing gate, or runs on a cases.jsonl whose recorded lines changed. One or two such literals only get named, and // recorded-literal: <reason> lets a library constant stay. |
Agents told to make every case pass sometimes hard-code results, delete failing tests or edit the recording; diff alone cannot tell. A port legitimately repeats a few values (a library constant, a fixed message), so a single hit must not fail, and the escape needs a reason someone can read. |
| L15 | Port rules live in rust/RULES.md in the repository, one bullet each, added with rules --add and put in every prompt rust-anything writes (go's TASK.md, the MCP prompts). |
A correction the user makes once must reach the next unit and the next agent. A committed Markdown file is readable, reviewable and editable by hand, and needs no agent-specific memory. |
| L16 | A check that cannot run fails; it never reads as nothing to check. A missing recorded-from.json, a dropped case, a recording that shrank, a fuzz run whose inputs could not be recorded: each is an error with the command that fixes it. |
A stale-recording check that returned None when its file was gone let rm recorded-from.json switch off two checks. |
| L17 | Anything that loosens a verdict (tolerance, key order, known differences, dropped inputs, a smaller recording, --force) takes an explicit flag, is bounded where it can be, and is printed on the first line of the verdict. |
Each of these turned failures into matches with no trace in the output an agent reads. |
| L18 | selftest plants wrong ports against a small built-in original (TS/JS and Python) and requires the check meant to refuse each to do so. Behavior that is documented as not caught is a known-gap row: listed with its reason, with the mitigation the docs name checked (fuzz finds the difference, gate says a recording marked legacy_recording was not verified), and it fails the run only under --strict. A catch by a different check than the expected one is unexpected, which fails. |
A catch is only worth something at the level where the refusal is claimed: a table of recorded results has to fail literals, not a build. Failing the default run on every limit the docs already name would make CI red for ever and teach people to ignore it; a gap that closes or a catch that is lost must still be noticed, which is what unexpected and tests/selftest.rs do. Rows that were open holes, not limits, were fixed in gate instead. |
| L19 | gate's spawns check fails a port whose own Rust starts another program, unless the line is marked // SPAWNS: <why> and the original's source starts processes too. It matches patterns in the port's code (comments, strings and #[cfg(test)] left out), not what a dependency does. |
The cheapest cheat that passes every recorded case is to run the original for each answer, and diff cannot see it. Ports of code that really runs programs exist, so the check has a way out, but a mark next to an original that starts nothing would be a free pass, so it is ignored there. A crate that starts the process for the port, or a library loaded by name, stays unseen: pattern matching is a guard against the lazy cheat, not a sandbox. |
| L20 | Child stdout/stderr capture is shutdown-aware on Unix: the pipe is put in non-blocking mode and polled with a self-pipe written on shutdown, through rustix. Windows keeps the blocking read loop, so a reader blocked there is let go only at its next read. The crate keeps forbid(unsafe_code). |
A blocking read cannot observe an atomic stop flag while a silent descendant holds the pipe open, so every cancelled MCP call could leak its reader thread and pipe. Waking it on Windows takes overlapped I/O through Win32, which needs unsafe; a reader left blocked there costs a thread, not a wrong verdict, since the command deadline still bounds the run. |
| L21 | gate's size check (3x the original's lines plus 50) can be raised for one unit by a [[size]] entry in rust/obligations-decisions.toml (adr, date, reason, unit, max), read with the same strict reader as waive: its ADR must be titled once in rust/DECISIONS.md and name the unit between backticks, and max must be above 3. A pass on it puts the ADR and the reason in the detail and a note above the checks; a port over max times the original's lines plus 50 still fails. No command writes it, and the skill and TASK.md forbid the porting agent to. |
Some originals lean on a library no crate reproduces (BeautifulSoup(html, "html.parser") needs html.parser and bs4's tree builder rebuilt to give the same tree on malformed HTML), and TASK.md allows no new dependency, so the cap could only be met by dropping behavior (#1189). A lasting property of the unit belongs in a reviewed decision with its reason, not in a flag go would have to repeat, and max keeps it bounded. |
Learned from porting x18n's core
| # | Decision | Reason |
|---|---|---|
| X1 | bridge keeps exports in TS when their types hold functions (followed through imports, re-exports and extends), when they are generic, iterators, RegExp, or use instanceof; --keep adds more by hand. |
26 of x18n core's 55 exports are of this kind; ported, they would have changed the public API or broken silently. |
| X2 | Structured values cross with markers for undefined, NaN/Infinity/-0 and lone surrogates; the loader pads omitted structured arguments with undefined. |
Each one produced real mismatches: splitKey's namespace: undefined, toWireRange with NaN, diffText splitting an emoji, isOutdated(change) with one argument. |
| X3 | Overload signatures (no body) are skipped; type predicates map to bool; aliases resolve through imports; untyped defaults take the default's type. |
definePlugin was listed twice; isMessageLeaf returned JSON; KeyString became JSON instead of String. |
| X4 | record installs a resolve hook, takes --resolve-from, and retries with --experimental-transform-types. |
x18n's sources import without extensions, need valibot and nostics, and use parameter properties. |
| X5 | bench is a separate step, not part of gate. |
Speed is not correctness, but it decides whether a port should ship: every x18n core port was correct and slower. |
| X6 | Risk guidance names shift_remove and UTF-16 string ordering. |
serde_json::Map::remove reorders keys under preserve_order; JS < on strings compares UTF-16 units. |
More languages
| # | Decision | Reason |
|---|---|---|
| M1 | Every language maps its types into the TS-like dialect (string, number, int, T[], Record<string, T>, T | undefined). |
The planner, input generator and port stubs stay one implementation; a language plugin only discovers, scans, resolves and lists exports. |
| M2 | Python uses PyO3 (abi3), C a plain C ABI, and Go, Ruby and Java one JSON dispatcher (rust_anything_call, or one JNI method) behind a generated wrapper with the original API. |
PyO3 and the C ABI are each language's native extension path. For the other three, one dispatcher keeps the Rust side identical, and the generated wrapper keeps callers unchanged. |
| M3 | diff goes through the same wrapper callers will use (cgo package, Fiddle file, JNI classes, PyO3 package). |
The test must see what callers see: wrapper bugs, type conversions and exception mapping included. |
| M4 | Record and diff run in the source language's own runtime, with generated drivers; nothing is written into the original repository (Go builds its driver as a separate module with replace). |
The original must run exactly as it does for its callers, and rust-anything must not edit code it is migrating. |
| M5 | C records each case in a forked child; a crash is recorded as crash: <signal> and accepts any port behavior. |
Inputs outside a C function's contract are undefined behavior: real glibc segfaults on isalpha(INT_MAX). |
| M6 | C strings arrive in the port as Option<&[u8]>; pointer parameters other than const char *, pointer returns, structs and variadics stay in C. All unsafe is in the generated lib.rs, each with a // SAFETY: comment. |
Ownership of buffers and structs has to be designed, not guessed; the port itself stays #![forbid(unsafe_code)]. |
| M7 | Errors compare by exception type (Python, Ruby, Java), Go error values by message, Go panics by being panics. A port signals one with Err("TypeName: message"). |
Messages are rarely a contract, except Go's error strings, which callers often compare. |
| M8 | Unannotated parameters used as numbers become number (Python, Ruby); Python recording passes integral numbers as ints in every fourth case. |
colorsys got 1,709 garbage cases out of 1,800 without inference, and its int results were never recorded without ints. |
| M9 | serde_json runs with float_roundtrip in rust-anything and in every generated crate. |
The default parser can be one ULP off; Java's Double.toString exposed it in 43 cases. |
| M10 | Shadow per language: a Go package, a Ruby file that prepends, <Class>Shadow Java classes, a C file with -D renames and a shadow crate feature. |
Each is the least invasive drop-in that language allows. |
| M11 | PowerShell crosses through the JSON dispatcher: a generated ps/<crate>.ps1 redeclares each exported function with the original param() block (attributes included) and calls rust_anything_call through P/Invoke methods that System.Reflection.Emit declares when the file loads. enable dot-sources that file after the module's last function. |
Works the same on Windows, macOS and Linux with only pwsh installed: Add-Type would compile C# on every load (350 ms warm, about 4 s cold on an M4), and a binary module would need the .NET SDK to build. Reusing the param() block keeps parameter binding, coercion and validation errors in PowerShell, identical for both sides. Dot-sourcing redefines the functions in the module's own scope, so its internal callers get Rust too, without touching Export-ModuleMember. |
| M12 | A PowerShell result is what $r = f ... holds: no output is $null, one object is that object, several are an array. The port returns that value; the wrapper writes it back so a caller sees the same (, $v for an array of fewer than two items). Write-Host, warnings and non-terminating errors are recorded as output. |
PowerShell functions output a stream, not a return value, and unroll arrays on the way out; the assigned value is what callers use, and it is the only shape both sides can reproduce exactly. |
| M13 | Swift crosses through the JSON dispatcher: a generated swift/<Crate>.swift redeclares each top-level function from its declaration text (labels, defaults, throws, visibility) and calls rust_anything_call through a generated Clang module (swift/<Crate>Native/module.modulemap). Both the wrapper and the driver carry their own fileprivate JSON codec. |
A module map is how Swift calls C on every platform without a bridging header, and SwiftPM takes it as a system-library target. Keeping the declaration text means callers compile unchanged; a fileprivate codec lets the wrapper, the driver and several wrappers share one module without clashing. |
| M14 | A Swift case that stops the program (overflow, ! on nil, an index out of range) is recorded as "error_type": "trap", and only a trap matches it. Swift crates build with overflow-checks = true in release, and the wrapper turns a Rust panic into fatalError. Thrown errors compare by type name and String(describing:). |
Unlike a C crash (M5), a Swift trap is defined behavior that callers rely on: arithmetic that overflows must stop in the port too. With overflow checks the obvious a + b port matches, and a wrapping_add port fails. An error enum's description names its case and payload, so comparing it catches a port that throws the wrong case. |
Speed
| # | Decision | Reason |
|---|---|---|
| S1 | No JSON text on the hot path: Python converts objects in Rust (pyconv.rs), Ruby is a magnus extension, Java and Go get typed JNI and cgo functions for numbers, booleans and strings; JSON remains the fallback for other types in Java and Go. |
JSON cost 10-50x the work: the colorsys port took 11.7 µs per call, CPython 0.5 µs. |
| S2 | Ports of untyped Python can use pynum::Num, Python's int-or-float, instead of serde_json::Value. |
A Value per number cost about 600 ns per call in colorsys; Num keeps ints as ints at native speed. |
| S3 | bench decodes arguments once and times only the calls, in the original's process; C benchmarks link the original (renamed with -D) and the port into one C program. |
Decoding per call, or calling through ctypes, hid the difference being measured. |
| S5 | Go and Java: types beyond numbers, booleans and strings (lists, arrays, maps, structs, boxed and optional values, several results) cross as a compact binary wire, with encoders and decoders generated per type on both sides; the JSON dispatcher is only the fallback for types the wire cannot express. | encoding/json and the Java JSON codec cost 5-8 µs per call; the wire costs 0.4-1 µs, and a Java List<String> function became faster than Java. |
| S6 | Java ports report errors through a per-thread String[2] slot passed with each call; the generated Java throws the exception (constructors cached as method handles). Native code throws only for null arguments. |
An exception raised from JNI costs about 1.5 µs more than one thrown in Java: the JVM unwinds the calling compiled frame on a slow path. A throwing parseRadix went from 3.0 to 1.8 µs; calls that succeed cost the same. |
| S7 | TS (napi-rs and wasm-bindgen): synchronous functions with structured arguments or results get generated JS encoders and decoders over two buffers registered once (napi) or wasm memory (wasm). Objects travel by field index in the caller's key order, strings as UTF-16, unmodeled types as tagged values. Arguments of another shape, and port results that do not fit the TS type, send that call through JSON. | napi's own object conversion is 2-3x slower than JSON (one napi call per property); a hand-written wire prototype was 6-7x faster. Across the nine x18n core units the bridge cost fell by a third on average and buildTree became 2x faster than TS; the other leaf functions stay slower than V8's JIT. |
| S8 | profile runs a real workload under the language's own profiler (node --cpu-prof, cProfile) and ranks the repository's functions by inclusive time, with callers and the argument that varies per call. |
Which code to port is a property of how it is called, not of the code: x18n's fuzzyScore is a leaf (slower in Rust per call) but a quarter of a search, called 50,000 times by one loop. |
| S9 | Batch classes (--batch fn:param): the items cross once, then run maps the function over all of them and rank returns the indexes of results above a minimum, best first (stable, like JS sort). Items and results are scalars or strings; numbers come back as typed arrays. |
Research and a prototype agreed: the gains come from keeping data on the Rust side and using all cores, not from faster crossings. Indexes, not strings, cross back: the caller already holds the items. |
| S10 | A <Function>Index struct in port.rs (new(items), run(fixed args)) replaces the default per-item loop; every crate with batches depends on rayon, wasm included, where it runs on one thread. |
Preparing items once (lowercasing, masks) was the second 4x on x18n search; one port.rs then builds for napi and wasm. |
| S11 | Batches in every bridged language: magnus classes in the original Ruby module (the original's defaults and keywords kept), a Go type over a Rust handle (New…, Run, Rank, Close, a finalizer), and a Java AutoCloseable class freed by close or a Cleaner. Go strings cross packed in one buffer. |
Keeping the items in Rust is the point of a batch. The 3-4x Go and Java gains first measured were withdrawn (the Java original was faster under JMH; the Go row has not been re-measured): bench decides per workload. |
| S12 | Crates with batches use mimalloc as Rust's global allocator (not wasm). bridge --allocator rusty_alloc picks rusty_alloc, a pure-Rust allocator, instead (wasm crates too). The choice is kept in rust-anything.json. |
Ports allocate per item, and the system allocator serialized the threads: 1.6x on 4 cores in pure Rust, slower than one thread inside a Go process; 3.2x with mimalloc. Only Rust code uses that heap: every buffer that crosses is copied or freed by Rust. rusty_alloc is an option, not the default: the allocator lands in every generated crate, and mimalloc has years of production use behind it. Measurements by its maintainer are in #96 and #112. |
| S13 | profile per runtime: node --cpu-prof, cProfile, go test -cpuprofile read through go tool pprof -raw (inlined frames kept), JFR execution samples (jfr print --stack-depth 256), and for Ruby a TracePoint call tracer loaded through RUBYOPT. Sampled stacks share one aggregator; the batch parameter is found from each language's loop forms. |
Each is the profiler that ships with the runtime; Ruby has none built in that samples, and stackprof is a gem the repository may not have. |
| S14 | String results go back in bulk: Go allocates one buffer of the results' total size and Rust copies into it on all cores (Go reads it with unsafe.String, one slice per result); Java gets one char[] of UTF-16 encoded on all cores, plus the lengths, and slices it with new String(chars, at, len). Typed JNI strings cross as UTF-16 (GetStringRegion, NewString), not modified UTF-8. |
Joining and freeing results on one thread, a second copy in Go, and one JNI call per Java string cost as much as the work: Java's batch went from 25 to 14 ms, its per-call port from 90 to 63 ms. |
| S15 | An index in port.rs may define its own rank(<fixed>, min); the generated rank of every language then calls it instead of ranking run's results. |
Ranking can be cheaper than scoring everything: x18n's index narrows to the last query's matches and reads one-letter queries from a table, 0.8 to 0.5 ms per query, 1.7x to 11.5x on wasm. |
| S16 | setup writes each agent's own config (~/.claude.json, ~/.codex/config.toml, ~/.cursor/mcp.json, ~/.gemini/settings.json, ~/.config/opencode/opencode.json) and skills folder, adding only the rust-anything entries, keeping key order, writing through a temporary file, and refusing files that do not parse. The command is the running executable's absolute path. OpenCode reads mcp.servers and takes the whole argv in command, so its entry is an array and a server left disabled is turned back on. |
One command to try it in any agent is what most people need first; a tool that rewrites someone's settings must never lose them. |
| S4 | bench ends with a verdict: ship, keep the slower functions, port a bigger unit, or (for C) optimize the port. Faster is 1.1x or more, slower under 0.9x. |
Numbers alone left the decision to the reader; Go and Java leaf functions cannot win per call, and the tool should say so. |
obligations
| # | Decision | Reason |
|---|---|---|
| O1 | The ledger of what the original offers is built into rust-anything (obligations, rust/OBLIGATIONS.json), from the source alone. |
A port must not skip a feature silently, and a check that needs another tool installed is a check that gets skipped. |
| O2 | Six families: exports, commands, flags, routes, environment variables, error paths. Positional arguments are flags. | These are what a caller, a user at a terminal, a client or an operator can depend on. |
| O3 | Only export can be complete. command, flag, route and env are at best enumerated (items found, no site) or none-found, and say that this proves nothing about the rest; a person attests them before lift (O27). error-path is never complete. |
Five independent reviews each found declarations the detectors did not see (16 in the fifth). Ways of declaring a route or reading the environment are open-ended, so a detector's silence is not evidence of absence, and the tool does not certify what it cannot prove. |
| O4 | Fail closed: what exists but cannot be named (computed name, unread file, library the detector does not read) is an unresolved site on the families it may hide, and the family is partial or unknown. In a detector, every use of a tracked object that no recognised form consumes is a site. |
The misses all came from _ => {} branches and early returns: the default has to be a site, not silence. |
| O5 | No false obligation. A route under a literal mount prefix set in the same file is listed with the composed path, joined as the framework joins it (GET /api/users; fastify composes its plugin prefixes first, then joins the route once). A prefix that cannot be read (computed, set in another file), mounts that form a cycle, and a fastify join that fastify 4 and 5 resolve differently are sites, and the route keeps its relative path with relative to a mount prefix that was not read in detail; nothing is recomposed by guessing. |
A wrong path sends the port after something the original never served. The sixth review found the relative path listed even where the prefix was on the next line; a later one found GET /v1 where fastify serves /v1/. |
| O5b | A route-shaped call on an object whose origin is not known (a function parameter) is a route only if something after the path can be a handler; it is then listed with receiver of unknown origin in detail, and the file gets one route site. |
module.exports = (app) => { app.get(...) } is how most applications split their routes, so it must stay named; sftp.get('/remote', '/tmp') in the same file must not become a route, and the doubt has to be visible. |
| O6 | Identifiers are per file (route:<file>#<METHOD path>, flag:<file>#<scope>/<flag>), except env:<NAME>, which is global; duplicates get ~2. Scope is per file: a program or app extended in another file is named where it is extended and is a site on both sides. |
Stable across runs and edits elsewhere; an environment variable is one thing wherever it is read. |
| O7 | A language without a surface detector is unknown for commands, flags, routes and env, never none-found. TS/JS and Python have detectors; the others list exports and error paths. |
Absence of a reader is not absence of surface. |
| O8 | An imported package the detector neither reads nor knows to be inert is a site on the surface families. A package is inert only if it declares no command, flag or route and does not read the environment on the application's behalf. | An unknown package may be an argument parser or a web framework. Database drivers that read PGHOST are not inert. |
| O9 | A dependency's own surface (FORCE_COLOR, NO_COLOR, proxy variables, NODE_ENV read inside a library, PATH used to find a program) is out of scope, as are a library's implicit flags (--help, shell completion) unless the application names them. |
The ledger lists what the application declares; listing every variable every dependency reads would bury it. Costs: a CLI whose output depends on FORCE_COLOR is not flagged. |
| O10 | Variables expanded by a shell command the application runs (execSync('pg_dump "$DATABASE_URL"'), os.path.expandvars) are env obligations; code evaluated from a string is a site on every surface family. |
The first is a read of the environment written in another language; the second can declare anything. |
| O11 | Files the discovery skips by name but that run (next.config.js) are read for surface only: their environment reads are obligations, their exports and throws are not. Hidden files are not walked. |
A tool's configuration is not a function of the application, but process.env.BASE_PATH in it changes what the application serves. |
| O12 | The closure follows literal imports from inventoried files; an import that cannot be followed is a site on every family. Frameworks that route by file layout (Next, Nuxt, SvelteKit) are a site, not a list. | What an imported file declares belongs to the original; file-based routes are not in the code. |
| O13 | The computation runs on a thread whose stack follows the largest file; upstream analyze still overflows on extreme nesting (exit 134), before the ledger starts. |
The detectors recurse on the syntax tree; nothing is written unless the whole ledger was built. |
| O14 | JSON output carries schema: rust-anything/obligations@1. |
Same reason as A10. |
| O15 | Python entry points are read from the manifests (setup.py, setup.cfg, pyproject.toml: scripts, console_scripts) and from extensionless files with a python shebang; a script is read for its surface, and a target that is missing, not Python or computed is a site on commands, flags and env. |
A CLI installed by scripts=["bin/tool"] is the application's front door, and the walk by extension never saw it. |
| O16 | The ledger's detectors open nothing outside the repository they analyse (the shared package discovery is under Known limits). A path written in a manifest is judged as written, before any disk access (absolute, or climbing out with ..: a site); a source file or a manifest whose links resolve outside the root is not opened and is a site. A link that stays inside the repository is read. |
setup(scripts=["/usr/bin/x"]) and a link to a file elsewhere made the flags of a program on the machine obligations of the project. |
| O17 | obligations --evidence links each obligation to the recorded cases that exercise it, from recorded files alone (nothing runs): matched by a rule, declared by a person, or uncovered with a note and a candidate input. --write stores it in rust/OBLIGATIONS.evidence.json (schema rust-anything/evidence@1), and app record ends with the obligations that have no case. --evidence itself refuses nothing and exits 0 with obligations uncovered; --check and app lift are what refuse (O25). |
An obligation no recorded case exercises is a feature diff cannot see missing from the port. |
| O18 | A link is made only when the rule can show that the case reached the obligation; in doubt the entry is uncovered, with the case and the reason in its note. What competes for a case is judged broadly, what links is judged strictly, and two obligations that share a name are never told apart. |
The dangerous direction is a false "covered", since lift will be let through on it. An uncovered too many costs one binding. |
| O19 | A CLI case is read, and only then credits a command, a flag or a variable it sets, when all four hold: it records exit code 0; it has no help or version spelling (--help, -h, --version, -V), even a declared one; every option before -- is a declared spelling for its command; and, when commands are declared, its first argument is a declared command or alias, followed by a declared subcommand when it has any. One function decides (read_case), refusal first. Positionals are never linked, and a token that follows an option is not counted as a flag. A case is not read either when an option is written after a plain word while the command declares a positional that takes the rest of the line (nargs=argparse.REMAINDER, "...", or a nargs that is not read), or after an option declared that way: the parser hands those tokens to the positional or the option, not to the flag. In Python, a case that names a command does not credit an option declared outside every command when the command belongs to another file or declares the same spelling itself: argparse, click and typer hand an option written after the command to the subcommand. |
Three fixes that listed forms were each beaten by the next form (-h, then a declared --version, then -fh and argparse's --hel), and cases argparse rejected with exit 2 passed their arguments without running anything. The exit code is to a CLI what 2xx is to a route (O20). Counting such cases and documenting it was rejected: a port that ignores a flag would pass. |
| O20 | A route is linked by a request answered 2xx that fits it strictly (method, case, trailing slash, segment by segment) and fits no other route broadly (case and trailing slash ignored; relative, wildcard and unreadable routes count as competitors). A route with a parameter is not linked while a route site is unread. env:PORT is linked by the HTTP cases when the http configuration gives the port neither as http.port nor as {port} in run. |
A 404 proves no route, express ignores case and the trailing slash by default, and a route the ledger did not read may be the one that answered. |
| O21 | An error path is linked when a recorded error's message equals the single plain literal thrown and, where the case records a type, the type equals the thrown one. Never because some error was recorded, never between two throws of the same type and text, never for a literal with an escape. | The recorded error can come from a callee; equality on type and text is the least that points at one throw. |
| O22 | An export is linked through its bridge manifest and the unit's cases.jsonl: a function by its calls, a method only when the recorded results align with the calls, a constructor never on its own, and what the bridge keeps in the original never. A case without a result is not a call. |
The manifest is what says which file a recorded case belongs to; a kept export has no Rust side for diff to compare. |
| O23 | rust/obligations-bindings.toml ([[bind]] with obligation, cases, reason) states what no rule can show and gives declared; it may name a case the rules do not read (a non-zero exit). Any fault in the file (unknown id or case, skipped case, empty reason, unknown key, duplicate) is an error naming all of them, and nothing in it is applied. |
A behaviour that exists only as an error, or a form the rules refuse, needs a way out that leaves a reason behind; a half-applied file would hide the fault. |
| O24 | Evidence opens the header of recorded case files, the app configuration, bridge manifests, cases.jsonl and the bindings file, and nothing else; each is resolved under the repository before it is opened or listed, and what is refused is listed under "Not read". |
Reusing the full case loader opened .stdin, .body and fs.base files it did not need, some outside the repository through a linked folder, and blocked on a FIFO. |
| O25 | app lift refuses while the obligations' standing blocks, and obligations --check prints the same standing and exits 1 (schema rust-anything/standing@1 with --json). Three things block: an obligation that is uncovered and not waived; a family that is not complete and that nobody attested, or whose attestation no longer matches (all six families, no exception); an expected text of a recorded case that holds a ... line nobody reviewed (O29). A fourth was added with the fallback journal (O36). A standing that cannot be computed (an invalid decisions or bindings file) is a blocker too, not a pass. lift prints at most one line per group, ending with the command that unblocks it. |
The point of the ledger: a feature the port never met must stop the step that removes the original. A check that errors and lets lift through would be the hole. |
| O26 | The only ways out are obligations waive <id>... --reason and obligations attest <family>... --reason. Each writes an ADR in rust/DECISIONS.md, then an entry in rust/obligations-decisions.toml ([[waive]], [[attest]]) that cites it. The file is read strictly: every fault is reported at once and nothing in it is applied. A decision holds only if its ADR is a ## ADR-NNN heading outside a code block, with a number no other heading has (compared by value: ADR-7 is ADR-007), in a section that names in backticks the first item waived or the family attested. An entry written by hand is accepted on the same terms. |
A decision not to cover something has to leave a reason where a reviewer reads it. The first version accepted any line that looked like a heading: one inside a code block, or a number used twice, vouched for a decision nobody wrote down. |
| O27 | A family the ledger cannot prove complete blocks until a person attests it, including unknown and partial ones. The attestation stores the family's state and a fingerprint of it: the obligations' ids and detail, and the sites not enumerated by file and reason, without line numbers. When any of these changes the attestation is stale and the family blocks again, naming the ADR it was attested under. |
O3: the tool does not certify what it cannot prove, so a person does, for the ledger they saw. Line numbers are left out so that an edit elsewhere in a file does not void it; detail is in because a flag that starts taking the rest of the line is not the flag that was attested. |
| O28 | waive stores concrete ids. An argument equal to a known id (an obligation of the ledger, covered or not, or a wildcard item) is that id, even when it holds a * (route:src/app.js#GET /files/*); only an unknown argument with a * is a pattern, expanded when the decision is taken into the ids that block then. It refuses, and writes nothing, an id that has a case, is not in the ledger or is already waived, and an empty or multi-line reason. |
A stored pattern would waive obligations that appear later, unseen. A route id read as a pattern waived its neighbours. |
| O29 | An expected text that replay compares with the ... line wildcard and that holds such a line blocks lift: for a CLI case stdout, stderr, effects and each file of <name>.out/; for an HTTP case the body and the effects. A CLI case app record wrote (an entry in rust-anything.cases.json) reads the wildcard only in the fields of its wild list, as replay does (app::wild_in answers both): elsewhere a ... line is text the original printed, compared as written, and does not block. A case with no entry reads it everywhere, and so does every case when the entries file is missing, does not parse or is a link that leaves the repository. Its id is wildcard:<cli:name|http:name>#<field>@<16 hex digits>, an FNV-1a hash of the content, so a waiver stops holding when the expected text changes. An expected file that cannot be opened (a link that leaves the repository) is wildcard:unread:<path>: it blocks and cannot be waived. The sweep uses what replay uses: where an expected text comes from (the .toml key first, else the file), binary, unordered, float files, and the definition of the wildcard line. |
... matches any number of lines, so a port that prints nothing there passes. A sweep with its own copy of the loader missed the effects key of a case's .toml. |
| O30 | gate's coverage check is real: it fails for an export of the unit's manifest (other than those kept in JS) with no case in cases.jsonl, unless its id is waived or bound by hand in rust/obligations-bindings.toml (read only when that file exists). cases.jsonl is opened under the same guard as evidence: a link that leaves the repository or a file that is not regular fails the check, an absent file means no case. |
coverage used to pass whatever was recorded; the unit is where an export without a case is cheapest to see. |
| O31 | No flag is linked by a rule while any site of the flag family is unread, anywhere in the ledger: each flag is uncovered with the first site and its reason, and a binding (O23) is the way to link it. A literal prefix_chars other than "-" is such a site. |
"Takes the rest of the line" was fixed by form three times (a positional, an option, then **kwargs and prefix_chars="-+"), each beaten by the next review. What an argument means is only known when every declaration of the parser was read. Cost: a project with one unreadable flag declaration binds or waives all its flags by hand. |
| O32 | waive and attest compose the ADR and read the composed journal back with the reader standing uses before writing anything; a journal the new ADR would not be seen in (it ends inside an unclosed code block) is refused. Each file is written to a temporary file created with create_new under a name that is not predictable, then renamed; a target or a folder that resolves outside the repository is refused. If the .toml cannot be written after the ADR was, the error names the ADR left without a decision. The composed journal must also have exactly one section more than before and no open code block, so a cited id that holds a line break or a fence is refused. waive, attest and fallbacks --write take turns through an OS lock on rust/.rust-anything/obligations.lock, held from reading the decisions to writing them, and a reason may not hold a control character other than a tab. |
The command wrote an ADR its own reader then ignored, and a temporary file with a guessable name was written through a link planted at that name. |
| O33 | A front door keeps a journal of its fallbacks only when RUST_ANYTHING_FALLBACK_JOURNAL names a file: one JSON line per fallback, written once the original's outcome is known (a command's exit code; a request's status, before its body streams through). A CLI line holds the arguments and the exit code; an HTTP line the method, the path with its query and the status. A stdin the glue read and a request body are a length and an FNV-1a 64 digest. Never the content of a stdin or a body, a header or the environment. The original does not see the variable, and app replay --build removes it from the front door it starts. After lift there is no original and nothing is journaled. |
The recorded cases are the inputs someone thought of before the port; what people really run shows the ones nobody thought of. Opt-in and without content because a command line and a query string are already more than a tool should keep without being asked. |
| O34 | The journal never changes what the front door does. Every failure is swallowed; only a regular file is opened (a named pipe, a device or a folder is left alone), never the file behind the process's own stdout or stderr; it is created with mode 0600; a journal that reached 1 MiB takes no more lines; a line over 64 KiB is replaced by a skipped line with the size and the digest of what was not written; the HTTP front door writes off its async workers. The writer is one file, pasted into both generated crates and included by rust-anything, whose reader takes its bounds from it; the generated CLI crate gains no dependency. |
A front door that behaves differently when a variable is set is not the original any more. The first version swallowed errors and still hung on a named pipe after the original had ended, added its line to the program's output through /dev/stdout, and wrote a status (999) its own reader refused, which voided the whole journal. |
| O35 | obligations fallbacks <journal>... reads journals strictly (every fault of every file is listed, and then nothing is applied) and sorts each distinct entry, refusal first. Refused: the original ended with a non-zero exit, did not answer, or answered outside 2xx; counted, never stored. Recorded: a recorded case that succeeded has the same input (the same arguments, no added environment variable, and the same stdin length and digest when the entry has one; or the same method, path with its query and body digest). Explained: the rules that read a case (O19) or place a request on a route (O20) accept it, called as they are on a case built in memory; with a gains list when a case of it would cover an obligation that has none. Outside: anything else, and always an entry with an argument that is not UTF-8, a skipped line, and a journal that reached its bound. The command exits 0 when it completes. |
The sort must not grant what the evidence rules refuse, so it has no rule of its own: one copy of read_case would drift as the earlier copies did. What cannot be read back as the line that ran cannot be matched to anything. |
| O36 | --write stores the outside entries in rust/obligations-fallbacks.jsonl, and they are the fourth thing that blocks lift (O25): each is judged again at every standing, and blocks until a recorded case has the same input, the registry explains it, or waive lifts it with an ADR. Ids are fallback:<cli|http|skipped|truncated>#<16 hex digits>, an FNV-1a hash of the entry's identity; for a skipped line and a cut journal the identity includes a digest of what was lost. The stored file is read strictly, under the same guard as the decisions; a fault in it, or two identities under one id, is an error, so lift says the obligations could not be checked. A stored entry is never sorted as refused, whatever status the file gives it. waive refuses an entry that does not block. |
An input the original served and the port never met is the feature that gets skipped. The status of a stored line can be edited by hand, so it cannot be what lifts a blocker; and a placeholder identified by its size alone let one waiver cover the next unknown fallback of that size. |
| O37 | --inputs <file> writes the outside entries, and the explained ones that would cover an obligation, as lines app record --inputs reads. The file must not exist and its folder must: it is created with create_new, and nothing is created when there is nothing to write. An entry whose stdin or body the journal only has a digest of is written without it and listed to be completed by hand; recorded as written, it does not lift the blocker, since the digests differ. What cannot be replayed (not UTF-8, skipped, cut) is not written. The report, also with --json, warns that the stored file and the inputs hold command lines and query strings as typed, to be read before they are committed. |
The way out of a blocker should be the record of a case, and the command that names the gap should hand over the input. The first version replaced a source file named by mistake and created folders. |
| O38 | The MCP server has three tools for the registry. Two only read: obligations (the ledger, or with evidence the links and the candidates) and obligations_check (the standing plus clear, lift_blockers and closed_by_binding, the ids of the obligations a person closed with a binding, read from what evidence already computes). The third, obligations_fallbacks, sorts journals and writes only when asked: with write it stores the entries outside the registry in rust/obligations-fallbacks.jsonl, and with inputs it creates the file it names, wherever the caller names it, outside the repository included, as the CLI does (its annotation is readOnlyHint: false). What it writes is a record of a fact and never a decision; none of the three waives, attests or binds. obligations_check returns clear: true only when the standing blocks nothing and lift_blockers writes no line (is_clear, the one place that decides it); a standing that cannot be computed is an error, never clear. An open registry is a result, not an error. |
A tool that answered ok for a registry it could not read would let an agent call the port finished. |
| O39 | There is no MCP tool that waives, attests or binds, and none will be added: waiving, attesting and binding cases to an obligation by hand (rust/obligations-bindings.toml, O23) are the user's decisions (O26) and each ADR carries the user's reason; a binding leaves no ADR and no decision entry, which is why the descriptions of obligations, obligations_check and the port_whole_app prompt name it next to waive and attest. A test lists the tool names (none holds waive or attest) and calls obligations_waive, obligations_attest, waive and attest, which are "unknown tool". The descriptions of the three tools say what the agent must not conclude (the list is not complete for the families other than exports; clear: true is not a proof that the port is right; an empty fallback report does not mean nothing is missing). |
An agent that can call waive empties the registry to get past the lift. |
| O40 | The skill (whole-app.md, copied identically to plugin/ and directory/; tests/plugin.rs checks the copies and that every command, option and file it names exists in the binary) has four rules: never declare the port finished while obligations --check lists a blocker, and report the count of blockers and what a decision closed (waived, attested, bound); never run waive or attest unasked and never write a binding unasked, presenting each item to the user, and a binding goes in only on the user's yes and never to a case that fails or does not reach the obligation (its [[bind]] fields are described in the skill itself); never delete or hand-edit rust/obligations-decisions.toml, rust/obligations-fallbacks.jsonl or the ADRs that waive and attest wrote; never change a recorded case to make a port match without the user's agreement. tests/plugin.rs pins each rule on the sentence that forbids it, and extracts every rust-anything ... command the two files cite between backticks, checking that the subcommand exists and that each --option is a whole word of that subcommand's --help (a rename to --repository or a deleted rule fails a test). The journal variable is read from app::JOURNAL_ENV, not copied. |
The rules are the only thing between an agent with a shell and waive (see Known limits). |
| O41 | app_lift refused for the obligations is an error with the code obligations_open (not retryable) and next = rust-anything obligations <repo> --check, and the blockers it found stay in the message (a lift that fails before the checks, with no front door, no crate or a gate error, answers a plain failed that says nothing of the registry: run obligations_check); a refusal with only other blockers (gate, replay) remains a result with lifted: false. failure() recognises the text from the sentences lift_blockers writes (standing::LISTS_THEM_ALL) and the one lift writes when the registry cannot be read (lift::OBLIGATIONS_UNCHECKED), through lift::is_obligation_blocker: constants shared with the writers, not copies, and the rule comes first in FAILURES so other blockers in the same message do not hide it. |
A lifted: false result read like one more step; an error with its own code and its command does not. |
| O42 | Two fixtures hold what a README does not show: obligations-undocumented-cli (an argparse --shout that only the code declares) and obligations-undocumented-server (a Flask route GET /reports/<name>; Flask is not installed where the tests run, so site-packages/flask.py is a stand-in over http.server, in a folder the detectors skip). tests/obligations_undocumented.rs records each from its documentation alone and checks that the id is uncovered and blocks in the standing, lift_blockers, the real lift::lift and the MCP obligations_check and app_lift; that it alone blocks once the rest is settled; that a case that exercises it, or a waive with a reason (and its ADR), removes it; and that a case that only fails on it (exit 2, status 404) does not. |
The registry was tested on fixtures whose gaps the detectors already knew; this one is a gap found only by reading the code. |
Known limits
- An agent that has a shell can still run
rust-anything obligations waiveorattest: the skill forbids it and the MCP server offers no tool for it, but nothing prevents the command. The ADR and the entry it writes make it visible in review. - A binding written by an agent in
rust/obligations-bindings.tomlcloses an obligation with no ADR and no entry inrust/obligations-decisions.toml, including toward a case that failed (rule O23 holds for a case the rules refuse): the skill forbids it, nothing prevents it.obligations_checklists these inclosed_by_binding, but a binding on an obligation a rule already matched is not visible there (its state staysmatched). The list holds ids only: neither the bound case, nor that it failed, nor the reason; a person readsrust/obligations-bindings.tomlto judge. It exists in the MCP answer only; from the CLI the same obligations are thedeclaredlines ofobligations --evidence. - The command in the
nextof an MCP failure holds the repository path unquoted, for every code: with a space in the path it has to be quoted by whoever runs it. app_liftthat fails before the checks (no front door, crate not found, gate error) answers a plainfailedwith no word on the registry;obligations_checkorobligations --checkis the way to see its blockers.obligations_fallbackswrites the inputs file wherever the caller names it, outside the repository included, as the CLI does.- A recorded HTTP case whose body the top of its
.tomldoes not hold (request.body_file, abody_base64that does not decode, a body that is not a string, two body forms at once) explains no fallback, with or without a body: that fallback stays outside the registry until a case holds the body asbodyorbody_base64, or a person waives it.app recordwrites those two forms only;body_filecomes from a case written by hand. - A blocker line from another origin that contains the text of
standing::LISTS_THEM_ALLwould be classifiedobligations_open(the cautious side: the lift stays refused). - The only test that holds the registry's addition to
lift(the_real_lift_and_app_lift_refuse...) needs python3 and cargo, and skips without them. - A folder that discovery skips by name is reported only when its parent directly holds an inventoried file or lies under a package's source root:
packages/x/distbesidepackages/x/package.json, with the sources inpackages/x/src, is skipped without a word (as it was before discovery's rule looked at where the folder sits). Adistat the root is build output by design. - For TypeScript the registry asks discovery's own function which folders are skipped (
ts::discover::skips); for the other languages it reads each plugin's list of names, and two walks do more than their list: Kotlin discovery keeps abuildbelowsrc(the registry calls it skipped: a gap too many), and Go discovery also skips folders whose name starts with_(the registry reports nothing for them). - The translations of the README and
website/do not describe the registry yet. - Tests that import a package by name credit the package, not a unit.
analyzestill guesses "compute-heavy" from loops and string work;profilemeasures (not for C: useperf). Go workloads must bego testruns, since Go profiles only from inside the process. The Ruby tracer slows the program several times; shares stay comparable.- The bridge copies strings and structured values on every call. For fine-grained functions this
dominates: measure with
bench, and batch the loop around them. Batches take one scalar or string parameter (Ruby: any value) and return scalars or strings; not for C. - Shadow mode compares synchronous Rust results; functions that mutate their arguments are run on
already-mutated input by the second implementation (the generated shadow runs Rust on copies
taken before the original runs, for the exports that change arguments or print). For TS/JS,
Python, Ruby, Go, Java, Kotlin, PHP and C# functions
recordkeeps the arguments after the call and what the call printed, anddiffcompares both. For PowerShell and Swiftrecordanddiffcompare return values only (C also records its out arguments), sobridgekeeps in the original every export that returns nothing, prints or changes an argument in place; and in every language one that reads the environment or module state, or takes a callback or class instance. The rule is one function (bridge::js_only_reasonand the per-languagelang::effects, witheffects::observesnaming the languages whose post-call state is compared), shared bybridge,analyzeandprofile, and--forcedoes not apply to it. A language is added toobservesonly with a test that plants a no-op port and expectsdiffto fail. C recordsoutandbufferarguments back, so a C function that writes through them is bridged. Methods of classes keep the old rule in every language. - C: scalars,
const char *, byte buffers with a length, out-pointers to one scalar and structs of scalars cross the bridge; an array pointer followed by its count, a string followed by its length, and state structs stay in C. Functions defined through macros are not seen. - Go: methods, generics, variadics, pointers, interfaces and channels stay in Go; struct
parameters cross as JSON with their exported fields when the struct of plain fields is declared
in the same file. A named type that is not one (
type Color int, a struct in another file, a struct with a pointer field) stays in Go with the reason. - Ruby: module functions only (
def self.x,module_function); classes and methods that take blocks stay in Ruby. Without YARD tags, parameters not used as numbers cross as untyped JSON. - Java:
public staticmethods of public classes only; overloads, generics,charand object types stay in Java.recordcompiles the module's sources withjavacalone, so code that needs Maven dependencies has them put onCLASSPATHbeforerecord(3.4.0). - No way yet to mark a recorded case as undefined behavior that does not crash (
ispunct(1000)): change the inputs or keep that function in C. Do not editcases.jsonl:gatefails an edited recording. - Go and Java: leaf functions are faster in their own language, since one call into Rust costs
more than their work;
benchrecommends porting bigger units there. Interfaces, pointers, channels, Java objects other than strings, lists, arrays and maps, and Java primitive arrays other thanint[],long[],double[]andboolean[]still cross as JSON. - PowerShell: each call costs about 0.1 ms or more in PowerShell itself (encoding the arguments, decoding
the answer), so functions that finish faster than that get slower;
benchsays so. Process start-up, the usual cost of PowerShell in tools, is outside any port. - Ruby: aliases made with
aliascopy the original method, so shadow mode does not see calls through them. obligationslists what its detectors read; it cannot show that nothing else exists. Commands, flags, routes and environment variables declared in a form no detector knows are missing without a site, which is why those families are nevercomplete(O3). Known forms it does not read:- Mount prefixes are composed inside one file only. A router exported from one file and mounted
in another keeps its relative path, marked in
detail, and the mount is a site. Not composed at all: prefixes of itty, polka, hapi and tinyhttp, andapp.use('/list', [r1, r2])with an array of routers (sites). - hono, koa-router and FastAPI's
include_routercopy a sub-router's routes when it is mounted; statement order is ignored, so a route added to the sub-router after the mount is listed under the prefix although the framework does not serve it there. - An express router that is never mounted in its own file keeps its relative path with the
detailmark but leaves no site;r.get('')is ignored. - fastify: a route whose path is
''or has no leading slash (c) is not detected and leaves no site; theprefix/alias fastify also serves for a route/under a prefix is not listed. - Nested mounts are expanded without memoization, to a depth of 64: a router mounted under several prefixes at every level multiplies the paths, and a deep enough tree would be slow rather than refused.
- yargs
command(['serve', '$0'])lists its options underserve/only, not also at the top level. - environs:
env("X")called directly andwith env.prefixed("P_") as e:are not read; onlyenv.str("X")-style method calls are. [project.scripts]is read from the rootpyproject.tomlonly; shebang scripts under test folders are not read; a script named by a manifest is read for surface only (no exports, no error paths). Apyproject.tomlthat does not parse is skipped without a site.- A script path such as
lnk/../x.py, wherelnkis a link to a folder elsewhere, is resolved on its text and readsx.pyof the repository, not the file the link would lead to. - O16 covers the ledger's own detectors, not the package discovery it shares with
analyze: a rootpyproject.tomlorpackage.jsonthat is a link out of the repository is still opened there (whole_app::manifest_entries, andlang::pythonfor the package name and dependencies, which also triesrequirements.txt). Seen understraceon two probes (2026-11-25):pyproject.tomlopened 4 times,package.jsontwice,setup.pyandsetup.cfgnever. No command, flag, route or environment variable comes from those reads; the Python dependencies they declare still decide which imports count as third-party.
- Mount prefixes are composed inside one file only. A router exported from one file and mounted
in another keeps its relative path, marked in
obligations --evidencereads a case's arguments, its recorded exit code and the ledger. Amatchedcan still be wrong where those three cannot tell:- A click option with
nargs=2takes a following flag as its second value (--size 3 --portcredits--port). Not run: click is not in the test image. - A program that exits 0 without doing the work (it catches
SystemExit, or prints its usage and returns 0), and a hand-written case withoutstatus, which counts as exit 0 as it does forreplay. cli-envshows that a read case sets the variable, not that the program reads it;http-portlikewise.- A callee that throws the same type with the same message links the owner's error path (O21).
- A click option with
obligations --evidencenever links these by itself; bind a case (O23): a behaviour that exists only with a non-zero exit; a case that puts a global option before the command (the only valid place in argparse and click); grouped short options (-vf), attached values (-ofile), valid argparse abbreviations (--verb), an option value that starts with-, and any option the ledger does not list; a group that runs without a subcommand; positionals and constructors; error paths without a single plain literal, duplicated, or thrown at module level; routes that are relative, wildcard,USE, WebSocket or ambiguous, and routes with a parameter while a route site is unread; methods whose results do not align; exports kept in the original.obligations --evidence: a case.tomlthat is not text is listed under "Not read" (exit 0), while one that opens and does not parse as a case is an error (exit 2). Checked in a Linux container only, with argparse executed; commander, click, typer and the web frameworks were not run there, and their behaviour is taken from their documentation. Not yet run on a real project, so how many obligations the rules leave to bindings is not measured.- What blocks
lift(obligations --check,waive,attest,gate'scoverage):coverageand the ledger name a Python class re-exported by__init__.pydifferently (export:src/textkit/stack.py#Stackforgate,…/__init__.py#Stackin the ledger), andwaiverefuses the idgateprints. Only a recorded case makescoveragepass there, or a decision written by hand with an ADR that names it, which the standing then lists in a note as a waiver for an id that is not in the ledger. It blocks too much, never too little.- The HTTP
replaynames the body and the effects where it compares them; the list the wildcard sweep walks (HTTP_TEXT_FIELDS) is kept next to it by hand. A textreplaystarts comparing with the wildcard is not swept until it is added there, and no test would fail. - Only
...lines are swept. An expected line that is[..]alone also accepts any line and does not block. - The sweep follows
replay, not the lifted crate's owncargo test: trycmd reads a...line as a wildcard in every field, wherereplayreads it only where the recording made it. A...line the original printed in a recorded case does not blocklift, and the lifted trycmd test accepts any lines there;app replay --buildis the exact check. - The registry reads
rust/app-casesonly. A repository whose casesreplayreads fromspec/cases(an app started withrust-anything new:spec/cases/rust-anything.jsonand norust/app-cases) cannot be checked:--evidence,--checkandliftstop with an error that says so, never with "no cases". - A folder of cases that holds an entry whose name is not UTF-8 is refused whole
(
wildcard:unread:<folder>blocks and cannot be waived, and its cases cover nothing): the registry names files by relative paths written as text. Rename the file. - An ADR has to name only the first id of its
[[waive]]entry: an id added by hand to an existing entry holds without the ADR naming it. Thedateis not checked. git is the record of who edited the decisions file. - A heading indented by one to three spaces is not read as an ADR heading, and an ADR number
too large for 64 bits is refused; both refuse a decision rather than accept one. That
ADR-7andADR-007are one number is held by unit tests only. prefix_charspassed toArgumentParseras a positional argument is not a site (O31 reads the keyword). No false link was reproduced: the rule on positionals refused the cases tried.- Between the check of a target and its creation, another process that replaces
rust/with a link is not seen. The clean-up after a write that fails halfway has no test (nothing injects the failure), and the rename was never run on Windows. - O31 was run with the real recorder on argparse only; commander, yargs and click also leave
flagsites and were not executed. The tests on links are#[cfg(unix)], and everything was run in a Linux container only. Not yet run on a real project. - No rule links an error path that only a failing run reaches, so every such path is bound or
waived by hand.
--check,waive,attestandlifttake no--lang.
- The fallback journal (
RUST_ANYTHING_FALLBACK_JOURNAL,obligations fallbacks):- A fallback the original ended with a non-zero exit or a status outside 2xx never blocks (O35): a linter that exits 1 on findings, a login that answers 302 and a protected route that answers 401 are counted as refused and not stored. The status of an entry is not compared with the status of the case that records it.
- It sees only what falls back while the variable is set. After
liftthere is nothing to journal. A process that is killed writes no line. A fallback that inherits stdin (no glue read it) has no digest, and is recorded by any case with the same arguments, whatever stdin that case has. The environment, the working directory and its files, and the request headers are not in the journal, so two runs that differ only there are one entry. - Deleting
rust/obligations-fallbacks.jsonllifts every blocker in it without a note, unless one was waived; git is the record of that file. An entry lifted bywaivestays lifted for the same input for good. - Ids are FNV-1a 64, which is not collision resistant: a client could craft a path whose id
equals a waived one. It is a fault while both are in the stored file, and passes once the
waived entry was removed from it. The digest of a
skippedline, likestdin_fnvandbody_fnv, hides nothing from someone who can guess the content: a short path or line can be confirmed offline. - The same line written twice in the stored file is read without a fault: it is one entry, with no effect on what blocks.
- The journal path is followed through links, to a regular file or to a new one, and between the look at the path and its opening a named pipe put there would still hold the process; the check made after opening has no test. A disk that fills can leave half a line, and the strict reader then refuses the whole journal.
- The stored file and the
--inputsfile hold command lines and query strings as typed, tokens included. If the stored file cannot be written after the--inputsfile was, the inputs stay. - Run in a Linux container only, on test front doors built for the purpose (Node originals);
the tests on pipes, streams, modes and links are
#[cfg(unix)]. Not run on Windows, where an argument that is not valid UTF-16 and the append to a shared file were not looked at. Not yet run on a real project.
obligations: a brokenpackage.jsonstops the command with an error (exit 2) instead of a site. The~2suffix of duplicate error paths follows source order, so inserting an identicalthrowabove shifts the ids below it.