Repository navigation
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Keep the literal leading source of commands with inline assignments in shell approval proposals from both scanners. Retain raw authorization resources and omit proposals whose new prefix cannot be represented literally by the matcher. Leave no-assignment proposals unchanged. Constraint: Preserve raw authorization and configured deny precedence Not-tested: Installed CLI update and Windows execution
zenv-dev
force-pushed
the
env-saved-pattern
branch
from
October 8, 2026 10:16
92b202a to
4e30a67
Compare
Extend the native shell approval fixture so an additional assignment, a different executable and a bare command must still ask before the auxiliary broad grant is added. Also inline the single-use scan argument, rename the changed-argument check and label each scanner assertion so a failure names the scanner that ran. Constraint: raw authorization unchanged; test-only, no production change
This branch has not been deployed
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.
Issue for this PR
Fixes #52720 (saved-pattern mismatch). Related: #45914.
Type of change
What does this PR do?
Always allow drops leading environment assignments, so a saved rule cannot match a repeated command. Commands with inline assignments keep their literal leading source, including preceding redirects, in native V2 proposals from both shell scanners. Raw permission checks, deny precedence, unprefixed proposals, PowerShell handling and executable arity are unchanged. Proposals whose new prefix contains
*,?or\are omitted rather than widened; no env-stripped authorization fallback.How did you verify your code works?
From
packages/core, via the isolated test wrapper:bun run check: 36 of 36 tasks, exit 0, pre-existing lint output only; focused lint and Prettier clean.v2.0.25and mainline snapshot62e087ff; source checkouts only, release binary not executed.printf *rule, and writes no marker. Controlled broader grants make these checks fail for both scanners while waiting for the required prompt. Scanner messages nameportableorTree-sitter.environment prefixesgroup stays at 4 tests, 138 expects.Native execution regressions are POSIX-only; Windows execution and updating the installed CLI were not tested.
Screenshots / recordings
Not applicable (no UI change).
Checklist