Run every pipeline run in its own worktree

A fresh run started from a repository's main checkout gets its own
worktree and branch next to the repository, so runs never share a tree
or see the operator's uncommitted work, and several can run at once.
Retries and runs started in a linked worktree keep their directory. A
clean, landed run tree is removed after success; anything else is kept.

The delivery gate commits what the land stage left uncommitted in a run
worktree, and no longer requires the operator's main checkout to be
clean: Git's fast-forward refuses safely when a local change conflicts.
This commit is contained in:
2026-11-10 16:06:40 +00:00
parent d77b36f56f
commit 532ba48927
9 changed files with 537 additions and 29 deletions
+4 -1
View File
@@ -242,7 +242,10 @@ func TestUISkipOverBudgetGitWorkspaceRunsModel(t *testing.T) {
}
git("add", ".")
git("commit", "-qm", "fixture")
detail, visited, verdictCalls := runUISkipIn(t, uiReviewerSource(true), map[string]string{"implement": target}, dir)
// A linked worktree runs in place (a main checkout would get its own tree).
item := filepath.Join(t.TempDir(), "item")
git("worktree", "add", "-q", "-b", "item", item)
detail, visited, verdictCalls := runUISkipIn(t, uiReviewerSource(true), map[string]string{"implement": target}, item)
capture := detail.Steps[0].FileChanges
// Clean tracked files take their baseline from Git, so the budget no longer
// runs out and the edited file keeps a full patch.