Skip to content

Worktrees & Isolation

Git branches isolate code changes, but they do not isolate ports, databases, or daemon state. If two agents run tests against a shared development database or dev server port, they silently corrupt each other’s work.

Factory mandates one ticket, one worktree.

Each dispatchable repository declares worktree_up, worktree_down, and worktree_root in config/repos.yaml:

Terminal window
bin/worktree-up.sh <TICKET-ID> # spins up isolated environment
bin/worktree-down.sh <TICKET-ID> # tears down and cleans up