Back to all projects
FLAGSHIP INITIATIVEAug 2026 — Present · Self-Directed Engineering

LegacyExodus

Automated migration-intelligence engine for legacy enterprise codebases.

LegacyExodus is an engineering system designed to analyze monolithic, high-debt enterprise codebases (such as legacy PHP, procedural JavaScript, and un-typed backends) and automate their modernization into memory-safe Rust services and clean TypeScript architectures through deterministic static compiler analysis.

Why Legacy Migration Is Hard

Implicit Data Contracts

Dynamic variables change types across runtime scopes. Undocumented database side-effects and global state mutations are invisibly coupled across distant files.

Circular Dependencies

Legacy modules frequently import or require each other cyclically. Without graph cycle resolution (Tarjan’s strongly connected components), clean layered decomposition is impossible.

Stochastic LLM Hallucinations

Feeding thousands of lines of legacy code directly to generative models results in invented APIs, dropped edge cases, and runtime syntax drift. LLMs lack global semantic guarantees.

The Problem: Monolithic Enterprise Inertia

Global businesses run on millions of lines of unmaintained legacy code. Rewriting these systems from scratch almost universally fails due to budget overruns, undocumented business logic, and lost domain knowledge. Meanwhile, manual line-by-line migration is prohibitively slow and introduces severe regression cascades.

The System Model: Code as a Mathematical Graph

The foundational thesis of LegacyExodus is that a codebase is not text — it is a directed graph. Once code is mapped into formal mathematical structures (AST nodes, execution control flow edges, and variable lifecycle data flow vectors), refactoring transitions from subjective guesswork into a deterministic compiler pipeline.

COMPILER PIPELINE // DECOMPILATION

Static Analysis Engine Flow

From heterogeneous source text into a normalized intermediate representation ready for deterministic target synthesis.

01 // PHASE

Source Code

Monolithic legacy files (PHP 7, procedural JS, un-typed C++)

NEXT
02 // PHASE

Lexing / Parsing

Fault-tolerant Tree-sitter parser emits Concrete Syntax Trees

NEXT
03 // PHASE

AST

Abstract Syntax Trees normalize grammar, expressions & scope trees

NEXT
04 // PHASE

Symbols

Lexical scope registry resolves cross-file exports & global bindings

NEXT
05 // PHASE

Dependency Graph

Directed graph resolves imports, call chains & Tarjan cycles

NEXT
06 // PHASE

CFG / DFG

Branching execution DAGs & variable state lifecycle tracing

NEXT
07 // PHASE

IR

Language-agnostic canonical Intermediate Representation

NEXT
08 // PHASE

Transformation

Deterministic rewrite into memory-safe Rust & modern TypeScript

INTERACTIVE COMPILER ARCHITECTURE

Systems Architecture & Compiler Flow

Inspect the end-to-end transformation DAG: Source (JS/PHP) → Representation (AST) → Analysis (CFG/DFG) → Transformation (IR) → Target (Rust/Axum). Toggle between Beginner and Advanced views.

Systems Architecture & Compiler Flow

From raw legacy source code to verified systems targets — 5 intentional layers of code intelligence.

BeginnerAdvanced

Tap any node to inspect:

04 // CODE INTELLIGENCE

Static Analysis Engine

Connected to:

Deterministic analysis engine synthesizing AST, CFG, and DFG into architectural models.

WHY IT MATTERS: Produces mathematically verified insights without the risks of runtime execution.

Application: The core intelligence hub producing dependency maps and migration readiness scores.

Architectural Principles // How It Connects

  • AST tells us what the code looks like.
  • CFG tells us how execution can move.
  • DFG tells us how data moves.
  • IR gives transformation a neutral intermediate layer.
  • Rust represents one possible systems-oriented target.

FOUNDATIONAL ARCHITECTURAL THESIS

SYSTEM UNDERSTANDING+TASK DECOMPOSITION
= BETTER SOFTWARE

Graph engineering delivers structural ground truth. Deterministic orchestration decomposes complexity into verifiable compiler passes. Together, they replace guesswork with verified software engineering.

STRUCTURAL GROUND TRUTH

Dependency & Graph Engineering

Interactive dependency modeling: nodes represent files, services, or databases; edges define import, call, and depends-on relationships.

Interactive Dependency Graph

# NODE: a thing (file, service, table) · # EDGE: a relationship (imports, calls, depends-on)

Hover or tap any node to inspect
importscallsdepends-onauth.ts[File]UserService[Service]database.ts[Controller]Postgres Driver[Database]
NODE

UserService (Service)

RELATIONSHIPS

called by auth.ts · calls database.ts · manages user accounts

PURPOSE

Connects API authorization requests with underlying persistence logic.

DISCIPLINED EXECUTION

Deterministic Workflow & AI Tool Orchestration

Decompose big tasks into research, analysis, synthesis, and validation passes. Enforce token discipline by scoping context to strict AST slices.

Deterministic AI Orchestration

Core principle: One large complex task becomes several specialized, verifiable passes.

[ INPUT ]

Problem specification

[ ACTION ]

Traces call graphs & isolates impacted functions

[ OUTPUT ]

Minimal modification manifest

AI Tool Orchestration

Conceptual synergy: How modern tools contribute specialized roles without conflicting.

Codex// Implementation
Code completion & routine syntax generation
Claude// Architecture
Deep reasoning, systems planning & AST decomposition
Cursor// Local Navigation
File-level editing & fast inline diffs
Grok// Research
Alternative perspectives & real-time external querying
Antigravity// Orchestration
Multi-step autonomous agent workflow execution
RESULTS → Human review → Validated production code

Token Discipline

Engineering efficiency: High reasoning fidelity without wasteful context pollution.

ANTI-PATTERN // UNSTRUCTURED MONOLITH DUMP
Raw Repo DumpContext SaturationRate Limit & Drift
DISCIPLINED FLOW // HIGH-FIDELITY AST PIPELINE
AST Index OnceScoped Sub-GraphTarget SynthesisAutomated Verify

* Optimize token budgets by using free tiers where available and caching static AST indexes.

Architectural Principles

01 // PRINCIPLE

Deterministic Core

Mathematical compilers and static analysis rules form the immutable backbone of every migration — never subjective guesswork.

02 // PRINCIPLE

Structured Representation

Code is mapped into formal AST nodes, CFG branches, and DFG lifecycles rather than treated as unformatted plain text.

03 // PRINCIPLE

Graph-Based Understanding

Topological sorting and Tarjan's Strongly Connected Components break monolithic circular dependencies into solvable DAGs.

04 // PRINCIPLE

Targeted AI Assistance

Generative models receive isolated, strongly-typed IR contracts for discrete tasks, enforcing strict token economy.

05 // PRINCIPLE

Automated Verification

Every synthesized module must pass compile-time type checks (`tsc`, `rustc`), AST equivalence audits, and regression tests.

Target Architecture: Modern TypeScript & Memory-Safe Rust

TARGET A

TypeScript Microservices

Synthesizes strict, type-safe Next.js or Node.js modules. Implements explicit interface contracts, Zod schema validation, and async/await primitives to replace callback hierarchies.

TARGET B

Rust / Axum Services

Synthesizes high-throughput Rust backend services. Converts legacy database calls into compile-time checked SQLx queries, using Rust's affine type system to guarantee zero memory leaks and thread safety without garbage collection pauses.

Current Status & Active Build Roadmap

PHASE: ACTIVE R&D & CORE PARSER BENCHMARKS

LegacyExodus is being engineered as a public-facing developer tool. The current implementation is focused on:

Tree-sitter Grammar Integration: Hardening syntax extraction across varied PHP and ECMAScript versions.

IR Specification & Schema: Establishing a strongly-typed JSON intermediate format for control flow DAGs.

Rust Codegen Prototyping: Benchmarking generated Axum REST handlers against original legacy execution speeds.

Discuss enterprise codebase migrations →
raitaskeen