Skip to content

fix(governance): match Auto-mode shell commands more accurately - #359

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/auto-mode-dev-loop-matching
Aug 16, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/auto-mode-dev-loop-matching

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Summary

Auto mode was prompting for ordinary seeded commands because pattern matching treated every |, argv-form command, git global option, and leading env assignment as unsafe shell syntax.

This change:

  • Treats quoted metacharacters as data (rg -n "Auto|Manual") while still requiring approval for unquoted control/expansion (rg | head, cmd; rm).
  • Accepts argv-form shell arguments (["ls", "-la"]) and trims command strings.
  • Strips leading VAR=value assignments 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 --locked
  • In Auto mode, confirm rg -n "Auto|Manual" crates, ls -la, and git --no-pager status --short do not prompt
  • Confirm rg -n Auto | head and git status; echo hi still prompt

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.
@github-actions
github-actions Bot enabled auto-merge (squash) August 16, 2026 07:11
@github-actions
github-actions Bot merged commit 5a60264 into main Aug 16, 2026
7 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant