Repository navigation
flow_alarm: read the command word, not the raw text, at the stop-starting cap - #2178
Merged
Merged
Conversation
…ting cap At the stop-starting cap the hook denied every Bash command whose raw text matched `gh pr create`, so a grep, an echo, a commit message or an issue body that only named the command was blocked, while a quoted or escaped form was not matched at all. The hook now denies a command that names the text unless every command in it is a known text tool, and every step that drops text before parsing keeps it when the input is ambiguous (keep means deny). An independent review found five ways to run the command past the first version: an assignment prefix that makes git run its value, the `pr new` alias and flags between `pr` and `create`, and a mention that sat only in a comment or heredoc body escaping the file-write and git rules. Each is now denied and pinned by a regression test; a command word that is a path is no longer a text tool, and the residual list in the docstring and changelog names what still passes. Tests: test_flow_alarm 22/22; run-ci-tests --affected 6/6 suites; changelog fragments 23/23 Closes #2165 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
flow_alarm.py's stop-starting hook now denies a command that can rungh pr create, not every command whose text names it, so greps, echoes and commit messages pass at the cap (tests 10 → 22).ghcounts as one outsidepr create,pr newandapi, and a command word that is a path never does.pr newalias, flags betweenprandcreate, and mentions hidden in a comment or heredoc body.Closes #2165
Verification
Run on this head:
test_flow_alarm.py22/22;run-ci-tests.sh --affectedwith the derived files rebuilt first, as CI does: 6/6 selected suites pass.🤖 Generated with Claude Code