Skip to content

Mint per-segment grants for multi-step shell chains (CL-5752) - #674

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-5752-shell-chain-grants
Aug 25, 2026
Merged

Mint per-segment grants for multi-step shell chains (CL-5752)#674
TheGreatAxios merged 3 commits into
mainfrom
cl-5752-shell-chain-grants

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Approving a multi-segment shell chain now mints one grant per real segment instead of one whole-string grant (and instead of minting nothing for 5+ segment chains).
  • Long chains behave like short ones: approving a && b also covers b alone later; previously mega-chains were accept-once only and re-prompted every time.
  • Removes the mega-chain accept-once-only path and updates the approval-forensics mega-chain column accordingly.

Closes CL-5752

Test plan

  • src/permission/grant-scope.test.ts / permission.test.ts / cross-commit composition coverage for per-segment minting and coverage
  • Pre-commit typecheck + build passed on commit

@linear-code

linear-code Bot commented Aug 24, 2026

Copy link
Copy Markdown

CL-5752

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
TheGreatAxios force-pushed the cl-5752-shell-chain-grants branch from 7f99fb0 to 0c8be8f Compare August 25, 2026 17:47
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
TheGreatAxios merged commit 7a3b997 into main Aug 25, 2026
5 checks passed
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.
@TheGreatAxios
TheGreatAxios deleted the cl-5752-shell-chain-grants branch August 28, 2026 00:09
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