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.
Dynamic variables change types across runtime scopes. Undocumented database side-effects and global state mutations are invisibly coupled across distant files.
Legacy modules frequently import or require each other cyclically. Without graph cycle resolution (Tarjan’s strongly connected components), clean layered decomposition is impossible.
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.
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 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.
From heterogeneous source text into a normalized intermediate representation ready for deterministic target synthesis.
Monolithic legacy files (PHP 7, procedural JS, un-typed C++)
Fault-tolerant Tree-sitter parser emits Concrete Syntax Trees
Abstract Syntax Trees normalize grammar, expressions & scope trees
Lexical scope registry resolves cross-file exports & global bindings
Directed graph resolves imports, call chains & Tarjan cycles
Branching execution DAGs & variable state lifecycle tracing
Language-agnostic canonical Intermediate Representation
Deterministic rewrite into memory-safe Rust & modern TypeScript
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.
From raw legacy source code to verified systems targets — 5 intentional layers of code intelligence.
Tap any node to inspect:
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
FOUNDATIONAL ARCHITECTURAL THESIS
Graph engineering delivers structural ground truth. Deterministic orchestration decomposes complexity into verifiable compiler passes. Together, they replace guesswork with verified software engineering.
Interactive dependency modeling: nodes represent files, services, or databases; edges define import, call, and depends-on relationships.
# NODE: a thing (file, service, table) · # EDGE: a relationship (imports, calls, depends-on)
UserService (Service)
called by auth.ts · calls database.ts · manages user accounts
Connects API authorization requests with underlying persistence logic.
Decompose big tasks into research, analysis, synthesis, and validation passes. Enforce token discipline by scoping context to strict AST slices.
Core principle: One large complex task becomes several specialized, verifiable passes.
Problem specification
Traces call graphs & isolates impacted functions
Minimal modification manifest
Conceptual synergy: How modern tools contribute specialized roles without conflicting.
Engineering efficiency: High reasoning fidelity without wasteful context pollution.
* Optimize token budgets by using free tiers where available and caching static AST indexes.
Mathematical compilers and static analysis rules form the immutable backbone of every migration — never subjective guesswork.
Code is mapped into formal AST nodes, CFG branches, and DFG lifecycles rather than treated as unformatted plain text.
Topological sorting and Tarjan's Strongly Connected Components break monolithic circular dependencies into solvable DAGs.
Generative models receive isolated, strongly-typed IR contracts for discrete tasks, enforcing strict token economy.
Every synthesized module must pass compile-time type checks (`tsc`, `rustc`), AST equivalence audits, and regression tests.
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.
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.
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.