Skip to content

Auto-allow contained git worktree ops in auto mode - #378

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-5637-auto-allow-contained-git-worktree-ops-in-auto-mode
Aug 8, 2026
Merged

Auto-allow contained git worktree ops in auto mode#378
TheGreatAxios merged 3 commits into
mainfrom
cl-5637-auto-allow-contained-git-worktree-ops-in-auto-mode

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Auto-allow contained non-force git worktree add/remove, plus prune and list, in auto mode
  • Still ask on force flags, absolute outside paths, ~, globs, scary basenames, and uncommon subcommands
  • Sibling destinations (../corbits-dispatch-wts/…) skip the outside-workspace ask so dispatch can create worktrees unattended

Fixes CL-5637

Test plan

  • Permission suites: 298 pass / 0 fail
  • Smoke: auto mode allows git worktree add ../corbits-dispatch-wts/foo origin/main
  • Smoke: still asks for git worktree add -f … and git worktree add /tmp/evil

@linear-code

linear-code Bot commented Aug 8, 2026

Copy link
Copy Markdown

CL-5637

Dispatch and issue workflows need unattended worktree add/remove/prune
for sibling paths. Force flags, absolute outside paths, globs, home
expansion, and credential basenames still require operator approval.
@TheGreatAxios
TheGreatAxios force-pushed the cl-5637-auto-allow-contained-git-worktree-ops-in-auto-mode branch from 208e987 to 2215a39 Compare August 8, 2026 18:58
… authority

auto-shell-policy.ts had a second, bespoke containment notion for
uncontained worktree destinations (a scary-basename denylist plus a
"..\" depth counter), separate from path-restriction.ts's isRestricted.
Replace it with isPermittedSiblingWorktreePath, a narrow addition to the
same authority: a not-yet-created path qualifies only if it is a direct
child of the parent directory of cwd or of a registered worktree root.
This is stricter than the old heuristic for nested "container/leaf"
destinations (now ask instead of auto-allow) but still covers the real
need of creating a brand-new sibling worktree with zero registered roots.
@TheGreatAxios
TheGreatAxios merged commit 662a3db into main Aug 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant