Skip to content

Explain grant-mismatch asks with a prompt notice - #960

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-6824-grant-mismatch-notice
Sep 13, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-6824-grant-mismatch-notice

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • When a standing grant covers a shell command but a pre-grant guard still forces an ask, the prompt carries a notice naming the guard reason (--force use, uncontained worktree destination, sensitive path, or path outside the workspace)
  • --force=<value> spellings count as force in the worktree policy, so the inline-value skip can no longer swallow force intent

Verification

  • bun run typecheck, bun run build, and the full bun run check suite pass (7141 pass, 0 fail)
  • New gate tests assert real prompted requests carry the exact notice text; new policy tests pin the --force=<value> ask and the --no-force pass-through

Fixes CL-6824

@linear-code

linear-code Bot commented Sep 13, 2026

Copy link
Copy Markdown

CL-6824

Short -f takes no value: real git rejects -f=<value> and glued -f<val> the way it rejects --force=<value>, so the worktree policy treats them as force instead of letting the generic-flag skip swallow them. The grant-mismatch notice keeps the destination noun for add and names the worktree itself for remove.
@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Audit: Approve, no code change requested. Grant-mismatch notices name the guard reason without changing match semantics: every covered-but-guarded case still asks and stays deniable, only the prompt gains the why, and treating --force= as force intent is the safe direction. File-for-later: the startsWith("--force=") prefix over-matches in principle, since any --force= (including empty or garbage values real git would reject with exit 129) is treated as force. Harmless today because ask is the safe direction, but worth a precise matcher if the flag grammar ever grows.

@TheGreatAxios
TheGreatAxios merged commit e42d1d2 into main Sep 13, 2026
9 checks passed
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