Case 05 · Legacy enterprise estate

Autonomous code migration

An agent swarm that planned, rewrote, and verified a COBOL → cloud migration across 4.2M lines — zero Sev-1 regressions in the first ninety days live.

4.2MLOC migrated
11 wksCalendar time
0Sev-1 in 90 days
Sev-0Drift policy until proven

Context

A decades-old enterprise core still ran critical batch and online flows on COBOL with JCL glue and tribal knowledge living in people who were retiring. Prior migration attempts stalled in analysis paralysis. Leadership wanted cloud economics and hiring optionality without betting the company on a big-bang rewrite.

The problem, precisely

Semantic equivalence across undocumented business rules. Tests that did not exist. Batch windows that could not slip. And a political environment where “AI wrote the code” would be used as a weapon in the first outage unless verification was stronger than the narrative.

We treated behavioral drift as Sev-0 until differential testing proved otherwise. Speed without proof is just a faster way to fail.

What we built

A multi-agent planner decomposed the estate into migration slices. Hybrid symbolic + LLM transformers proposed rewrites. Differential testing compared old and new on production-shadow inputs. Progressive traffic shifting moved risk in measured increments.

Architecture highlights

  • Dependency graph mining from code, jobs, and runtime traces.
  • Agent roles: planner, rewriter, verifier, SRE proposer.
  • Differential harness with property-based business assertions.
  • Progressive delivery with automatic rollback triggers.
  • Knowledge capture so tribal rules became executable tests.

The hard parts

The undocumented rules were the product. Agents that “cleaned up” code often deleted revenue logic that looked like dead code. We inverted the default: preserve behavior first, refactor only behind equivalence proofs.

Human experts were scarce and skeptical. We paid them in leverage — every hour of adjudication permanently became a test — and published agent miss rates so trust was earned in public.

Rollout

Eleven calendar weeks for the contracted scope. Not because agents are magic — because the verification machine let humans spend time only where judgment was required. Internal comms framed the program as “augmented migration,” never “autonomous replacement of staff.”

Outcomes

4.2M lines migrated. Zero Sev-1 incidents in the first ninety days. Batch windows held. Hiring for the new stack became possible without a COBOL hiring crisis. The verification harness outlived the project as a permanent regression gate.

What we’d repeat

Proof before poetry. Turn experts into test authors. And never let marketing claim “fully autonomous” when the value is disciplined human-in-the-loop acceleration.