Summary: Mistral’s Applied AI team helped a European energy operator port 40,000 lines of Fortran 77 to C++ for a reservoir simulator. The team built numerical parity checks and documentation before agent migration, then used human-reviewed coder, tester, and reviewer workflows module by module. The first sprint covered 40,000 of 300,000 lines under a favorable self-contained and runnable starting condition.
Moving legacy code with AI agents is not only a matter of translating syntax. Mistral’s Applied AI team helped a European energy operator port 40,000 lines of Fortran 77 to C++ for a physics-intensive reservoir simulator. The difficulty was architectural: Fortran 77 offers no modules and no namespaces, and state is held in global COMMON blocks. Variables are implicitly typed from their first letter, so a misspelled name quietly creates a brand-new variable instead of raising an error.
Why a parity harness comes first
Before turning agents loose, the team built a way to show that the two codebases agreed on the numbers. They added subroutines to export Fortran state snapshots, wrote a C++ test framework to load those checkpoints, and supplied Skill.md files to steer the agents. Agents then instrumented the Fortran code to dump state and checked migrated C++ modules against those values.
That harness paid for itself. It made long agent runs safer and delivered correctness with a proof that was easy to verify. In the Mistral team’s words, numerical parity is the cheapest, most convincing argument that a module is done.
Documenting before migrating
Documentation sat scattered across old PDFs and comments buried in the source. The team parsed the Fortran codebase into a caller-callee tree, then used Vibe CLI to spawn over a hundred agents to document it. Each agent could pull the relevant PDFs through document libraries and Mistral OCR, and the work moved from the leaves upward. A reviewer agent on a cron schedule watched for newly opened PRs and scheduled fixes.
This step mattered because code nobody can read is code nobody can migrate. Getting documentation in order before leaning on agents was one of the project’s key lessons.
The autonomy sweet spot
The first attempt handed agents full autonomy: one agent per Fortran subroutine, each translating independently for a week. What came back worked, but it was not modernized—COMMON blocks became global structs one-to-one, and GOTO-driven control flow stayed intact. It looked like Fortran retyped in C++.
The second attempt introduced structure: a planner, coder, tester, and code quality reviewer per module. Quality improved, but the added complexity tripped the agents up—they would hit a bug, attempt a few fixes, and stall with no one to intervene.
The team settled on a middle ground: a human operating a workflow of coder, tester, and reviewer agents, migrating module by module. The code quality from the second attempt survived, and the human checkpoint gave stuck agents a way out.
What this means for your migration
For builders facing legacy modernization, the Mistral project offers three principles. Stand up the parity harness ahead of any migration code. Put documentation in order before leaning on agents. And at this scale, structured workflows with human review gates outperform both full autonomy and hand-driven manual sessions.
The first sprint covered 40,000 of 300,000 lines. Because the Fortran codebase was self-contained and runnable, the starting condition was favorable. Migrations that depend on external systems, lack a runnable baseline, or encode physics documented nowhere would bring additional challenges.
The same pattern shows up in agentic software development: the goal is not to replace human judgment but to build workflows where agents do the heavy lifting and humans make the calls that matter.
