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.
Worktree Lifecycle
Section titled “Worktree Lifecycle”Each dispatchable repository declares worktree_up, worktree_down, and worktree_root in config/repos.yaml:
bin/worktree-up.sh <TICKET-ID> # spins up isolated environmentbin/worktree-down.sh <TICKET-ID> # tears down and cleans up