Reservoir engineers approved the target architecture; a human operator unblocked stuck agents and reviewed pull requests until they merged.
By [RuntimeWire Staff](/author/runtimewire-staff)
· Published
Primary source: [Mistral Newsroom](https://mistral.ai/news/legacy-code-modernization/)
Why it matters #
Mistral's case study shows where coding agents create value in high-stakes systems: parallel documentation and implementation, bounded by tests and expert review. It also shows why claims of autonomous legacy modernization remain ahead of the evidence.
Arthur Mensch (@arthurmensch)'s Mistral says it migrated 40,000 lines of Fortran 77 from a European energy operator's reservoir simulator into C++, using AI agents for documentation and implementation. In Mistral's account, autonomous agents produced functional but poorly modernized code, and a multi-agent workflow stalled on difficult bugs. Reservoir engineers reviewed and approved the target architecture, while a human operator separately unblocked stuck agents and reviewed pull requests until they merged.
Mistral detailed the engagement in a September 9th case study, one day after announcing a Samsung-led Series D. The pairing puts a concrete enterprise workload behind Mensch's larger pitch for Mistral. The former Google DeepMind researcher founded Mistral in April 2023 with former Meta researchers Guillaume Lample and Timothee Lacroix, betting that organizations would want capable AI systems they could customize and run with greater control over data and infrastructure.
The migration offers a useful view of that strategy at ground level. Mistral supplied models and tooling, while Mistral's applied AI engineers worked alongside reservoir specialists who understood the physics encoded in the software. It resembles a technical consulting engagement built around proprietary AI infrastructure, rather than a customer handing an old repository to a coding bot and collecting modern C++ a week later.
Translation was the easy part
The unnamed customer's broader simulator contained about 300,000 lines of Fortran, according to Mistral. The first sprint covered 40,000 lines of core functionality. The code had no test suite or centralized documentation, while years of engineering knowledge had accumulated in old PDFs, comments and the program itself. Mistral did not establish when the engagement began, how long the full sprint took or whether the migrated modules are running in production.
Fortran 77 also carries architectural baggage that cannot be removed through line-by-line translation. State is commonly shared through global COMMON blocks, types can be inferred from the first letter of a variable name, and control flow may depend heavily on GOTO statements. A literal C++ conversion can compile and preserve those same design problems under newer syntax.
Mistral first built a parity harness before attempting the migration. Engineers added subroutines that exported snapshots from the Fortran application, then created a C++ testing framework that loaded those checkpoints. Reservoir engineers selected important intermediate values as well as final outputs, giving the migration workflow numerical targets that could be checked after each module moved.
That decision narrowed the agents' job. They could propose architectural changes and rewrite modules without relying on line-for-line correspondence, while the harness supplied a concrete test of whether the physics still behaved as expected. Mistral used Skill.md instruction files to steer agents toward the correct tools and testing process.
Over 100 agents documented the code before rewriting it
Mistral generated a caller-callee tree with a custom parser, mapping how the procedural program's subroutines depended on one another. Starting at the leaves of that tree, Mistral used Vibe CLI to deploy over 100 agents that combined comments in the code with information extracted from legacy PDFs.
Those agents drafted documentation and opened pull requests against the original repository. A reviewer agent periodically checked new pull requests and created follow-up tasks when fixes were needed. Mistral OCR supplied information from the older documents, extending the document technology RuntimeWire examined when Mistral put OCR 4.1 into public preview.
Documentation was an especially suitable workload for parallel agents because Mistral could divide the program along an existing dependency tree. Code modernization proved harder because architectural decisions crossed module boundaries and small numerical differences could undermine the simulator's output.
Full autonomy preserved the old problems
Mistral's first implementation attempt assigned one autonomous agent to each Fortran subroutine. The agents worked independently for a week and produced functional C++, according to the case study. They also converted COMMON blocks into global structs and retained GOTO-driven control flow. Mistral described the output as Fortran retyped in C++ syntax.
The second attempt divided responsibility among planner, coder, tester and code-review agents. Code quality improved, but the workflow stopped making progress when agents encountered complex bugs and exhausted their attempted fixes.
Mistral eventually placed a human engineer above coder, tester and reviewer agents. The reservoir specialists reviewed each proposed C++ architecture before implementation began. After approval, the work was divided into tasks, run through repeated plan-implement-test cycles and submitted for human review. A human reviewer requested changes until the pull requests could merge.
Modules were selected as self-contained subtrees and generally kept below roughly 10,000 lines of Fortran. That constraint matters because it shows the practical unit of work was a bounded module with a runnable baseline and expert reviewers, rather than an entire 300,000-line application entrusted to a long-running autonomous process.
Mensch is selling control alongside automation
Mistral published the case study immediately after its September 8th announcement of a 3 billion-euro Series D at a post-money valuation above 21 billion euros. Samsung Electronics led the financing, with the Scaleup Europe Fund managed by EQT and PSG Equity as co-leads. Mistral says the capital will expand research, compute infrastructure and international commercial operations.
The timing gives the migration strategic weight. Mistral's pitch to enterprises and governments increasingly covers the full deployment stack: models, coding agents, document extraction, compute and engineers who adapt the system to a customer's environment. The Fortran engagement demonstrates the labor-intensive end of that model, where Mistral participates in architecture and delivery instead of stopping at an API or software license. Mistral describes its focus as co-creating tailored systems for high-stakes sectors including energy, manufacturing, finance and defense.
Mensch and his co-founders started Mistral partly in response to increasingly closed AI research inside large US technology companies. Their argument centered on open-weight models, customization and user control. In the reservoir project, control took a less ideological and more operational form: measurable parity tests, customer experts approving architecture and humans retaining authority over what entered the codebase.
The case study remains Mistral's account of its own work. It provides no independent accuracy audit, cost comparison or incident record, and it covers roughly 13% of the stated 300,000-line application. Mistral also does not identify the energy operator, the models used or the deployment environment. Those limits prevent the sprint from serving as a general benchmark for legacy modernization.
Mistral's candor about failed autonomy makes the account useful anyway. The agents accelerated documentation, generated plans, wrote code and ran tests. They did not reliably resolve the hardest bugs or decide the target architecture alone. For founders selling agents into consequential engineering systems, Mistral's workflow supplies a credible product principle: build verification first, divide work into bounded modules and design human intervention into the system before the agents need it.