Skip to content

fix(coderd/x/chatd): match slashless rule globs at the project root - #239

Merged
ibetitsmike merged 1 commit into
mainfrom
mike/rules-glob-root-only
Nov 12, 2026
Merged

ibetitsmike merged 1 commit into
mainfrom
mike/rules-glob-root-only

Conversation

@ibetitsmike

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of Mike.

Follow-up to #235. A glob-scoped Cursor rule now matches its globs verbatim, relative to the rule's project root. Before this change, a glob without a / (such as *.ts) was rewritten to **/*.ts and matched at any depth. Cursor documents *.ts as matching only files in the project root, so #235 attached such rules more often than Cursor does.

  • ruleGlobMatch in coderd/x/chatd/fork_scoped_rules.go drops the **/ rewrite. Rules that want every depth must say **/*.ts.
  • fork_scoped_rules_internal_test.go replaces MatchingFileAtAnyDepth with three cases: *.ts attaches for proj/app.ts, does not attach for proj/src/app.ts, and **/*.ts attaches for proj/src/app.ts.

Negative control: putting the **/ rewrite back makes SlashlessGlobNotNested fail, because *.ts then matches src/app.ts and the rule body is attached.

Validation: fork-ci on this PR. No UAT slot; the change is limited to the matcher and its unit test.

This removes the #235 known gap "a glob without a slash matches at any depth".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

@codex review

Xum requested this review on behalf of @ibetitsmike.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T08:47:22.914796Z eb2a428 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: eb2a428c94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike merged commit ffd55a8 into main Nov 12, 2026
10 checks passed
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum merged this PR on behalf of @ibetitsmike.

Merge evidence for head eb2a428c943eff3592829214240c4981a1ace699:

  • fork-ci run 43185377121 passed on this head. All checks on the head pass. The branch is not behind main.
  • Codex summary 6818978075 is on this head with no findings. 0 unresolved threads.
  • No live UAT: this changes only the glob matcher. UAT-235 already proved the wiring. SlashlessGlobNotNested fails if the old **/ rewrite comes back, the case the replaced MatchingFileAtAnyDepth test asserted.
  • Brings slashless globs in line with Cursor's documented semantics, where *.ts matches root files only and **/*.ts matches every depth.

@ibetitsmike
ibetitsmike deleted the mike/rules-glob-root-only branch November 12, 2026 09:10
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