The Mistral team undertook a project to modernize a legacy oil and gas reservoir simulator originally written in Fortran. The system comprised approximately 300,000 lines of code, lacking centralized documentation and a comprehensive test suite.
Initial attempts at fully autonomous migration resulted in code that merely replicated the old architecture, including global variables and GOTO statements. To improve quality, the team implemented a structured workflow involving specialized AI agents for planning, development, testing, and review.
The team successfully migrated 40,000 lines of code during the first sprint. They established numerical equivalence between the Fortran and C++ implementations by creating a testing framework that verified results against key checkpoints.
To manage documentation, the team used a custom parser to build a call tree and deployed over 100 agents via Vibe CLI to process existing PDF files and code comments using Mistral OCR. This allowed them to consolidate and update project documentation.
The final process involved breaking the system into independent modules, each limited to approximately 10,000 lines of Fortran code. Human oversight was integrated into the workflow to resolve complex issues where AI agents reached a deadlock.





