The Archaeologist’s Copilot
Summary
The post describes a four-phase approach (Analyze, Wrap, Lift, Refactor) to modernizing a Java 1.5 codebase from 2005–2008 using LLMs as copilots. The central failure mode is the 'Tourist Prompt'—asking an LLM to simply explain or run legacy code, which produces confident hallucinations that mask structural decay. The author contrasts this with 'Archaeologist Prompts' that assign specific expert personas and demand forensic analysis, which surface real risks. A 'Time Capsule' Docker strategy recreates the original runtime environment without touching source code, establishing an honest verifiable baseline before any modernization begins. The AI-compiler feedback loop—feeding exact warning output to the LLM with targeted refactoring instructions—proves far more effective than vague requests. Throughout, the human drives strategy while the AI handles tedious translation work.
Key Insight
Effective LLM-assisted legacy modernization requires the human to direct the AI with constrained, forensic prompts and swapped personas at each phase—the AI's default optimism is a liability, and success only comes when the engineer, not the model, owns the strategy.
Spicy Quotes (click to share)
- 8
AI defaults to optimism. When I ask 'How do I run this?', it assumes I can run it. In a restoration mission, optimism is fatal.
- 8
The result was a lie — and a structural lie at that. By generating a modern build file, the AI merely painted a fresh coat of paint over a crumbling structural wall.
- 6
To truly restore a brownfield project, I need to stop acting like Tourists and start acting like Archaeologists.
- 7
Instead of changing the code to fit modern reality, I had to change reality to fit the code.
- 5
A red build meant I was finally looking at the unvarnished reality of the system.
- 4
momentum is oxygen.
- 3
sometimes software archaeology requires the right shovel.
- 5
The AI didn't magically restore this historical system on its own; rather, I restored it by wielding the technology as a powerful force multiplier.
Tone
practical, instructional, cautionary
