Mint per-segment grants for multi-step shell chains (CL-5752) - #674
Merged
Conversation
1 task
Chains of 5+ segments used to be accept-once only with no persisted grant, so the same long chain re-prompted every time. Approving a multi-segment chain now mints one grant per real segment, so approving a && b also covers b alone later, and long chains behave like short ones.
TheGreatAxios
force-pushed
the
cl-5752-shell-chain-grants
branch
from
August 25, 2026 17:47
7f99fb0 to
0c8be8f
Compare
Per-segment minting reused a splitter that intentionally has no backslash-escape support so nested-interpreter peels stay opaque. Fall back to one exact grant when escapes or inline comments would otherwise mint text that never runs.
TheGreatAxios
added a commit
that referenced
this pull request
Aug 27, 2026
* Mint per-segment grants for multi-step shell chains Chains of 5+ segments used to be accept-once only with no persisted grant, so the same long chain re-prompted every time. Approving a multi-segment chain now mints one grant per real segment, so approving a && b also covers b alone later, and long chains behave like short ones. * Harden shell chain grant minting * Keep shell grant minting from inventing phantom segments Per-segment minting reused a splitter that intentionally has no backslash-escape support so nested-interpreter peels stay opaque. Fall back to one exact grant when escapes or inline comments would otherwise mint text that never runs.
TheGreatAxios
added a commit
that referenced
this pull request
Aug 27, 2026
* Mint per-segment grants for multi-step shell chains Chains of 5+ segments used to be accept-once only with no persisted grant, so the same long chain re-prompted every time. Approving a multi-segment chain now mints one grant per real segment, so approving a && b also covers b alone later, and long chains behave like short ones. * Harden shell chain grant minting * Keep shell grant minting from inventing phantom segments Per-segment minting reused a splitter that intentionally has no backslash-escape support so nested-interpreter peels stay opaque. Fall back to one exact grant when escapes or inline comments would otherwise mint text that never runs.
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
a && balso coversbalone later; previously mega-chains were accept-once only and re-prompted every time.Closes CL-5752
Test plan
src/permission/grant-scope.test.ts/permission.test.ts/ cross-commit composition coverage for per-segment minting and coverage