How block/ai-migrate works
AI Migration Tool is a project-oriented CLI for configuring, running, verifying, and merging LLM-assisted code migrations. The main workflow selects a project and manifest, processes file groups through an LLM migration, verifies results, and records status for review or merge. Setup and management also cover PR-based project initialization, examples, prompts, and generated evaluations. Edges are limited to README-documented behavior or relationships supported by the shown excerpts and SOURCE INDEX; some unsampled subsystems therefore have no asserted call links.
Main entry points: cli.py Interactive CLI · projects.py Project operations · migrate.py File migration · __init__.py Provider selection
Components 24
Project setup
- Interactive CLI
src/ai_migrate/cli.py - Project discovery
src/ai_migrate/projects_root.py - Project operations
src/ai_migrate/projects.py - PR utilities
src/ai_migrate/pr_utils.py - Prompt generation
src/ai_migrate/utils.py - Example management
src/ai_migrate/examples.py - Evaluation generation
src/ai_migrate/eval_generator.py
Migration execution
- Migration manifest
src/ai_migrate/manifest.py - Manifest aggregation
src/ai_migrate/aggregate_manifests.py - File migration
src/ai_migrate/migrate.py - Migration context
src/ai_migrate/context.py - Run progress
src/ai_migrate/progress.py - Kotlin symbol tools
src/ai_migrate/tools/kotlin_symbols.py
Results and review
- Project verification
projects/mini/verify.py - Evaluation runner
src/ai_migrate/run_eval.py - Branch merging
src/ai_migrate/merge_migrator_changes.py
AI and repository integrations
- Provider selection
src/ai_migrate/llm_providers/__init__.py - LLM interface
src/ai_migrate/llm_providers/base.py - OpenAI client
src/ai_migrate/llm_providers/openai.py - Fake LLM client
src/ai_migrate/fake_llm_client.py - GitHub PR service
- Git operations
src/ai_migrate/git.py - Git identity
src/ai_migrate/git_identity.py
Other components
- Engineer
Connections 26
- Engineer → Interactive CLI: runs commands
README.md - Interactive CLI → Project discovery: selects project
src/ai_migrate/cli.py - Interactive CLI → Project operations: starts runs
src/ai_migrate/cli.py - Interactive CLI → PR utilities: requests PR setup
src/ai_migrate/cli.py - PR utilities → GitHub PR service: fetches PR details
src/ai_migrate/pr_utils.py - Interactive CLI → Prompt generation: generates prompts
src/ai_migrate/cli.py - Interactive CLI → Example management: manages examples
src/ai_migrate/cli.py - Interactive CLI → Evaluation generation: manages evaluations
src/ai_migrate/cli.py - Evaluation generation → GitHub PR service: reads PR and repo
src/ai_migrate/eval_generator.py - Project operations → Migration manifest: loads run configuration
src/ai_migrate/projects.py - Project operations → Manifest aggregation: aggregates manifests
src/ai_migrate/aggregate_manifests.py - Project operations → File migration: runs file groups
src/ai_migrate/projects.py - Project operations → Run progress: updates status
src/ai_migrate/projects.py - Project operations → Git operations: checks branches
src/ai_migrate/projects.py - File migration → Migration context: uses context
src/ai_migrate/migrate.py - File migration → Provider selection: requests completions
src/ai_migrate/migrate.py - Provider selection → OpenAI client: defaults to
src/ai_migrate/llm_providers/__init__.py - Provider selection → LLM interface: exposes interface
src/ai_migrate/llm_providers/__init__.py - File migration → Git identity: uses identity
src/ai_migrate/migrate.py - File migration → Project verification: runs configured verification
- Project operations → Project verification: runs project checks
src/ai_migrate/projects.py - Interactive CLI → Branch merging: starts merge
src/ai_migrate/cli.py - Branch merging → Git operations: uses branch operations
src/ai_migrate/merge_migrator_changes.py - Engineer → Evaluation runner: runs evaluations
README.md - File migration → Fake LLM client: supports fake responses
src/ai_migrate/migrate.py - Project operations → Kotlin symbol tools: loads project tools