Skip to content

Brace groups follow bash: no comma or sequence means literal - #1263

Merged
thekevinscott merged 26 commits into
mainfrom
claude/1262-brace-literal
Oct 6, 2026
Merged

thekevinscott merged 26 commits into
mainfrom
claude/1262-brace-literal

Conversation

@thekevinbot

@thekevinbot thekevinbot commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1262

Path-table braces now expand as bash expands them before globbing. A group with a top-level comma is an alternation (nesting allowed). A .. range ({1..3}, {a..c}, {01..10}, {1..10..2}) expands to each value. Any other brace is literal text, so './br/{q}.md' names br/{q}.md. Expansion lives in the shared core (brace::expand, called from scanner::compile_glob), so the CLI and all SDKs behave the same. Config [[table]] glob is unchanged.

Checked against bash -O globstar -c 'shopt -u dotglob; ...' on a fixture. These all match: {q}*, {a,b}.md, {1..3}.md, {a..c}.md, x{q}.md, {x,{q}}.md, {x,{q}}*, {* (unbalanced), {}*, }*, {1..3..2}.md. The edge-case unit tests (x{}a,b}y, xx{a..}y,b}, {-01..1}, {Y..[}, x{a{b,c}}y, {-0..10..5}, {1..3..-1}) agree with echo in bash. After merging main, braces also match bash across symlinks and dot names: {lnk/f.md,a.md}, {lnk,real}/*.md, {lnk/sub,.h}/*, {.env,a.md}, {q}/*, **/{f,g}.md.

E2E Verification

  • Ran e2e suites locally for every affected SDK
  • Python SDK e2e: pass
  • TypeScript SDK e2e: pass
  • Rust core e2e (if applicable): pass (path_table_cli_e2e brace cases, run under --features cli)
  • packages/python/e2e-attestations/claude-1262-brace-literal.json receipt written if packages/python changed (just e2e-attest-python)
  • packages/ts/e2e-attestations/claude-1262-brace-literal.json receipt written if packages/ts changed (just e2e-attest-ts)
  • Command(s) run: just e2e-attest-python, just e2e-attest-ts, cargo test --workspace --features cli
  • Result summary: After merging main (POSIX classes, UTF-8 chars, walk prune, ancestor .gitignore): Python 40 passed, TypeScript 18 passed, cargo test --workspace --features cli passes. Braces compose with POSIX classes and non-ASCII ? as bash does (br/{[[:digit:]],q}.md, br/caf?.md, br/a{1..3..2}.md, br/{q}.md checked by hand). Local scoped preflight could not run (npx ENOENT in the pnpm store); CI runs the gates.

Brace expansion now feeds main's PathGlob: every word adds to the file set and the spelled dot names, and each word's components run as their own path through the symlink state machine.
@thekevinscott
thekevinscott merged commit 822ddaf into main Oct 6, 2026
92 of 93 checks passed
@thekevinscott
thekevinscott deleted the claude/1262-brace-literal branch October 6, 2026 00:08
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.

A brace group with no comma ('{q}') matches as an alternation; bash reads it literally

2 participants