You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Read a cd or pushd Word as the Builtin Only in Command Position in the Write Guard #3319
Rule 6 of the write guard scans every token named cd, pushd, popd, or chdir as that builtin, wherever the token sits. _cd_dot_dot does this, and so does the directory-stack check added on the pull request closing #3048. Since that pull request reads a bare pushd or popd as a move to a stack directory, the word pushd or popd ending a command now fails closed on any later mutating git command in the same call. That holds even where the word is only an argument.
This is an over-denial, low in likelihood, and it fails closed. It was found by the local review on that pull request. Per that lane's rule it is filed rather than narrowed.
Reproduction (constructed commands)
Classify each of these in a linked worktree session:
which popd; git add x
git commit -m popd
Each is denied, naming a bare pushd or popd. Neither moves the shell.
Possible Direction
Read a cd/pushd/popd/chdir word as the builtin only in command position. The guard already tests that for other rules (_runs_as_command). Move both _cd_dot_dot and the directory-stack scan onto it, since they share _cd_argument.
Closed as out of the write guard's scope under the maintainer's decision (ptr727, 2026-10-23) on #3391, item 1. The guard bounds a good-faith agent's mistake rather than an adversary, so a parse gap reached only by a command shape no agent plausibly types in a coding session is closed rather than fixed, and the guard's own growth is a cost each later review pays again. The scope statement lands in the guard's docstring and README under #3391. Reopen only with a command a session actually produced.
Activity
Judge a Push Against the Repository and Branches It Actually Writes (#…
ptr727 commentedon Oct 23, 2026
Closed as out of the write guard's scope under the maintainer's decision (ptr727, 2026-10-23) on #3391, item 1. The guard bounds a good-faith agent's mistake rather than an adversary, so a parse gap reached only by a command shape no agent plausibly types in a coding session is closed rather than fixed, and the guard's own growth is a cost each later review pays again. The scope statement lands in the guard's docstring and README under #3391. Reopen only with a command a session actually produced.