Repository navigation
fix(repo): inspect records a nested .cursor/rules/*.mdc; two stale comments - #200
Conversation
…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>
|
@exai-bot /review |
1 similar comment
|
@exai-bot /review |
|
@vchamarthi Another request on this pull request is already running. Ask again when it finishes. |
exai-bot
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
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>
exai-bot
left a comment
There was a problem hiding this comment.
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.
…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
left a comment
There was a problem hiding this comment.
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.
Summary
Leftovers from the reviews of #66 and #109: a nested Cursor rules directory that
repo inspectmissed, and two comments that no longer match the code.Changes
.cursor/rules(raised by xaleryb on #66, endorsed in my review).detect_instructionsmatched.cursor/rules/*.mdconly at the repository root, soweb/.cursor/rules/style.mdcgave no instruction record at all. Such a file is now listed withdirectoryweb. Its scope and activation areunknown, and its note says why: Cursor's rules docs (cursor.com/docs/context/rules) cover rule subfolders inside the root.cursor/rulesand nestedAGENTS.md, not a.cursor/rulesbelow 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'sinstructionslist says rules may sit at the root or in a subdirectory, and that a record ofunknownscope gives the directory the file would apply to.ci_local.pydocstring (#109 review, nit 2): it namedstaticas the only job whose steps run under!cancelled(). The deptry step oftypecheckdoes too.TRACKED_DEPScomment (same review, nit 3): it called every entry a direct dependency.ragasis in theragasextra,anthropiccomes with that extra'slangchain-anthropic, and an entry that is not installed is recorded asNone.repo inspectchange.tests/test_repo_environment.pyto a newtests/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/*.mdcfiles, each with scope and activationunknown. So a repository with them also gets aninstructions.activation-unknownfinding for them, as one with root rules already does. The schema is unchanged.Testing
On a Linux review host, at
524f1a5(onmain506f7ba):make ci-local: 29 passed, 0 failed, 7 skipped (the Docker catalog smoke,test-latest, thecli-surfacepackaging step, conda-forge-deps without micromamba, docsdeploy, the pip-audit report, semgrep). 7,382 tests passed, 1 skipped; changed-line coverage 100% of 2 lines.INSTRUCTION_TABLEgainssub/.cursor/rules/a.mdc. A new test pins the record'sdirectory, itsunknownscope 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.main92d92d3 (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,mypyandruffpass.95ed677:make ci-local29 passed, 0 failed, 7 skipped; 7,409 tests passed, 1 skipped; changed-line coverage 100% of 4 lines.Checklist
pytestpassesruff,mypy, and schema checks pass.github/.licenserc.yaml)