Legacy modernization · Visual FoxPro · AI governance

Using AI to turn legacy applications into modernization specs, safely

Why AI should read legacy code before anyone rewrites it, and how a read-only, human-approved pipeline turns systems like Visual FoxPro into modernization specifications.

Helix Engineering Team · ·4 min read

Every company that has been around for a while runs at least one system that everyone depends on and nobody fully understands. It might be a Visual FoxPro application from the late 1990s, a tangle of stored procedures or a desktop tool that “just works” as long as nobody touches it.

When the time comes to modernize, the tempting promise of AI is: point a model at the old code and have it write the new system. We think that is the wrong first step. This article explains why, and describes the safer approach we are developing in our Lab.

Why legacy rewrites fail

Large rewrites rarely fail because the new technology is hard. They fail because the old system does more than anyone wrote down:

  • Business rules are buried in form events, validation routines and report logic.
  • Edge cases were fixed one at a time over twenty years, and each fix encodes a decision someone once made.
  • The people who understood the original design have retired or moved on.

A rewrite that misses these rules goes live, breaks a process nobody listed and loses the business’s trust. Then the project runs over budget fixing behavior the old system already had.

The real bottleneck is not writing new code. It is understanding the old code well enough to specify what the new code must do.

What AI is genuinely good at here

Modern language models are very good at reading code, including old, unfashionable and poorly documented code. They can:

  • Summarize what a program or routine does in plain language.
  • Trace where a table or field is read and written.
  • Group related programs into business features.
  • Draft a structured description of a feature’s inputs, rules and outputs.

That is exactly the work that takes human analysts weeks per feature. The catch is that models also make confident mistakes, so their output has to be checked before anyone relies on it.

A safer design: read-only, specify first, humans approve

Our Lab project, the Legacy Modernization Spec Factory, is built around four rules.

1. The AI can read, but never change

All analysis runs in read-only mode. The coding agent can inspect the legacy repository and answer questions about it, but it has no ability to modify files. That one constraint removes most of the risk of pointing AI at a business-critical system.

2. Understand before you specify

The pipeline works in stages:

  1. Inventory. Build a complete list of files and artifacts in the legacy repository.
  2. Feature discovery. Reconstruct a catalog of business features from the code.
  3. Selection. A person chooses which feature to specify next.
  4. Specification. The agent drafts a Feature Modernization Specification: purpose, inputs, business rules, data touched and outputs, with references back to the source.

3. Validate the output, don’t trust it

The agent’s output must be structured data that passes schema validation before it is rendered into a readable document. Reviews also check the source line citations. A specification that cites the wrong lines is sent back, however fluent it sounds. In our own testing, citation checks have already caught drafts that needed revision.

4. People approve, and the approval is provable

Every specification is held for human review. When an expert approves it, the approval is recorded against a SHA-256 hash of the exact version they read. If the document changes afterwards, the hash no longer matches and the approval visibly no longer applies.

Why we deliberately stopped before code generation

The Spec Factory does not create tickets and does not generate new application code. Both are intentionally blocked.

That is a choice, not a limitation. Generating code from an unverified specification just produces wrong software faster. Once a team trusts the specifications, generating the new implementation, whether by people, AI or both, becomes a much smaller and more predictable project.

What this means for a modernization project

For a company planning to modernize, the practical approach looks like this:

  1. Assessment first. Inventory the system and discover its features before estimating a rewrite.
  2. Prioritize. Specify the highest-value or highest-risk features first.
  3. Approve with experts. Subject-matter experts review specifications while they are still available to do so.
  4. Then migrate in phases. Build against approved specifications, feature by feature, rather than in one big bang.

This is the basis of our Legacy Modernization Assessment: a fixed-scope engagement that produces an inventory, a feature catalog and approved specifications for priority features, before any new code is written.

Where the research stands

The Spec Factory is research in progress. The read-only pipeline, dashboard, approval workflow and 77 automated tests are in place. The next milestone is running discovery against a complete Visual FoxPro application with forms and menus, since screens and menu commands are where much of a legacy application’s behavior lives.

If you run a business-critical legacy system and want to understand it before you change it, we would be glad to talk.

Have an AI use case that needs to work in production?

Book a 30-minute call with a senior engineer. You'll leave with a clear next step, whether or not we work together.