finish branch= and worktree remove can act on another session's branch #874
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#874
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The gap
Two operations act on another worktree's branch with no owner check in the same repo:
madt_finish branch=<name>pushes, opens a PR for, and merges any local branch, including one checked out in another linked worktree. Its parameter doc says that is the intent (internal/opspec/paramdocs.go:215).madt_worktrees action=removerefuses only a dirty or locked tree, or one whose branch is not on the forge default branch.So one session can merge another session's half-done committed branch, and then remove that session's clean worktree. For a foreign repo, the "created by this session" test is a path convention (a
.worktreespath on a non-default branch,internal/mcp/foreignrepo.go:383), so it does not prove ownership either.I found this while designing the
madt_switchrefusal for a branch that another worktree holds (#867). That refusal now names no step that acts on the holder.What I want
Acceptance criteria
docs/decisions/states the ownership rule formadt_finish branch=andmadt_worktrees action=remove.