feat(worktree)!: remove force-discard of a dirty or locked worktree from every surface #233

Merged
hexajon merged 3 commits from issue-208-worktree-force-omission into main 2026-07-17 18:27:11 +00:00
hexajon commented 2026-07-17 18:26:59 +00:00 (Migrated from codeberg.org)

Summary

Implements the ADR 0029 classification for worktrees: discarding a dirty or locked worktree is unrecoverable, so madtea carries no surface that does it. MCP madt_worktrees action=remove drops force= for the discard case (force= is out of the action's accepted param set, so a force=true is rejected before any git call); the CLI loses -f/--force with an actionable redirect to raw git in the user's own shell, mirroring how branch delete refuses its force forms. The #168 elicitation gate (gateForcedWorktreeRemove, ElicitWorktreeForceRemoveConfirm) and the error-swallowing WorktreeForceWouldDiscard retire with it. A dirty/locked remove now refuses with a message naming what would be lost and the raw git worktree remove --force the user can run themselves; a clean remove is unchanged; action=add keeps force= (path/branch reuse destroys nothing). The check-git-worktree hook still blocks raw git worktree for agents, now steering that dirty/locked discard is user-only. Merge commit reconciles with the git-signature add (#171) and the hook-flow removal (#172); full union gate green.

Closes #208

## Summary Implements the ADR 0029 classification for worktrees: discarding a dirty or locked worktree is unrecoverable, so madtea carries no surface that does it. MCP madt_worktrees action=remove drops force= for the discard case (force= is out of the action's accepted param set, so a force=true is rejected before any git call); the CLI loses -f/--force with an actionable redirect to raw git in the user's own shell, mirroring how branch delete refuses its force forms. The #168 elicitation gate (gateForcedWorktreeRemove, ElicitWorktreeForceRemoveConfirm) and the error-swallowing WorktreeForceWouldDiscard retire with it. A dirty/locked remove now refuses with a message naming what would be lost and the raw `git worktree remove --force` the user can run themselves; a clean remove is unchanged; action=add keeps force= (path/branch reuse destroys nothing). The check-git-worktree hook still blocks raw git worktree for agents, now steering that dirty/locked discard is user-only. Merge commit reconciles with the git-signature add (#171) and the hook-flow removal (#172); full union gate green. Closes #208
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea!233
No description provided.