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 Short-Option Clusters Through One Primitive in the Write Guard #3071
host-setup/agent-safety/claude/gh-write-guard.py reads a short-option cluster, such as -iu or -mF, in three places, each with its own copy of the rule:
_option_takes_next, for a precommand such as sudo -iu root.
_short_push_cluster and takes_next in _push_readings, for a push's -o.
The cluster branch of _is_commit_value_option, for a commit.
The rule is that the first letter taking a value consumes the rest of the word, and takes the next word only where it ends the word. The commit site checks only the last letter instead. So git commit -mF x is read as -F taking x, while git reads -m taking F as the message and x as a pathspec.
Fix
One primitive, given the letters that take a value, answering whether a cluster takes the next word, and each of the three sites moved onto it. The commit site's verdict changes are to be checked against develop's with a differential over constructed commit commands.
Found by a local review pass on the promotion fix for #3064. The precommand site is new there, and the two older sites are pre-existing.
A fourth site joins this class in the lane closing #3093, #3080, #3067, #3089, #3079, and #3069: _cluster_repo_value reads a gh short-option cluster for its R, as pflag does, so -dR x is -d -R x. It walks the letters until one takes a value, which takes the rest of the word or the next word, the same rule as the three sites above. The one primitive this issue asks for should take that site too, and the lane leaves it on its own helper so its differential stays scoped to the gh write class.
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
Carry Shell Environment, Option Clusters, and Alias Sources Into the …
ptr727 commentedon Oct 16, 2026
A fourth site joins this class in the lane closing #3093, #3080, #3067, #3089, #3079, and #3069:
_cluster_repo_valuereads a gh short-option cluster for itsR, as pflag does, so-dR xis-d -R x. It walks the letters until one takes a value, which takes the rest of the word or the next word, the same rule as the three sites above. The one primitive this issue asks for should take that site too, and the lane leaves it on its own helper so its differential stays scoped to the gh write class.Read a gh Write's Subcommand and Target the Way gh Parses Them (#3135)
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.