feat: reusable AGENTS.md integrity CI workflow (SHA-pinnable)#34
feat: reusable AGENTS.md integrity CI workflow (SHA-pinnable)#34mattmillerai wants to merge 1 commit into
Conversation
…md standard Adds a SHA-pinnable reusable workflow (on: workflow_call) that checks a caller repo's AGENTS.md against the Comfy standard: a thin top-level AGENTS.md source of truth under a hard line ceiling (default 200, warn 150), a one-line @AGENTS.md CLAUDE.md shim rather than a divergent copy, no legacy .cursorrules, per-subtree shims + ceiling for nested monorepo AGENTS.md files, and a CODEOWNERS DRI (warn-only by default). Fails with a non-zero exit and GitHub annotations so it wires in as a required status check. The checker lives in .github/agents-md-integrity/ as the single source of truth (loaded from a pinned ref of this repo, never the caller's checkout). Adds a unittest suite plus a self-test workflow exercising passing and failing cases, and a README row.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
ELI-5
We're standardizing on one thin
AGENTS.mdper repo as the single source of truth for agent instructions, withCLAUDE.mdreduced to a one-line@AGENTS.mdshim, no stray.cursorrules, and a hard under-200-line ceiling (per Anthropic guidance). Nothing enforces that today, so files quietly drift back over the limit and shims diverge. This adds a reusable CI workflow any Comfy repo can pin (by commit SHA) to fail its build when itsAGENTS.mddrifts out of spec.What this adds
.github/workflows/agents-md-integrity.yml— aworkflow_callreusable workflow. It runs in the caller's context, soactions/checkoutchecks out the calling repo and the checks operate on that repo's files. The checker itself is loaded from a pinned ref of this repo (workflows_ref), never the caller's checkout, so a PR can't rewrite the check..github/agents-md-integrity/check_agents_md.py— the checker (stdlib-only Python), the single source of truth so consumers carry only a thin caller. EmitsFAIL:/WARN:lines plus GitHub::error::/::warning::annotations and exits non-zero on any hard failure, so it wires in as a required status check..github/agents-md-integrity/tests/+.github/workflows/test-agents-md-integrity.yml— aunittestsuite (16 cases) plus a self-test workflow (mirroringtest-cursor-review-scripts.yml) that also runs a passing-repo and a failing-repo CLI smoke test.v1conventions.Checks enforced (all acceptance criteria)
AGENTS.mdpresentagents_file(AGENTS.md)> max_linesfails;> warn_lines(but≤ max_lines) warnsmax_lines(200),warn_lines(150)CLAUDE.mdexists, it must contain@AGENTS.md; a divergent copy fails.cursorrules.cursorrulesfailsforbid_cursorrules(true)AGENTS.mdneeds a sibling@AGENTS.mdshim and≤ max_linescheck_nested(true)AGENTS.mdmatched by a CODEOWNERS rule; warn-only unless escalatedrequire_codeowners(false → warn)All inputs are documented in the workflow's header comment.
Usage
Testing
python3 -m unittest discover -s .github/agents-md-integrity/tests→ 16 passing.AGENTS.md, divergentCLAUDE.md,.cursorrules) exits 1 with clear per-check output.Judgment calls / notes
require_codeownersis a boolean (defaultfalse= warn-only,true= fail), which reads as the ticket's "input-gated, default: warn only"./anchoring, basename-at-any-depth,*/**, last-match-wins incl. owner-less unassign). It's a warn-only check by default, so approximate matching is acceptable; exotic patterns may under-match.workflows_refdefaults tomainand must be pinned by the caller to match theuses:SHA for full reproducibility — same limitation/pattern ascursor-review.yml. Documented in the header + README.splitlines()(number of text lines), which iswc -l-equivalent for newline-terminated files and one more (correctly) for a file with no trailing newline.v1tag is cut), semantic/drift checks, and content-quality checks.Scoped to
Comfy-Org/github-workflows; no consumer repos are modified.