Symptom
During /orchestrate 269 (runId prd269-20260604-105556), every slice merge printed:
failed to delete local branch orchestrate/slice-<N>: ... used by worktree at ...
That local-delete warning is expected and documented — the slice worktree still has the branch checked out, and the skill performs the authoritative local reclamation via the explicit git branch -D at step 9 (SKILL.md lines 953–954, 1017–1021).
The unexpected part: the remote slice branches orchestrate/slice-271..275 also survived on the remote and had to be deleted manually with git push origin --delete. Confirmed after the run via:
git ls-remote --heads origin 'orchestrate/slice-*'
Evidence this is systemic, not a one-off
The same ground-truth query today still shows stale slice branches from a prior run (PRD #241):
refs/heads/orchestrate/slice-144
refs/heads/orchestrate/slice-145
refs/heads/orchestrate/slice-146
refs/heads/orchestrate/slice-147
refs/heads/orchestrate/slice-148
refs/heads/orchestrate/slice-149
refs/heads/orchestrate/slice-150
refs/heads/orchestrate/slice-151
refs/heads/orchestrate/slice-152
refs/heads/orchestrate/slice-self-containment
So merged slice branches accumulate on the remote across runs — not a single-run anomaly.
Root-cause hypothesis
SKILL.md §8 reclaims a merged slice branch via gh pr merge <N> --squash --delete-branch and claims (lines 949–954):
The --delete-branch flag reclaims the remote slice branch as part of the merge; it may additionally warn or no-op on the local branch because the slice worktree still has it checked out — that warning is tolerated, not a slice failure.
And §9 restates (lines 1029–1031):
This completes incremental reclamation: the remote half was done by --delete-branch at step 8, the local half here.
The hypothesis: when gh pr merge --delete-branch's local-branch deletion fails (the worktree still has the branch checked out — which is always the case here, since the orchestrator removes the worktree only later at step 9), gh does not (or does not reliably) proceed to delete the remote head branch either. The result is that the "remote half done by --delete-branch" claim does not hold whenever a worktree is checked out — i.e. on every slice.
Impact
Remote-branch cruft accumulates on origin every run. The step-8 / step-9 SKILL.md guarantee ("remote half done by --delete-branch") is false in the normal path, so the documented incremental-reclamation invariant silently leaks remote branches.
Load-bearing references
plugins/orchestrate/skills/orchestrate/SKILL.md:949-954 — the "--delete-branch reclaims the remote slice branch" claim.
plugins/orchestrate/skills/orchestrate/SKILL.md:1017-1021 — the explicit git branch -D local reclamation at step 9.
plugins/orchestrate/skills/orchestrate/SKILL.md:1029-1031 — the "remote half was done by --delete-branch at step 8" claim.
Suggested fix (any one of these)
- Backstop in §9 (preferred — smallest, idempotent): after
remove_worktree + git branch -D, add an explicit remote-delete backstop:
git push origin --delete orchestrate/slice-<N>
This is idempotent — an already-absent remote branch is success (exit 0 or a tolerated "remote ref does not exist"), so it is safe on resumed runs where --delete-branch did succeed.
- Orchestrator verify-and-delete: after merge, have the orchestrator
git ls-remote --heads origin orchestrate/slice-<N> and delete the remote head if it survived.
- Cleanup sweep extension: extend the
/orchestrate clean sweep to prune merged remote slice branches.
If the backstop is added, the §8/§9 prose should be corrected: the "remote half is done by --delete-branch" claim only holds when no worktree has the branch checked out, which is never true in the normal path — so the remote reclamation must move to (or be backstopped at) step 9.
Lineage
Closed #232 ("orchestrate: cleanup enforcement — incremental slice-branch reclamation + failed-worktree retention/reclaim") introduced the incremental-reclamation design and the now-falsified "remote half done by --delete-branch" assumption. This issue is the field regression of that assumption — not a duplicate (#232 is closed and describes the design, not this failure mode).
Run: prd269-20260604-105556 · plugin: orchestrate
Symptom
During
/orchestrate 269(runIdprd269-20260604-105556), every slice merge printed:That local-delete warning is expected and documented — the slice worktree still has the branch checked out, and the skill performs the authoritative local reclamation via the explicit
git branch -Dat step 9 (SKILL.mdlines 953–954, 1017–1021).The unexpected part: the remote slice branches
orchestrate/slice-271..275also survived on the remote and had to be deleted manually withgit push origin --delete. Confirmed after the run via:Evidence this is systemic, not a one-off
The same ground-truth query today still shows stale slice branches from a prior run (PRD #241):
So merged slice branches accumulate on the remote across runs — not a single-run anomaly.
Root-cause hypothesis
SKILL.md§8 reclaims a merged slice branch viagh pr merge <N> --squash --delete-branchand claims (lines 949–954):And §9 restates (lines 1029–1031):
The hypothesis: when
gh pr merge --delete-branch's local-branch deletion fails (the worktree still has the branch checked out — which is always the case here, since the orchestrator removes the worktree only later at step 9),ghdoes not (or does not reliably) proceed to delete the remote head branch either. The result is that the "remote half done by--delete-branch" claim does not hold whenever a worktree is checked out — i.e. on every slice.Impact
Remote-branch cruft accumulates on
originevery run. The step-8 / step-9 SKILL.md guarantee ("remote half done by--delete-branch") is false in the normal path, so the documented incremental-reclamation invariant silently leaks remote branches.Load-bearing references
plugins/orchestrate/skills/orchestrate/SKILL.md:949-954— the "--delete-branchreclaims the remote slice branch" claim.plugins/orchestrate/skills/orchestrate/SKILL.md:1017-1021— the explicitgit branch -Dlocal reclamation at step 9.plugins/orchestrate/skills/orchestrate/SKILL.md:1029-1031— the "remote half was done by--delete-branchat step 8" claim.Suggested fix (any one of these)
remove_worktree+git branch -D, add an explicit remote-delete backstop:--delete-branchdid succeed.git ls-remote --heads origin orchestrate/slice-<N>and delete the remote head if it survived./orchestrate cleansweep to prune merged remote slice branches.If the backstop is added, the §8/§9 prose should be corrected: the "remote half is done by
--delete-branch" claim only holds when no worktree has the branch checked out, which is never true in the normal path — so the remote reclamation must move to (or be backstopped at) step 9.Lineage
Closed #232 ("orchestrate: cleanup enforcement — incremental slice-branch reclamation + failed-worktree retention/reclaim") introduced the incremental-reclamation design and the now-falsified "remote half done by
--delete-branch" assumption. This issue is the field regression of that assumption — not a duplicate (#232 is closed and describes the design, not this failure mode).Run:
prd269-20260604-105556· plugin:orchestrate