Problem
The reworked push gate (the make ci-remote PR that closes #790) judges each gh pr / gh api call on its own, including code handed to a shell and code inside $(…). Review of that change found three forms it still does not judge. Each is less common than the forms the PR covers, so they were left for this follow-up rather than another round on that PR. The gate's stated goal is guarding against accidents, not deliberate workarounds.
Forms not judged
All three are inferred from reading .claude/hooks/agent-bash-gate.sh on that branch; none was run.
-R / --repo between pr and its subcommand. gh pr -R o/r ready 12, gh pr --repo o/r create … and gh pr --repo=o/r review 12 --approve. The gate reads the first word after pr as the subcommand, here -R. Whether gh accepts the flag in that position is unverified (it is a persistent flag on gh pr, which suggests it does). The gate already handles -R before pr.
- Leftover code past the 64-piece cap, when the mention is quoted; and
${x:-$(…)}. Past the cap, leftover pieces are refused only if they match the gate's gh regex, which expects gh after start-of-line, whitespace or a separator, so a quoted 'gh pr ready' in a leftover piece (for example $(bash -c 'gh pr ready 12') as the 65th piece) is let through unjudged. Separately, a substitution inside a parameter-expansion default, ${x:-$(gh pr ready 12)}, is never queued, because its saved text starts with ${.
-F query=@- or --input - fed by a heredoc on the same line. The body is on the command line, but values starting with @ are skipped. The gate's docs already list --input and -F field=@file as unseen, so this is a documented limit; the same-line heredoc case is the one the gate could read.
Related
#790, #787, #755, #740
Problem
The reworked push gate (the
make ci-remotePR that closes #790) judges eachgh pr/gh apicall on its own, including code handed to a shell and code inside$(…). Review of that change found three forms it still does not judge. Each is less common than the forms the PR covers, so they were left for this follow-up rather than another round on that PR. The gate's stated goal is guarding against accidents, not deliberate workarounds.Forms not judged
All three are inferred from reading
.claude/hooks/agent-bash-gate.shon that branch; none was run.-R/--repobetweenprand its subcommand.gh pr -R o/r ready 12,gh pr --repo o/r create …andgh pr --repo=o/r review 12 --approve. The gate reads the first word afterpras the subcommand, here-R. Whetherghaccepts the flag in that position is unverified (it is a persistent flag ongh pr, which suggests it does). The gate already handles-Rbeforepr.${x:-$(…)}. Past the cap, leftover pieces are refused only if they match the gate'sghregex, which expectsghafter start-of-line, whitespace or a separator, so a quoted'gh pr ready'in a leftover piece (for example$(bash -c 'gh pr ready 12')as the 65th piece) is let through unjudged. Separately, a substitution inside a parameter-expansion default,${x:-$(gh pr ready 12)}, is never queued, because its saved text starts with${.-F query=@-or--input -fed by a heredoc on the same line. The body is on the command line, but values starting with@are skipped. The gate's docs already list--inputand-F field=@fileas unseen, so this is a documented limit; the same-line heredoc case is the one the gate could read.Related
#790, #787, #755, #740