Skip to content

docs(permissions): explain that any { widens a pattern in overlap checks - #3846

Merged
dyoshikawa merged 3 commits into
mainfrom
resolve-issue-3842-brace-widening-docs
Nov 15, 2026
Merged

dyoshikawa merged 3 commits into
mainfrom
resolve-issue-3842-brace-widening-docs

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Follow-ups from #3840, which made any pattern containing { widen to * in the withheld-allow overlap check.

  • docs/reference/file-formats.md: the overlap rules said only "a {a,b} alternation overlaps everything". They now say that any pattern containing { does — alternations, ranges such as {1..3}, nested braces, and ${VAR} references whose value is unknown at generation time — with the rm -rf ${TMPDIR}/* deny withholding a git status allow as the example. src/generated/docs-content.ts is regenerated.
  • shell-command-categories.test.ts: adds a regression test that the allow rm -rf build is withheld under the deny rm -rf ${OUT}. The existing nested-brace cases mostly passed with the pre-fix(permissions): block allows shadowed by brace-range restrictions #3840 regex as well; this one fails against it (checked by temporarily restoring the old condition), so a later change that stops widening ${ would be caught.

Item 3 of the issue (saying in the warning that a {-containing pattern was widened) is left out on purpose: the warning already names the restriction and each withheld allow, and the docs now explain why such a restriction covers everything.

Test plan

  • pnpm cicheck

Closes #3842

🤖 Generated with Claude Code

https://claude.ai/code/session_01XcU6mYjWis3a6YpqCW2xgB

dyoshikawa and others added 3 commits November 15, 2026 11:56
…hecks

Document that a pattern containing `{` (alternation, ranges, nested
braces or a `${VAR}` reference) overlaps everything in the withheld-allow
comparison, and add a regression test for a comma-less `${OUT}` restriction
that the pre-#3840 regex let through.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XcU6mYjWis3a6YpqCW2xgB
# Conflicts:
#	src/generated/docs-content.ts
@dyoshikawa
dyoshikawa merged commit d4735d3 into main Nov 15, 2026
10 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-3842-brace-widening-docs branch November 15, 2026 03:19
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.

Follow-ups from #3840: document and test the {-widening in permission overlap checks

1 participant