Skip to content

fix(repo): inspect records a nested .cursor/rules/*.mdc; two stale comments - #200

Merged
antonwolfy merged 4 commits into
intel:mainfrom
antonwolfy:fix/nested-cursor-rules-and-nits
Oct 23, 2026
Merged

antonwolfy merged 4 commits into
intel:mainfrom
antonwolfy:fix/nested-cursor-rules-and-nits

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Leftovers from the reviews of #66 and #109: a nested Cursor rules directory that repo inspect missed, and two comments that no longer match the code.

Changes

  • Nested .cursor/rules (raised by xaleryb on #66, endorsed in my review). detect_instructions matched .cursor/rules/*.mdc only at the repository root, so web/.cursor/rules/style.mdc gave no instruction record at all. Such a file is now listed with directory web. Its scope and activation are unknown, and its note says why: Cursor's rules docs (cursor.com/docs/context/rules) cover rule subfolders inside the root .cursor/rules and nested AGENTS.md, not a .cursor/rules below the root. So whether Cursor reads one is not known from the docs; a reach probe with a Cursor profile could measure it. A path under the root .cursor/rules/ (.cursor/rules/sub/.cursor/rules/b.mdc) stays the root rule's only, and a doubly nested one takes the directory above the closest .cursor/rules/. The contract's instructions list says rules may sit at the root or in a subdirectory, and that a record of unknown scope gives the directory the file would apply to.
  • ci_local.py docstring (#109 review, nit 2): it named static as the only job whose steps run under !cancelled(). The deptry step of typecheck does too.
  • TRACKED_DEPS comment (same review, nit 3): it called every entry a direct dependency. ragas is in the ragas extra, anthropic comes with that extra's langchain-anthropic, and an entry that is not installed is recorded as None.
  • Changelog fragment (Fixed) for the repo inspect change.
  • The instruction-rule table test moves from tests/test_repo_environment.py to a new tests/test_repo_instructions.py, together with the new case. The old file is over the test length limit and may only shrink, and its baseline drops from 1,373 to 1,337 lines.

Risk

repo inspect (repo_environment.v1) gains records for nested .cursor/rules/*.mdc files, each with scope and activation unknown. So a repository with them also gets an instructions.activation-unknown finding for them, as one with root rules already does. The schema is unchanged.

Testing

On a Linux review host, at 524f1a5 (on main 506f7ba):

  • make ci-local: 29 passed, 0 failed, 7 skipped (the Docker catalog smoke, test-latest, the cli-surface packaging step, conda-forge-deps without micromamba, docs deploy, the pip-audit report, semgrep). 7,382 tests passed, 1 skipped; changed-line coverage 100% of 2 lines.
  • INSTRUCTION_TABLE gains sub/.cursor/rules/a.mdc. A new test pins the record's directory, its unknown scope and its note, and that a non-rule file under .cursor/ is not matched. Dropping the rule fails 2 tests; a rule without the directory fails 1.
  • Rebased onto main 92d92d3 (test(llm): pin provider-call budgets for judge, panel, answer and validation paths #170, tests only) before opening; with the ten follow-up branches merged together, the full suite (7,447 passed, 1 skipped), the growth check, mypy and ruff pass.
  • Review fixes, at 95ed677: make ci-local 29 passed, 0 failed, 7 skipped; 7,409 tests passed, 1 skipped; changed-line coverage 100% of 4 lines.

Checklist

  • Tests added/updated and pytest passes
  • ruff, mypy, and schema checks pass
  • Docs updated (or N/A) — see the docs-drift checklist in CONTRIBUTING.md
  • No ad-hoc run artifacts committed
  • New files carry the SPDX license header (or are exempt in .github/.licenserc.yaml)

…mments

Leftovers from the reviews of intel#66 and intel#109:
- `detect_instructions` matched `.cursor/rules/` only at the repository
  root, so `web/.cursor/rules/style.mdc` gave no instruction record (raised
  by xaleryb on intel#66). A nested rule file is now `path-specific`, with the
  directory above `.cursor` as its `directory` and activation `unknown`, as
  for the root rule.
- The `ci_local.py` docstring named `static` as the only job whose steps run
  under `!cancelled()`; the deptry step of `typecheck` does too.
- The `TRACKED_DEPS` comment called every entry a direct dependency: `ragas`
  is in the `ragas` extra and `anthropic` comes with its
  `langchain-anthropic`.

The instruction-rule table test moves from test_repo_environment.py, which
is over the test length limit and may only shrink, to its own
test_repo_instructions.py with the new case; the baseline drops to 1337.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@vchamarthi

Copy link
Copy Markdown
Contributor

@exai-bot /review

1 similar comment
@vchamarthi

Copy link
Copy Markdown
Contributor

@exai-bot /review

@exai-bot

Copy link
Copy Markdown

@vchamarthi Another request on this pull request is already running. Ask again when it finishes.

@exai-bot exai-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

AI-generated review of 618a61e4df69, requested by @vchamarthi, using the default review skill. It can be wrong: verify a finding before acting on it. React with a thumbs up or down on a finding to tell the bot whether it helped.
Model us.anthropic.claude-sonnet-5-5, effort default, 4 of 80 turns, 0.2 of 40 minutes, 65k in / 1k out tokens.

The change adds a rule so repo inspect records a nested <dir>/.cursor/rules/*.mdc as a path-specific instruction with directory=<dir> and activation unknown. It also moves the instruction table test to its own file and fixes two stale comments. I found no defects. The new regex needs a non-empty prefix, so the root rule and the nested rule never both match a root path. The existing activation-unknown finding and fixtures only reference the root style.mdc, so they are unaffected.

No issues found.

Not verified

I did not run the tests, the growth check or the ci-local run. I did not check that the growth_baseline.json line count (1337) matches the file after the removal.

@vchamarthi vchamarthi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blockers. 1 non-blocking comment.

No code defects found; one question on the documentation source for nested .cursor/rules, and CI is still running at the head. The new regex does not match root .cursor/rules/sub/a.mdc (no /.cursor/rules/ substring), so root rules keep a single record; the ci_local.py comment matches the deptry step's if: ${{ !cancelled() }} in ci.yml, and the manifest.py comment matches the ragas extra in pyproject.toml.

CI at send time: 0 failing, 11 pending.

Comment thread dokimi/dokimi/repos/environment/instructions.py Outdated
@codecov-commenter

codecov-commenter commented Oct 23, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.97%. Comparing base (92d92d3) to head (95ed677).
⚠️ Report is 13 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #200      +/-   ##
==========================================
+ Coverage   91.78%   91.97%   +0.18%     
==========================================
  Files         223      223              
  Lines       27623    27713      +90     
  Branches     4549     4553       +4     
==========================================
+ Hits        25354    25488     +134     
+ Misses       1606     1575      -31     
+ Partials      663      650      -13     
Files with missing lines Coverage Δ
dokimi/dokimi/repos/environment/instructions.py 97.29% <100.00%> (+0.15%) ⬆️
dokimi/dokimi/runner/manifest.py 89.28% <ø> (ø)

... and 15 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Review of intel#200 (vchamarthi): Cursor's rules docs
(cursor.com/docs/context/rules, read 2026-10-23) cover rule subfolders
inside the root `.cursor/rules` and nested `AGENTS.md`, but not a
`.cursor/rules` directory below the root. Recording one as
`path-specific` claimed what no doc backs, against the table's rule of
listing what each harness documents. It stays listed, with its
`directory`, but scope and activation are `unknown` and its note says
why; the changelog no longer says Cursor applies it.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@vchamarthi
vchamarthi requested a review from exai-bot October 23, 2026 17:10

@exai-bot exai-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

AI-generated review of 94a88a16cee5, requested by @vchamarthi, using the default review skill. It can be wrong: verify a finding before acting on it. React with a thumbs up or down on a finding to tell the bot whether it helped.
Model us.anthropic.claude-sonnet-5-5, effort default, 7 of 94 turns, 0.6 of 48 minutes, 124k in / 4k out tokens.

Re-review of 94a88a16cee5: 2 new findings.

2 findings are on the changed lines, as comments below.

Comment thread dokimi/dokimi/repos/environment/instructions.py Outdated
…d ones the closest dir

Review of intel#200 (exai-bot): the nested-rule pattern also matched
`.cursor/rules/sub/.cursor/rules/b.mdc`, which the root rule already
covers, so the file got two records; and `_cursor_dir` split at the
first `/.cursor/rules/`, so `a/.cursor/rules/b/.cursor/rules/c.mdc` got
`a`. The nested rule now skips paths under the root `.cursor/rules/`,
and the directory is the one above the closest `.cursor/rules/`.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
…wn scope

Review of intel#200 (exai-bot): the contract defines an instruction record's
`directory` as the one the file applies to, while a nested
`.cursor/rules` record's note says Cursor may not read the file at all.
For a record whose scope is `unknown`, it is the directory the file
would apply to.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>

@napetrov napetrov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the diff: nested .cursor/rules/*.mdc is recorded with scope/activation unknown and an honest note, the root rule is unaffected, the table test covers sub/.cursor/rules/a.mdc, and the comment fixes match the code. LGTM.

@antonwolfy
antonwolfy merged commit 5dc83c2 into intel:main Oct 23, 2026
28 checks passed
@antonwolfy
antonwolfy deleted the fix/nested-cursor-rules-and-nits branch October 23, 2026 19:39
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.

5 participants