feat(worktrees): conflict-bearing operations run in an ephemeral linked worktree, never the primary checkout — revert/reconcile stop wedging the user's tree #20
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#20
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?
Problem (2026-07-10, companion to #19/#18/#14)
Operations that can conflict currently execute in the caller's PRIMARY checkout and, on conflict, leave it mid-operation:
madt_prs action=reverton a recent PR rangit revertin the primary checkout (freshly on main): on the modify/delete conflict it returned "resolve and commit manually", leaving the checkout on an auto-created revert branch in revert-in-progress state. Resolution then happened via rawrmof a tracked file + a--continueform (the #19 gap) — in the primary tree.madt_orchestrate reconcile=(when reachable, #18) likewise checks out and merges in the caller's checkout.git merge origin/mainon a PR branch) have the same shape: conflicted state parked in the shared checkout.If the session dies mid-operation the primary checkout is wedged (MERGE_HEAD/REVERT_HEAD, unmerged index) — the next session or the human inherits it. The clobber surface is the one tree everybody shares, when the house pattern (ADR 0019 for foreign repos;
.worktrees/for parallel agents) already says: mutation-risky work belongs in a disposable linked worktree.Ask
.worktrees/madtea-revert-<pr>or an OS-temp worktree):madt_prs action=revert, orchestrate reconcile (once #18 fixes its schema), and orchestrate's bisect/revert stages. Clean path: operate in the worktree, push/PR from there, remove the worktree; the primary checkout never changes branch and never enters an in-progress state. Conflict path: the error rail names the WORKTREE path and the sanctioned resolution tools (madt_add dir=+madt_commit dir=per #19's capability), andmadt_worktrees action=remove force=trueas the clean abandon — abandoning a conflicted attempt becomes discarding a disposable directory, not un-wedging the shared tree.git merge <ref>/git reverttargets a primary checkout, the (advisory, per ADR 0021 — merge is a read-adjacent local op with legitimate uses) steer suggests the worktree flow for conflict-risky merges instead of the in-place one..worktrees/(gitignored) or the OS temp dir — never a second permanent checkout.Acceptance
madt_prs action=revertleaves the primary checkout untouched (same branch, clean tree, no in-progress state) with the conflict parked in a named worktree; hermetic test.