DashboardcraftgetWorkspaceGlobMatches brace expansion

getWorkspaceGlobMatches brace expansion

Category: gotcha
Confidence: 1.00
ID: 01a06eb1-face-7a1c-975b-1ac5e680e74c
Project ID: e16af391-c497-4837-b681-c849a5514499
Cross-project: No
Recalled in other projects: 0
Source session: 1Okgn0vvN7hdZmhlc
Created: 2026-09-04 06:59:47
Updated: 2026-09-04 23:12:32

Content

Trap: validating only nonempty outer brace expansion looks sound because each returned alternative is checked, but flatMap silently drops malformed nested branches: packages/{cli,{mcp}} yields cli and passes. Fix: make brace expansion propagate an explicit invalid result through every recursive branch; require a valid, nonempty complete expansion before validating each expanded POSIX glob/path. Apply identically in src/schemas/project_config.ts and src/config.ts. Permit balanced nested braces; reject malformed, empty, absolute, traversal, prototype, option-like, or unsafe alternatives. Do not recurse expanded strings through hasMagic(), which can stack-overflow.

Move to: