How a run executes, from intake to pull request
The full lifecycle, in the order it happens, with the architectural detail platform engineers ask for first. You should not have to read the documentation to understand where code executes and what leaves your network.
The execution lifecycle
Twelve stages. A run can stop, wait for a person, or fail at any of them without losing the task or the evidence produced so far.
- 01Task creation or issue importPerson or issue provider
The objective arrives from a person or is imported from GitHub, Linear or Jira. The upstream system stays authoritative for its own status.
- 02Requirements clarificationPlanner session and person
The planner turns the objective into numbered requirements and states its assumptions. Anything ambiguous is asked, not guessed.
- 03Workflow selectionControl plane
A workflow decides which roles participate, which tools they may use, which checks must pass and where approval is required.
- 04Worker reservationScheduler
The run reserves a concurrency slot on a worker matching the required labels, and holds it for the life of the run.
- 05Worktree and workspace creationRuntime worker
A Git worktree is created from the worker’s local mirror, then the Docker Compose environment for the repository starts, including a preview service when the task needs one.
- 06Plan and sub-agent delegationPrimary agent session
The primary session publishes a plan of steps mapped to requirements and delegates steps to specialist sessions, each with its own permissions.
- 07Tool and MCP activityAgent sessions
Sessions read and write files, run commands and call MCP tools inside the workspace. Destructive tool use can require approval before it runs.
- 08Human interventionPerson
A reply in the task redirects the run. Pausing holds the slot; cancelling can keep the workspace for inspection.
- 09Tests and previewRuntime worker
Unit tests, type checks and preview smoke tests run in the workspace. Each result attaches to the requirement it addresses.
- 10Oversight review and merge workspaceReviewer and oversight sessions
Parallel work is integrated in a controlled merge workspace. An independent reviewer reads the combined diff against the requirements ledger.
- 11Approval and pull-request creationPerson, then control plane
A named person approves the handoff with the evidence in view. BranchRunner pushes the branch and opens the pull request.
- 12Completion, retention or cleanupControl plane
The run closes with its evidence and audit record. Workspaces are retained or removed on policy; failed runs are kept for inspection.
System architecture
Three planes. The control plane decides and records. Runtime workers execute. External providers are reached deliberately, per run, under credentials you supply.
Coding agents execute inside the workspace on a worker. The control plane holds state and decisions.
Concurrent sessions get their own worktree when required, so they cannot overwrite each other.
An oversight stage integrates parallel work in a controlled merge workspace before it moves toward the main development branch.
New worktrees come from the worker's local mirror. Git credentials are needed only for remote fetch, push and pull-request operations.
Runtime workers and scheduling
A worker is a machine with Docker and the BranchRunner worker agent. It registers with the control plane, advertises labels and capacity, and receives run reservations.
docker run -d --name branchrunner-worker \ -v /var/run/docker.sock:/var/run/docker.sock \ -v branchrunner-mirrors:/var/lib/branchrunner \ -e BR_CONTROL_PLANE=https://branchrunner.internal \ -e BR_JOIN_TOKEN=$BR_JOIN_TOKEN \ -e BR_LABELS=region=eu-west,network-zone=private \ ghcr.io/branchrunner/worker:1.0
One concrete run
TASK-482, second attempt, in an example repository. Timestamps are from the run's audit record.
When a run does not succeed
A failure is an outcome with evidence, not a dead end. The task survives, the workspace can be kept, and the next attempt starts from what the last one produced.
The preview could not start because port 3000 never became healthy. The workspace and container logs were preserved. Review the health check or retry with the current environment.
A session asked to run a destructive command. The run holds its worker slot and waits. Declining records the decision and the agent's next action.
Spend hit the hard limit. The run ended, the diff and evidence so far were retained, and the owner was notified with the remaining requirements.
The reviewing session found an unsatisfied requirement. The run returns to implementation with the finding attached, without losing the plan.
Read it, or run it
The architecture is documented in full, and the Community edition is the same platform described on this page.
