R451 · AI-built software and its verification › Test oracles for agent-written code

Eleven days, 64 agents, and the test suite that made it possible

Read the original

test-oraclesrewritesmulti-agentverificationcode-reviewcostclaim-checking

A 500,000-line runtime was ported from one systems language to another in eleven days by one engineer running 64 parallel agents, for about $165,000 in tokens at list API prices, and the result is in production. The hand-written counterfactual, from the person who would have had to do it: three engineers with full context on the codebase, roughly a year, with no bug fixes, security fixes or compatibility work shipping during that time — which is why the realistic alternative was not "do it slowly" but "never do it."

That is a genuinely new capability and it is worth being precise about what made it work, because the reusable part is not the agent count.

The preconditions, which are doing most of the work

Four things were true before the first agent ran, and each one is load-bearing.

A test suite written in a different language from the thing it tests. The runtime's own test suite is in TypeScript, so it does not depend on the runtime's implementation language. That single property is what converts an otherwise unverifiable rewrite into a checkable one: the same suite runs against the old implementation and the new one, and the engineer's own summary of the signal is that when all tests pass, it is high-confidence evidence the rewrite works. A test suite written in the language being replaced would have had to be ported too — and then it could not have served as the oracle, because you would be checking a translation against a translation.

A deliberately minimal scope. The chosen approach was a mechanical port with the minimal number of behavioural changes, using the existing suite unmodified. No redesign, no cleanup, no "while we're in here." This is what makes the oracle valid: behavioural equivalence is only a meaningful test if equivalence was the goal.

A domain expert driving. The person running it created the project and knows the codebase better than anyone. The article is explicit about this being material rather than incidental.

A plan and a style guide, written up front. Not a prompt. A documented migration plan plus a style guide that the agents worked against.

Strip any of the four and the eleven days do not happen. Teams reading the headline should check which of the four they have before estimating anything.

The orchestration design, and the one surprising choice

The setup avoided the usual failure mode of parallel agents — write conflicts — without the usual remedy.

Agents did not get their own working copies. Git worktrees were tried and rejected as slow. Instead the agents worked on different files inside the same checkout.

Agents proposed, an orchestrator committed. Each agent produced suggestions for what to change and was not permitted to write the file. A separate orchestrating agent created the commits. Conflicts are prevented structurally, by removing write access from the many and giving it to the one, rather than by isolating the many.

That is a cleaner answer than per-agent isolation for a mechanical port, because the work is naturally file-partitioned and the merge step is trivial. It would generalise badly to work where changes span files and depend on each other — there the orchestrator becomes the bottleneck and has to reason about interactions it did not perform. Worth knowing which of those two shapes your work has before copying the pattern.

The number that should change your planning: 85/15

The implementation — actually producing the translated code — took about 15% of the time. The other 85% went on getting it to compile, fixing tests, and verifying that it worked. The same split shows up in token spend: most time and most tokens went on fixing compile errors, fixing tests, and verification, not on writing code.

This is corroborated independently inside the same organisation. A platform engineer's version: few tokens are spent on actual implementation; most go on discovery of unknowns, prototyping, mocking, and then verification and testing. The article makes it a section heading in its own right — verification takes longer than implementation.

The planning consequence is uncomfortable. If implementation is 15% of the work, then an agent that makes implementation ten times faster makes the project about 12% faster, not ten times. Every estimate built on "the model writes the code quickly" is sizing the smallest term. The leverage is in the other 85%, which means in the test suite, the build loop, the error messages, and whatever lets a machine tell whether the change was correct.

It also reframes what a rewrite budget buys. The $165,000 was not paid for translation. It was paid for the iteration loop that closed the gap between translated code and working code — and that loop's cost scales with how good your verification is, not with how large your codebase is.

The gate worth stealing outright

The same team runs an issue-to-pull-request pipeline with a quality gate that is unusually well specified. When an issue is filed, an agent attempts to reproduce it. On success, a second container attempts a fix. Then the gate: the agent submitting the pull request must write a test that fails on the unpatched build and passes on the patched build, before it is allowed to submit at all.

That is a differential test, and it is mechanically checkable in a way that "please add a test" is not. It rules out the three most common ways an agent-written test is worthless:

The surrounding rules are blunt and good: no test means the pull request is auto-rejected; linters run; two independent automated code reviews run; and the agents argue it out on the pull request. Merging is still manual once every gate is green, with automatic merging described as a possibility rather than a current practice — a reasonable place to draw the line.

Note what the gate does not require: a human reading the diff. It requires a machine-verifiable property of the change. That is the only kind of gate that survives volume.

Trust at volume, stated plainly

The honest framing from the engineer doing it: at a hundred pull requests a day, you need to trust the code without the ability to read it all yourself.

His three substitutes for reading:

Plus a structural point: running tests out-of-process, in a different session from the one doing the coding, as a way to build trust. The separation matters because a verifier sharing context with the implementer inherits its assumptions.

Where this does not transfer

The environment is unusual in ways that are easy to miss and that invalidate most direct comparisons:

Review checklist before quoting the eleven days at anyone

  1. Does a language-independent test suite exist? If the tests are written in the language you are replacing, you do not have an oracle, and this project's central precondition is absent.

  2. Is behavioural equivalence actually the goal? A port with redesign mixed in cannot be checked against the old behaviour.

  3. Who is the domain expert, and are they driving? Not reviewing — driving.

  4. Is there a written plan and style guide, separate from the prompts?

  5. Is the work file-partitionable? If changes span files and interact, the propose-and-let-an-orchestrator-commit pattern will concentrate the hard reasoning in the orchestrator.

  6. Size the 85%, not the 15%. Estimate the compile-fix-verify loop; that is the project.

  7. Make every agent-authored test differential — must fail before the change, must pass after. Enforce it in CI, not in the prompt.

  8. Run verification out-of-process from the coding session.

  9. Decide your scanning cadence. One gate run is a gate; eleven runs is a sweep, and they catch different things.

  10. Check your token economics against theirs. Unlimited tokens is a precondition of the approach, not a detail of it.

The single sentence worth keeping

The rewrite was feasible because someone had, years earlier and for unrelated reasons, written the test suite in a language other than the one being tested. The most valuable thing in that codebase on the day the agents started was not the code. It was the oracle.

Connections

See R451 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.