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 Reassigned Exports, Rerun Exports, and Clustered xargs Options in the Write Guard #3340
Found by the third local review pass on the change for #3050, #3083, #3085, #3304, and #3307 (branch feature/guard-directory-tokenizer-launchers). Each shape is allowed by develop's guard too, so none is a regression. They are near variants the new readers do not reach, filed under the lane's stop rule rather than narrowed in a third round. Each was confirmed with a classify probe on constructed commands.
Shapes the New Readers Miss
A name reassigned after it is exported._exported_states does not track a plain assignment to an already exported name, which _gh_repo_states does for GH_REPO.
cd /example/wt && export GIT_DIR=/example/wt/.git && GIT_DIR=/example/primary/.git && git reset --hard, where /example/primary is a primary checkout
An export after the git word that a function or loop runs first._exported_states reads only the words before the git word, where _repo_may_move reads the whole command under _reruns.
cd /example/wt && f() { git reset --hard; }; export GIT_DIR=/example/primary/.git; f
cd /example/wt && for i in 1 2; do git reset --hard; export GIT_DIR=/example/primary/.git; done
A clustered xargs replace option._xargs_replaces misses -0I{} and -rI{}, and the BSD -J{} spelling.
Track a reassignment of an exported name as _gh_repo_states does, read the whole command where _reruns says a later word may run first, read xargs's replace option inside a cluster, and share one per-word predicate between the two config scans.
One more near variant from the fifth local pass on #3342, allowed by develop too: an assignment sudo passes behind a launcher the guard does not know, as in uv run sudo GIT_CONFIG_GLOBAL=/example/config git status. Behind such a launcher only an env passes its assignments on, while sudo NAME=value cmd sets the environment as well.
Two more from the sixth local pass on #3342, each allowed by develop too:
uv run env GH_REPO=stranger/example gh pr comment 5 --body x. The GH_REPO readers take a launcher's prefix in place of the shell's state, so Read Every Launcher and Exported Git Directory in the Write Guard #3342 keeps develop's reading there, with no assignment after an unknown launcher. Reading those values beside the shell's state rather than in place of it would deny this and keep find ./env -name GH_REPO=... -exec gh ... denied.
coproc example { "$CMD"; }; git push --tags origin. A run-time command word in a named coproc's group is not read, since the walk stops at the name.
One more from the seventh local pass on #3342, allowed by develop too: cd /example/wt && export GIT_DIR=/example/primary/.git && find ./env -name GIT_DIR=/example/wt/.git -exec git reset --hard \;. _launcher_prefix reads any word whose base name is env as the env command, a path such as ./env included, and _git_dir_rereading lets that prefix override every export state. Reading only an env the launcher runs, or reading the prefix beside each state rather than over it, closes it.
Activity
ptr727 commentedon Oct 22, 2026
Two more near variants from the fourth local pass on #3342, each allowed by develop too:
cd /example/wt && set -a && GIT_DIR=/example/primary/.git && git reset --hard, whereset -aexports the plain assignment.cd /example/wt && f() { local -x GIT_DIR=/example/primary/.git; git reset --hard; }; fThe
GH_REPOreading already fails closed onset -a.ptr727 commentedon Oct 22, 2026
One more near variant from the fifth local pass on #3342, allowed by develop too: an assignment
sudopasses behind a launcher the guard does not know, as inuv run sudo GIT_CONFIG_GLOBAL=/example/config git status. Behind such a launcher only anenvpasses its assignments on, whilesudo NAME=value cmdsets the environment as well.ptr727 commentedon Oct 22, 2026
Two more from the sixth local pass on #3342, each allowed by develop too:
uv run env GH_REPO=stranger/example gh pr comment 5 --body x. The GH_REPO readers take a launcher's prefix in place of the shell's state, so Read Every Launcher and Exported Git Directory in the Write Guard #3342 keeps develop's reading there, with no assignment after an unknown launcher. Reading those values beside the shell's state rather than in place of it would deny this and keepfind ./env -name GH_REPO=... -exec gh ...denied.coproc example { "$CMD"; }; git push --tags origin. A run-time command word in a named coproc's group is not read, since the walk stops at the name.ptr727 commentedon Oct 22, 2026
One more from the seventh local pass on #3342, allowed by develop too:
cd /example/wt && export GIT_DIR=/example/primary/.git && find ./env -name GIT_DIR=/example/wt/.git -exec git reset --hard \;._launcher_prefixreads any word whose base name isenvas theenvcommand, a path such as./envincluded, and_git_dir_rereadinglets that prefix override every export state. Reading only anenvthe launcher runs, or reading the prefix beside each state rather than over it, closes it.Read Every Launcher and Exported Git Directory in the Write Guard (#3342
Read Tokenizer, Directory-Value, and Launched-String Gaps in the Writ…
Close Export, Xargs, Env, and Launcher Allow Gaps in the Write Guard (#…