Repository navigation
fix(governance): match Auto-mode shell commands more accurately - #359
Merged
Merged
Conversation
Treat quoted metacharacters as data, accept argv-form commands, and ignore leading env assignments plus git global options so seeded dev-loop commands stop prompting while compound shell programs still require approval.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
Treat quoted metacharacters as data, accept argv-form commands, and ignore leading env assignments plus git global options so seeded dev-loop commands stop prompting while compound shell programs still require approval.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
Treat quoted metacharacters as data, accept argv-form commands, and ignore leading env assignments plus git global options so seeded dev-loop commands stop prompting while compound shell programs still require approval.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
Treat quoted metacharacters as data, accept argv-form commands, and ignore leading env assignments plus git global options so seeded dev-loop commands stop prompting while compound shell programs still require approval.
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
Auto mode was prompting for ordinary seeded commands because pattern matching treated every
|, argv-formcommand, git global option, and leading env assignment as unsafe shell syntax.This change:
rg -n "Auto|Manual") while still requiring approval for unquoted control/expansion (rg | head,cmd; rm).["ls", "-la"]) and trims command strings.VAR=valueassignments and git global options (--no-pager,-C) before matching seed patterns.Compound programs still fail closed.
Test plan
cargo test --package forge-governance --all-targets --lockedrg -n "Auto|Manual" crates,ls -la, andgit --no-pager status --shortdo not promptrg -n Auto | headandgit status; echo histill prompt