Repository navigation
fix(core): handle simple Bash comments in permission rules #12096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1461c8b
fix(core): handle simple bash comments in permissions
yiliang114 3395c65
test(core): pin bash comment word boundaries
yiliang114 9e29ee4
Merge branch 'main' into codex/11815-bash-comments-safe
yiliang114 3f59491
fix(core): keep monitor and comment-leading commands on the legacy split
yiliang114 aec1282
docs(design): scope the segmentation claim to run_shell_command
yiliang114 f17f500
fix(core): keep whitespace-led Bash comments on the conservative split
yiliang114 83f2c0c
Merge origin/main into codex/11815-bash-comments-safe
yiliang114 d9cf549
docs(core): record the comment-splitting residuals reviewers flagged
yiliang114 124f193
test(core): pin the four unmeasured comment-splitting rows from #11815
yiliang114 61f2c5f
docs(core): record the deny-only ask fall-through R2-1 flagged
yiliang114 879a039
Merge origin/main into codex/11815-bash-comments-safe
yiliang114 2a62ffe
fix(core): keep bash comment scan linear
yiliang114 b0f1713
fix(core): test the comment line, not the `#`, in Bash rule splitting
yiliang114 bc25f00
Merge branch 'main' into codex/11815-bash-comments-safe
yiliang114 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(core): keep whitespace-led Bash comments on the conservative split
`splitCommandForRules` only refused to collapse a `#` sitting at index 0, so any leading whitespace still put the whole line on the comment fast path: `' # noop ; rm -rf /tmp/x'` became one segment that no `Bash(...)` rule can match, and an explicit `deny` rule silently stopped applying even though the index-0 spelling of the same text kept matching. Bash executes nothing for either spelling, so the defect is the permission layer certifying against the user's own rule on incidental whitespace. Require non-whitespace code before the `#`, and keep both design-doc twins (EN + zh-CN, per AGENTS.md) stating the widened precondition and its acceptance criterion. Test-only follow-ups in the same file: - pin the three other Bash-rule consumers on the same segmentation decision (`findMatchingDenyRule`, `hasRelevantRules`, `hasMatchingAskRule`), each bash arm paired with the `cmd` arm that still expects the split, so reverting any one call site to `splitCompoundCommand` goes red; - title each row of the comment table by its command string, so a regression names the flipped input instead of repeating one label 13 times; - hoist the `shellTypeMock` reset to file scope, covering the five later top-level describes that build real PermissionManagers from the same file-global singleton. Co-authored-by: Qwen-Coder <[email protected]> Patrol-Run: qwen-pr-closeout/jmu6a0kjc2c
- Loading branch information
commit f17f500f556defc9e4047c0282d321ae92e2fa74
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.