JS → Python (verified by differential testing) with a fix loop, critic,
multi-file support, eval harness, and an optional TS adapter + replay UI.
Full spec: code-migration-agent-prompt.md.
uv sync --group dev
uv run pytest -qProvider profiles live in config.yaml under providers: (zen,
openrouter); llm.provider selects. Keys come from env — copy
.env.example to .env (gitignored, auto-loaded via python-dotenv) and
fill it in. Never commit real keys. Role models are
Pydantic-free plain names so rotation is a config edit; refresh via the
provider's GET /models.
- OpenRouter (active):
poolside/laguna-s-2.1for all roles; verified live (549 tokens for the sample; relaxllm.max_tokensonly if outputs truncate). Free models rotate and rate-limit (429) — tenacity backs off. - Zen: free-tier chat only works from inside the OpenCode runtime
(
403 FreeTierErrorstandalone). Switchprovider: zen+ Zen role names when running there.
Analyze (deps first) -> Convert -> Static (ruff/mypy or tsc)
-> Harness gen -> Run diff (oracle runner.js + Hypothesis fuzz)
-> Gate: green? critic : fix (patch; revert on regression)
-> Critic (stub/Any/ignore heuristics + LLM verdict)
-> Commit per file (GitPython) / escalate via interrupt() on cap
# single-file building blocks
uv run python eval/run.py --fuzz 30 --out eval/results.json
uv run python eval/report.py eval/results.json # table + eval/report.html + web replay JSONLive-verified via OpenRouter (poolside/laguna-s-2.1): convert → static
clean → 0 mismatches on the sample; full loop transitions proven
(Convert→Static→Harness→Run→Fix→Critic→Escalate with sidecar records).
The small model stalls on fidelity (over-wide object types the critic
correctly rejects) — a green live commit wants a stronger model or more
attempt budget. Free-tier quota: 50 req/day shared across :free models.
agent/state, config, LLM client (SQLite cache, retries), git helper, nodes (analyze/convert/fix/critic), edges (gate), build (graph)oracle/runner.js + tagged JSON (py mirror): undefined/NaN/±Inf/-0/BigInt/Datetargets/python + typescript adapters (static_check,harness_gen,run_diff; TS diff compiles with tsc then runs oracle-vs-oracle)harness/normalized comparison, Jest seed extraction, differential runnersandbox/Dockerfile + runner (Docker when the daemon runs, else local; read-only hash checks in both;docker build -t migrate-sandbox:latest sandbox/)eval/corpus/5 pure-function modules + tests + verified referencesweb/optional replay UI (readsweb/public/run-report.json)
undefined≠None: theUNDEFINEDsentinel preserves the distinction.-0≠+0,NaN==NaNfor diff purposes; JSSetcanonicalizes -0→+0.- Strings match wire-observable behavior: JSON recombines surrogate
pairs, so char-level ports are correct except where JS yields a lone
surrogate (e.g.
slice(0, 1)of emoji — trap T5). - Fuzz strategies follow JSDoc
@paramtypes; untyped functions get generic values (which only probes dynamic typing, not the conversion).