KatalockAi AcademyBack to KatalockAi
Capstone 9, counts toward Phase 17

Code migration agent

Combine deterministic codemods with an agent loop to migrate real repositories to a new language or runtime version, gate on tests and coverage, and publish a failure taxonomy.

about 30 h Earns its own certificate Reviewed against a 7-point rubric
Submit your project Get coached by Professor Katalock

The capstone and what it builds on

  1. 1Code Migration Agent (Repo-Level Language / Runtime Upgrade)The capstone brief
  2. 2The Agent Loop: Observe, Think, ActPhase 14: Agent engineering
  3. 3Tool Use and Function CallingPhase 14: Agent engineering
  4. 4Verification GatesPhase 14: Agent engineering
  5. 5The Workbench on a Real RepoPhase 14: Agent engineering
  6. 6Failure Modes: Why Agents BreakPhase 14: Agent engineering
  7. 7The Autonomous Coding Agent Landscape (2026)Phase 15: Autonomous systems
  8. 8Action Budgets, Iteration Caps, and Cost GovernorsPhase 15: Autonomous systems

What You'll Build

A migration pipeline that upgrades repositories (for example Python 2 to 3, Java 8 to 17, or a major library upgrade) in two layers: deterministic recipes first, then an agent loop for what recipes cannot fix. Each repo runs in a sandbox; a branch only counts as migrated when tests pass and coverage holds. Failures are classified into a taxonomy with exemplar diffs.

Requirements

  1. Recipe pass: deterministic rewrites (OpenRewrite for Java, libcst codemods for Python, or established tools such as 2to3 or bump-pydantic as the substrate) committed as a separate recipe commit.
  2. Sandbox per repo (Docker image with the target runtime) that installs dependencies and runs the build and tests.
  3. Agent loop with tools run_build, read_file, edit_file, run_test, git_diff that classifies each failure (dependency, syntax, test, build tool) and applies a targeted fix, then reruns.
  4. Budget caps per repo on turns (default 20), wall-clock (default 30 minutes) and cost or tokens; any breach stops the run and files it as budget_exhausted with the current diff.
  5. Test and coverage gate: tests must pass and coverage must not drop by more than 2 percentage points versus the original repo; otherwise file as coverage_regression.
  6. Output per migrated repo: a branch and PR on your fork (or a patch plus PR body) listing which commits came from recipes and which from the agent.
  7. Failure taxonomy with classes such as dep_upgrade_required, build_tool_drift, custom_annotation, test_flake, syntax_edge_case, budget_exhausted, each with a count and an exemplar diff.
  8. Baseline: run recipes only (no agent) on the same repos and compare pass rates.
  9. Metrics: pass rate, mean coverage delta, cost per migrated repo and the fraction of fixes made by recipes vs the agent.

Constraints

  • Model-agnostic: any OpenAI-compatible endpoint (including the KatalockAi API) or a local model (for example via Ollama, llama.cpp or vLLM) may be used. No named commercial model is required; record which model you used in the README.
  • Hardware: a laptop with Docker. The Python 2 to 3 path is the lightest; Java needs a JDK and Maven or Gradle in the container.
  • Substitution: the lesson runs a 50-repo MigrationBench subset. Here at least 8 repositories (public legacy repos, a MigrationBench subset, or small legacy repos you construct, clearly labelled as such) are accepted, as long as each has a test suite.
  • Set a cost cap per repo in code and keep total spend small; report actual spend.

Stretch Goals

  • Add a lint-clean gate and measure how often a green migration still regresses style.
  • Add a minimal-diff pass that trims unnecessary agent changes and report diff-size reduction.
  • Extend to a third migration type by swapping the recipe layer.

How to Submit

  • Public GitHub repo with recipes/, sandbox/ (Dockerfiles), agent/, runs/ (per-repo logs, diffs, taxonomy labels), report/ (taxonomy and metrics) and README.md.
  • README: which migration and repos you chose, how to run one repo and the full batch, results vs recipe-only baseline, the taxonomy and limitations.
  • Paste the per-repo results table, the taxonomy summary and one full agent log for a repo the recipes alone could not fix.

How It's Reviewed

Professor Katalock reads your repository and the evidence you paste, and scores each criterion out of 100. You pass with a weighted total of 70 or more and no criterion below 40. A copied or padded submission is flagged and fails.

CriterionWeightHow it's checked
Migration pass rate25Per-repo table for 8 or more repos with tests green after migration, compared with the recipes-only baseline.
Test-coverage preservation15Coverage before and after per repo; gate rejects drops beyond 2 points; mean delta reported.
Cost per migrated repo10Turns, wall-clock and cost per repo logged; caps enforced in code.
Recipe and agent integration15Recipe commits separate from agent commits; fraction of fixes by each reported; agent only engages after the recipe build fails.
Failure analysis15Taxonomy with counts and an exemplar diff per class, drawn from the learner's own runs.
Code quality and structure10Clear separation of recipe layer, sandbox and agent; runs per README; key logic tested.
README: design decisions and limitations10README explains the migration choice, budget values and classification rules, and states limits.

Submit

Push your work to a public GitHub repository with a README that explains how to run it, then paste the evidence below. Up to 3 reviews a day, free.

  • Per-repo results table (pass, coverage before and after, cost, turns, recipe vs agent fixes)
  • Recipes-only baseline vs full pipeline comparison
  • Failure taxonomy summary with counts
  • One full agent log for a repo where the agent made the difference
  • Short reflection on the hardest failure class and how a new recipe could cover it

Reviews are done by AI against the rubric above. They check the evidence in your repository; they are not a substitute for a human code review, and a review can be wrong. If you think it is, improve the README so the evidence is unmistakable and resubmit.