---
name: factory-worker-dispatch
description: Dispatch one coding lane onto a new isolated worktree, then open a pull request, with only one worker per tree. Use when an orchestrator hands a single scoped change to a builder agent.
license: MIT
---

# Factory worker dispatch

How an orchestrator hands one scoped change, a lane, to a builder.

## Name four things first

Every dispatch names:

1. **Repository**: the repository the lane works in.
2. **Base commit**: the full SHA the new branch starts from.
3. **Ticket**: what to change, and what is out of scope.
4. **Success check**: the command or observation that proves the lane is done, with its expected result.

If any of the four is missing, do not dispatch. Ask for it.

## Dispatch

1. Launch the builder on a new worktree for the lane, on a new branch from the base commit. Never on the live working tree, and never on a sibling clone of the repository.
2. Give the builder the ticket and the success check.
3. The builder commits, pushes its branch and opens a pull request. It reports the pull request and the full head SHA.
4. Start the reviewer only after the builder is done, on that exact head SHA.

## Rules

- **One worker per tree.** Do not start a second worker on a worktree that already has one, or that holds someone else's uncommitted changes.
- **If the dispatch path is down, report once and stop.** Say what failed, once. Do not retry in a loop, and do not route around it by doing the work yourself.
- **The orchestrator stays out of git and out of irreversible steps.** It does not run git, merge, deploy, send messages or pay. It dispatches, reads results and reports.

## Dispatch message

```text
Repository:    <owner/repo>
Base commit:   <full SHA>
Ticket:        <what to change; what is out of scope>
Success check: <command> -> <expected result>
Worktree:      new, under the project's default worktree directory
Deliver:       pull request URL and full head SHA
```
