Skip to content
Apex
All recipes
Software

Plan and execute a whole-repo migration

Migrate a Python 3.8 codebase to 3.12 with type-checking enabled. The agent reads the repo, writes a plan, runs the migration, runs the tests, and opens the PR.

Artefact returned
Diff · plan · test report · CVE scan · drafted PR description
Typical runtime
~20 min wall · 60M output tokens
Cost
≈ $900 / migration + Team seats
01 · The recipe

The expanded snippet.

The version that lands in production — with the annotations a colleague would want when picking up the work. Copy-paste, swap in your inputs, run.

from apex import Aether

simos = Aether(api_key=os.environ["APEX_API_KEY"])

# Plan and execute a whole-repo migration. The agent reads the repo, writes a
# plan as a checklist in the PR description, runs the migration, runs the
# tests, runs a CVE scan, and opens the PR — all under the policy below.
edit = simos.code_edit(
    repo="s3://my-bucket/repo.tar",
    intent=(
        "Migrate from Python 3.8 to 3.12. Enable strict mypy. "
        "Update every async-deprecated call. Add tests for type changes. "
        "Open a PR per top-level package."
    ),
    policy={
        "max_files_changed": 800,
        "max_lines_changed": 20000,
        "require_tests_pass": True,
        "require_cve_scan": True,
        "denied_dependencies": ["pycrypto"],
        "preserve_semantics": True,
    },
    review_style="conservative",
    pr_template="org/.github/PULL_REQUEST_TEMPLATE.md",
)

for pr in edit.pull_requests():
    print(
        f"{pr.title}  "
        f"files={pr.files_changed}  "
        f"lines=+{pr.lines_added}/-{pr.lines_removed}  "
        f"tests={pr.tests_status}"
    )
    if pr.cve_findings:
        for f in pr.cve_findings:
            print(f"  - {f.cve_id}: {f.severity} ({f.fix_proposed})")
02 · Reproduction notes

The numbers in this recipe are real.

What we ran. What we used for inputs. Where the reproduction kit lives, and what reproduces within published bounds.

  • 01Repo: any source tree as tar / zip / git-clone-url. The cookbook repo ships a small open Python codebase.
  • 02Reproduces 94% semantic equivalence on the CommitBench refactor benchmark.
  • 03Wall time depends on repo size and test-suite duration; estimate uses 200 PRs/month.
  • 04Token volume scales linearly with files changed; output tokens dominate cost.
03 · How to adapt this

Make it your workload.

The recipe is a starting point. The four variations below are the ones we get asked about most. Anything else, write to docs@apexworldlabs.com.

  • Different language: Aether supports the languages in the API page. Pass language= to bias the planner.
  • Different intent: any natural-language brief is supported. More-specific briefs produce more-targeted PRs.
  • Smaller blast radius: tighten the policy.max_files_changed and the agent will refuse oversized edits.
  • Pair with CI: webhook the PR URL into your CI; the agent re-runs failing tests once before giving up.

Adapt this to your stack.

Swap in your geometry / target / repo and run it. If your workload is novel, send it and we will co-author the recipe with you.