commit and finish treat add-dir working directories as foreign #577
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#577
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
madt_commitandmadt_finishrefuse the primary checkout of a repository whose toplevel sits outside the server's launch directory, and point the caller at a linked worktree instead. The in-scope check reads the launch directory only. A directory added to the working-directory set after launch (add-dir) is not counted, so a repo under such a directory is treated as foreign and cannot be committed to through its normal surface.The refusal is explicit:
Why it is wrong
The guard exists to stop a caller mutating a checkout it does not own: a repo that merely happens to be on disk, that another scope may be using. That reasoning does not hold for a directory the operator added by hand as a working directory. Adding it is the statement of ownership and intent to work there.
madtea's own guards already disagree about it. The file-edit guard permits native edits to a repo under an added working directory, because it keys on the working-directory set. The commit and finish path refuses the same repo in the same run, because it keys on the launch directory alone. So add-dir half-works: edit yes, commit no, and the operator is pushed to a linked worktree for a repo they explicitly opened for work, or back to raw git.
Proposed shape
Define in scope as the union of the launch directory and every directory added to the working-directory set, everywhere the foreign check runs. A repo whose toplevel is under any of them is owned by this scope and writable on its primary checkout. A repo under none of them stays foreign, and the worktree stays the sanctioned path for it.
This refines ADR 0019's in-scope definition; it does not remove the guard. A repo the operator never named is protected exactly as today.
Acceptance criteria
madt_commitandmadt_finishon its primary checkout, no worktree required.Relates to #571 and ADR 0019.
madt_adrand other MCP tools cannot target a nested repo, because they take nodir=#638