Repository navigation
feat(contract): add R011 for tracked files under agent dirs - #29
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 19 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
R008 warns that an agent/IDE directory is committed. That turned out not to be enough: a whole skill tree committed under .kimi/skills/ produced a single directory-level warning, which was easy to scroll past, and the tree survived review and CI. R011 reports each tracked file under an agents_ide_dir at error severity, naming the file and the remediation. Listing the files also makes the migration reviewable -- every path in the output is a decision about where that content should live. The check asks `git ls-files` which files are version-controlled, so output inside an already-ignored agent directory is not reported; outside a git working tree it falls back to listing the directory. R008 stands down on a directory once R011 has reported files under it, so a committed tree produces one set of findings instead of two overlapping ones. R011 is scoped to the `strict` profile while the handful of repositories with a pre-existing committed agent tree are cleaned up, matching the ratchet the other rollout rules use. Adopt it early with `--rules R011`. Also adds the organization-wide .gitignore block for local agent/IDE directories to this repository, anchored at the root.
loonghao
force-pushed
the
chore/tracked-agent-dir-rule
branch
from
October 6, 2026 17:50
e2fa088 to
e2225a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
R008 warns that an agent/IDE directory is committed. That turned out not to be enough: a whole
SKILL.mdtree committed under.kimi/skills/indcc-mcp-freecadproduced a single directory-level warning, which is easy to scroll past, and the tree survived review and CI while every later agent run kept loading the previous version.Change
New rule R011
no-tracked-agent-dirs— reports each tracked file under anyagents_ide_diraterrorseverity, naming the file and the remediation:Listing the files rather than the directory also makes the migration reviewable: every path in the output is a decision about where that content should live. Output is capped at 20 files per directory with a
... and N moresummary.scripts/check_repo_contract.py—check_no_tracked_agent_dirs, registered inRULES. The check asksgit ls-fileswhich files are version-controlled, so output sitting inside an already-ignored agent directory is not reported; outside a git working tree it falls back to listing the directory.contract/repo_contract.json— the rule entry.docs/repo-contract.md— rules table row and a### R011: catching a committed copysection.tests/test_repo_contract.py— 8 tests: tracked file fails, whole tree reported, empty dir not reported, R008/R011 handover, files outside agent dirs untouched, output capped,baselinestays green,--rules R011promotes it..gitignore— adds the organization-wide agent/IDE block to this repository, anchored at the root.R008 handover. When R011 reports files under a directory, R008 no longer also warns about the directory, so a committed tree produces one set of findings instead of two overlapping ones. R008 still warns on an empty committed agent directory, where R011 has nothing to report.
Scoping
R011 is
errorseverity but limited to thestrictprofile, the same ratchet R006–R010 use. Three repositories currently have tracked files under an agent directory (dcc-mcp-houdini,dcc-mcp-zbrush,dcc-mcp-core); landing it inbaselinewould turn their contract CI red on the next run while those migrations are still open. Adopt it early per repository with--rules R011(orrules: R011on the reusable workflow). It moves tobaselineonce those are clean.Verification
python -m unittest discover -s tests— 264 tests, OK (256 before, 8 added)python scripts/check_repo_contract.py --root . --profile strict— 0 errors, 2 warnings, exit 0. Both warnings (profile,requirements-profile-check.txt) are pre-existing R006 findings, unchanged.dcc-mcp-freecadatmain: R011 reports all 12 tracked.kimi/skills/**files, and correctly does not report that repository's untracked.claude/and/.monica/.Notes
Stacked on #28 (
agents_ide_dirs15 → 23), which this rule needs in order to cover.kimi,.codex,.gemini,.aider,.continue,/.monica/,/.multica/and.agent_context. Merge #28 first; this PR's diff then reduces to R011 plus this repository's.gitignore.No rule is removed or renumbered.
contract/**,docs/**andscripts/**are outside thepathsfilter of this repository's PR workflows, so the first automated run is the nightly.