Coding agents modernize legacy systems more safely when numerical parity, module boundaries, and human review are designed before the first automated change
Source: Mistral
Mistral describes helping a European energy operator migrate 40,000 lines of a physics-intensive Fortran 77 reservoir simulator to C++. The team first created a harness that exports legacy-state checkpoints and tests the C++ implementation against them, then used agents to document the caller-callee tree and work through independently scoped modules. Mistral says fully autonomous translation produced functional but unmodernized code; the final workflow used planner, coder, tester, and reviewer roles, with reservoir-engineer approval of architecture and human review of pull requests.
Why this matters: Treat an agent-led migration as an evidence program, not a bulk code-conversion exercise. Establish a runnable baseline and behaviour or numerical parity checks before changing implementation; map dependencies and break work into independently testable modules; require architecture approval before execution; and retain a human owner who can resolve ambiguity, reject weak output, and approve each merge. This is especially important where the original domain knowledge is scarce and a syntactically valid rewrite could still change critical business behaviour.
Read Mistral's legacy-code modernization case study