Repository navigation
v1.1.0
Whole-app ports: rust-anything now takes a TypeScript/JavaScript, Python, C, Go, Ruby or Java app
all the way to a pure Rust app, proving at every step that it still behaves the same. CLIs and HTTP
servers in all six languages, and libraries (proven end to end in TypeScript, Python and C so
far); every app command is also an MCP tool (app_record, app_replay, app_front_door, app_wire, app_lift).
- Plan:
analyze --whole-appgives the app's shape (CLI, server or library) and entry points,
every external dependency (imported, or declared in package.json, pyproject or
requirements.txt, go.mod, Gemfile or gemspec, pom.xml or Gradle) with its crate and fit, the port
order as pieces (units that import each other move together), and numbered decisions with a
recommended answer for the user. POSIX headers andcom.sun.*now map to their Rust
counterparts. - Record:
app recordruns the original on its own documented examples, an--inputsfile and
semantic traps (non-ASCII and emoji, negative division and modulo, overflow, float extremes,
map order, missing files), twice; what differs between the two runs becomes a wildcard, and
named normalizers (timestamps,uuids,key-order,name=regex) are saved with the cases.
CLI cases are trycmd files inrust/app-cases/(argv, stdin, env and files in; stdout, stderr,
exit code and files out). With--http(or--port) the command starts a server, and requests
from thecurllines in its docs,--inputsand traps are stored inrust/app-cases/http/. - Replay:
app replayruns any build (the original, the front door, the final binary) against
the cases, printspassed/totaland the fallback rate, writes a report with a diff per failing
case, and exits non-zero on any mismatch, so CI can run it. Any build can report its fallbacks
through the file named byRUST_ANYTHING_FALLBACK_LOG.--case <name>reruns one
failing case, the fast loop for fixing a mismatch. - Front door:
app front-doorscaffoldsrust/app, which owns the entry point from day one and
hands what is not ported yet to the original, counting every fallback: for a CLI a clap binary
that runs the original with the same argv, stdin and environment; for a server an axum app that
starts the original on its own port and proxies to it; for a library (nomain, no server, or
--library) a Rust crate with the public API, while the original package keeps its callers.
Replay against a fresh front door passes 100% at 100% fallback. - Wire: after a unit passes
gate,app wireadds its crate torust/appand routes commands
(--command), routes (--route 'GET /users/{id}',*) or, for a library, the unit's exports
to it, behind a kill switch,RUST_ANYTHING_UNIT_<NAME>=original; it writes a glue file to fill
in once, then builds and replays. For a library it writes the unit's shadow drop-in for the
original package to import, and shadows in every language but C (switched at build time) honor
the kill switch. - Lift: once the fallback rate is 0 and every unit passes
gate,app liftmakes it pure Rust.
It refuses until then and lists every blocker; it works on a copy, removes the fallback path and
the kill switches, turns each unit crate into a plain library (nocdylib, bindings or
generated wrappers), runs the lift checklist (fmt, clippy, tests, every target in
rust/DECISIONS.md, assets, replay in CI) and replays the pure binary, and writes the result
back only when all of it passes. CLIs get a trycmd test that runs the cases oncargo test.
The original is never touched. gatechecks error paths: every place the original fails on purpose (throw,raise, an
errorresult) needs a recorded failing case, andport.rsmay notunwrap,expector
panic!in a function whose original returns an error, unless marked// INFALLIBLE: <why>.recordadds the semantic traps to every function: each trap value of a parameter's type, one
parameter at a time, next to the generated cases.- Proved end to end on a small CLI and a small HTTP server written in each of the six languages,
replayed with the original moved away, and on libraries (a C library lifted to one pure Rust
crate; TypeScript and Python libraries moved unit by unit). - The skill gains a whole-app guide (
whole-app.md, installed bysetup): it grills the user in
rounds with a recommended answer for each question, researches dependencies against primary
sources, and keeps the port going across sessions withrust/MAP.md(claim one unit at a
time), ADRs inrust/DECISIONS.md,rust/GLOSSARY.mdand arust/HANDOFF.mdat each
checkpoint. It fixes red replays one case at a time, can port a wave in parallel with
subagents, and ends withrust/cutover.shfor the steps only the user can do. Grilling,
research and these practices are adapted from Matt Pocock's agent skills. - The pitch is now rewriting a whole app in Rust; making the slow part fast stays as a smaller use
of the same tool.