Skip to content

fix(engine): match dot-prefixed dirs in ctx.glob() and ADR file scopes#223

Merged
rhuanbarreto merged 1 commit into
mainfrom
claude/heuristic-villani-20eb67
Apr 24, 2026
Merged

fix(engine): match dot-prefixed dirs in ctx.glob() and ADR file scopes#223
rhuanbarreto merged 1 commit into
mainfrom
claude/heuristic-villani-20eb67

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

Fixes #222ctx.glob() in .rules.ts files and ADR files: scope resolution silently dropped dot-prefixed directories (.github/, .husky/, .vscode/) on Windows.

  • Root cause: Bun.Glob.scan({ dot: false }) skips path segments starting with ., even when the pattern explicitly names the directory. Behavior also differs across platforms — Windows reliably drops the match while Linux may still match, so rules appeared to "work in CI" but no-op'd on local Windows runs.
  • Fix: Changed dot: falsedot: true in three call sites:
    • ctx.glob() in src/engine/runner.ts
    • ctx.grepFiles() in src/engine/runner.ts
    • resolveScopedFiles() in src/engine/git-files.ts
  • The git-tracked-files filter in resolveScopedFiles already excludes gitignored files, so dot: true does not surface unwanted entries.

Test plan

  • Regression test: glob matches dot-prefixed directories — creates .github/workflows/{release,ci}.yml, asserts exact, *, and ** glob patterns all match
  • Regression test: grepFiles matches dot-prefixed directories — verifies ctx.grepFiles() finds content inside .github/workflows/*.yml
  • Regression test: resolves dot-prefixed paths — verifies resolveScopedFiles() includes .github/workflows/*.yml in ADR scoped files
  • bun run validate passes (668 tests, 22/22 ADR rules, build compiles)

#222)

`Bun.Glob.scan({ dot: false })` silently dropped dot-prefixed path
segments (`.github/`, `.husky/`, `.vscode/`) — even when the pattern
explicitly named the directory. This turned rules targeting
`.github/workflows/*.yml` into no-ops on Windows while still working
on Linux CI, because Bun's glob behavior differs across platforms.

Change `dot: false` → `dot: true` in three call sites:
- `ctx.glob()` in src/engine/runner.ts
- `ctx.grepFiles()` in src/engine/runner.ts
- `resolveScopedFiles()` in src/engine/git-files.ts

The git-tracked-files filter in `resolveScopedFiles` already excludes
gitignored files, so `dot: true` does not surface unwanted entries.

Closes #222
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: dcc1467
Status: ✅  Deploy successful!
Preview URL: https://7904d2ea.archgate-cli.pages.dev
Branch Preview URL: https://claude-heuristic-villani-20e.archgate-cli.pages.dev

View logs

@rhuanbarreto rhuanbarreto merged commit 2b3eba4 into main Apr 24, 2026
9 checks passed
@rhuanbarreto rhuanbarreto deleted the claude/heuristic-villani-20eb67 branch April 24, 2026 23:45
@github-actions github-actions Bot mentioned this pull request Apr 24, 2026
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.

ctx.glob() in .rules.ts does not match dot-prefixed directories (e.g. .github/) on Windows

1 participant