Inspiration

Modernizing legacy software is risky because critical business rules are often undocumented and spread across source files, SQL queries, validations, and years of maintenance decisions.

AI can help developers rewrite code faster, but a modern implementation may still compile successfully while silently losing important business behavior.

LegacyProof was created to answer one practical question:

Does the rewritten system still behave like the original one within the scenarios we can execute and verify?

The project was inspired by real-world modernization work involving legacy applications, APIs, and SQL-heavy systems, where understanding the original behavior is often harder than writing the replacement code.

What it does today

LegacyProof is a local web MVP that compares two project folders:

  • A legacy project
  • A modern replacement project

It recursively reads both folders in the browser, filters supported source files, and builds a technical inventory of the selected workspace.

The current MVP can:

  • Exclude dependencies, generated output, secrets, binaries, and oversized files
  • Inventory files, languages, lines, functions, classes, conditions, endpoints, SQL tables, and SQL operations
  • Detect candidate business rules using deterministic pattern matching
  • Attach exact evidence to each candidate, including source file, line number, excerpt, and rationale
  • Let the user review, confirm, discard, and reopen detected rules
  • Load a shared JSON scenario contract
  • Execute both project adapters with the same input
  • Compare both JSON outputs deterministically
  • Report preserved behavior, mismatches, execution errors, and unverifiable cases
  • Export the results as JSON and HTML reports

How verification works

LegacyProof does not decide equivalence from AI-generated text.

Instead, it uses a deterministic verification flow:

  1. The user loads a legacy folder and a modern folder.
  2. LegacyProof scans compatible files and creates an inventory.
  3. It proposes candidate rules with traceable evidence.
  4. The user reviews those findings.
  5. If adapters and scenarios are present, LegacyProof runs the same scenario inputs against both projects.
  6. It compares the outputs and reports whether the tested behavior was preserved.

This means the final verification result depends on executable scenarios and output comparison, not on AI interpretation.

Current architecture

LegacyProof is currently divided into two main parts.

Deterministic core engine

The core engine is responsible for:

  • Scanning project files
  • Ignoring excluded folders and unsupported files
  • Building the technical inventory
  • Detecting candidate rules from conservative patterns
  • Validating scenario files
  • Executing adapters
  • Comparing JSON outputs
  • Producing a structured verification report

Local web application

The web app is responsible for:

  • Folder selection
  • Local file loading in the browser
  • Progress feedback
  • Rule review UI
  • Scenario execution controls
  • Result visualization
  • Report export

Current limitations

LegacyProof is intentionally scoped as an MVP.

Today, it does not:

  • Prove full semantic equivalence between two systems
  • Automatically understand every business rule in a codebase
  • Execute arbitrary real projects with their original runtime and dependencies
  • Resolve imports inside selected browser adapters
  • Use AI as the source of truth for pass/fail decisions

In the current web version, adapters must be self-contained and are executed in isolated browser Workers with timeout limits and common network APIs blocked.

LegacyProof can only claim equivalence for the scenarios that were actually executed.

Demonstration

The project includes a deterministic demonstration based on meal-order workflows.

In the demo:

  • The legacy project rejects meal requests on holidays
  • The modern project initially misses that holiday rule
  • LegacyProof detects the behavioral mismatch through shared scenarios
  • After the rule is corrected, the verification can be run again and the tested behaviors pass

What makes it useful

LegacyProof focuses on a practical modernization workflow:

discover, inspect, execute, compare, review, and verify

Its current value is not full automation. Its value is giving teams a local, reproducible way to inspect evidence and verify whether important tested behaviors survived a rewrite.

What comes next

Future versions may include:

  • Stronger rule extraction
  • Local process-based sandboxed runners
  • Support for more languages
  • CI/CD integration
  • Pull request reporting
  • Editor integration
  • AI-assisted explanation layers on top of deterministic verification

The current MVP already provides the core foundation: evidence-based inspection plus deterministic behavior comparison.

Built With

Share this project:

Updates