System Architecture

How the behavior-preservation pipeline works under the hood

CodeLoom AI separates static graph analysis and deterministic test execution from AI code generation. No generated code is accepted unless it satisfies the pre-migration behavioral contract.

LAYER 01

Static AST & Cross-Repo Dependency Graph Engine

Parses source trees into an explicit directed graph of modules, symbols, and call sites before any transformation is planned.

  • Builds symbol-level import/export edges across packages and repositories
  • Detects circular dependency clusters and isolates strongly connected components
  • Produces a bottom-up topological queue starting at zero-dependency leaf modules
LAYER 02

Characterization Test Synthesizer & Baseline Runner

Captures observable behavior of the untouched legacy module by generating and executing characterization suites against the original runtime.

  • Synthesizes unit and integration tests covering standard paths, boundary values, and error branches
  • Executes the generated test suite against the unmodified legacy code to establish a green baseline
  • Locks the test assertions as an immutable verification gate for that migration unit
LAYER 03

Constrained Transformation & Automated Repair Loop

Rewrites a single scoped module toward the target stack and iteratively repairs diffs against the locked test suite.

  • Applies target architecture rules (module system, type annotations, framework lifecycle)
  • Runs the locked characterization suite in an isolated sandbox after each edit
  • Feeds assertion diffs and stack traces back into the repair agent if any test flags a mismatch
LAYER 04

Audit-Ready Pull Request Packaging

Emits human-reviewable pull requests only after all baseline characterization checks pass.

  • Scopes diffs to small, single-module units that engineers can review in minutes
  • Attaches structured documentation: What Changed, Why It Changed, and What Verified It
  • Integrates with standard Git code review workflows so human maintainers approve every merge
Interactive Walkthrough

See the 4-layer architecture run on sample legacy modules

Step through leaf-first dependency sorting, characterization test locking, and automated edge-case repair in the browser sandbox.