The Physical Laws of AI Migrations: Architecting an LLM Orchestrator that Survives Reality A developer architecting an LLM orchestrator for large codebase migrations discovered that naive implementations fail under real-world load due to race conditions, Git lock collisions, and resource exhaustion. By applying distributed systems principles—such as using an append-only ledger for state, isolated Git worktrees for parallelism, and bounded retry loops—the orchestrator can survive reality and complete migrations without blocking concurrent development. Large codebase migrations are not typing problems; they are distributed state machine problems. When you attempt to execute a multi-step, multi-PR refactor using an LLM—such as the workflows I proposed in this migration-orchestration-skill https://github.com/mhosseinab/skills/blob/master/migration-orchestration/SKILL.md —you are not just writing code. You are instantiating a distributed system. Your orchestrator is the control plane, your LLM subagents are asynchronous worker nodes, and the local repository is your shared database. Most AI workflow documentation assumes a "happy path" where agents neatly read instructions, edit files, and check off a Markdown list. This is whiteboard architecture at its most naive. In reality, agents hallucinate, Git locks up, test suites hang, and state files corrupt. To build an orchestrator that actually finishes a migration, we must align our architecture with the mechanical realities of the environment. The core business requirement is to safely sequence, verify, and commit a massive architectural change e.g., migrating a monolith to partitioned micro-databases or rewriting React classes to hooks without blocking concurrent human feature development. The fundamental distributed systems headache? You are coordinating asynchronous, non-deterministic compute nodes LLM agents attempting concurrent mutations against a rigidly sequential, locally-locked state store the local filesystem and Git . If you don't engineer strict boundaries, the result is corrupted code, blown context windows, and thousands of dollars in wasted API tokens. The standard MVP implementation breaks the migration into discrete steps S1..Sn , defines a dependency graph, and instructs an orchestrator to spawn concurrent subagents for any steps that touch "disjoint files." The state of the migration is tracked by having agents read and update a human-readable