Ten coders, one codebase
Ten coding agents can write code at the same time. They cannot all land it at the same time. Put them in one working folder, and they overwrite each other’s files, and a test turns red because of a neighbour’s half-finished change.
The answer is known: a branch and a working copy per task, merged one at a time. With agents, it needs these additional constraints:
- No separate copy, no parallel work. Every task gets its own git worktree on its own branch, and two agents never share either. If the repository cannot make a worktree, the agents work one at a time.
- Order from the plan. A plan is a graph of tasks. A task starts only when the tasks it depends on have landed. Two tasks of one plan that change the same file become one task.
- One merge at a time. Finished branches wait in a queue and land in the order they finished. A conflict is never handed to an agent to resolve: the merge is rolled back, and the task is redone on a fresh branch after its neighbour has landed.
- Checks before and after. The same checks run on the tree before the merge and after it. A check that this merge broke stops it; a check that was already red does not. We learned this when a task was sent back, and handed to a stronger, more expensive model, for a test that another task had broken.
- Release after verification. Merged code reaches users only after the tested build passes its acceptance criteria.
The theory. Graydon Hoare called it the Not Rocket Science Rule: automatically maintain a repository of code that always passes all the tests. GitHub’s merge queue and GitLab’s merge trains apply the same idea to pull requests. With agents the rule matters even more: an agent does not know that its neighbour exists.
The price. Merges wait in line, and a conflict costs a whole retry. Ten agents on one file are one agent: the work runs only as parallel as the plan splits it into independent tasks.