Repository navigation
CI: add AGENTS.md size guard to check-additional - #71113
Yellowfish23 wants to merge 1 commit into
Conversation
Caps every tracked AGENTS.md at 150 lines. Exempts root AGENTS.md (tombstoned until the CLAUDE.md restructure extracts to docs/contributing/*) and docs/reference/templates/AGENTS.md (template, not live rules). Wires into the sharded check-additional layout via BOUNDARY_CHECKS in scripts/run-additional-boundary-checks.mjs.
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. This stale draft PR should close because the remaining maintainer decision belongs to the open boundary-check consolidation issue, while this branch adds a new hard check-additional gate with source-provable defects and no inspectable real-behavior proof. Canonical path: Close this draft and keep the AGENTS.md-size policy as follow-up input for #59740, with a new narrow PR only after maintainers accept the guard shape. So I’m closing this here and keeping the remaining discussion on #59740. Review detailsBest possible solution: Close this draft and keep the AGENTS.md-size policy as follow-up input for #59740, with a new narrow PR only after maintainers accept the guard shape. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection and a read-only Node probe show the PR-introduced path-normalization and newline-counting defects without needing to mutate the checkout. Is this the best way to solve the issue? No. A size guard may be useful, but this stale draft is not the best landing path until maintainers decide whether the policy belongs in a standalone guard or the broader boundary-check consolidation work. Security review: Security review cleared: The diff adds a local git/read-file CI helper, package script, and tests without new dependencies, downloaded code, workflow permissions, secret handling, or package-resolution changes. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against e9f9a68d68c9. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
scripts/check-agents-md.ts— caps every trackedAGENTS.mdat 150 lines to stop any single guide from regrowing into a monolith.check-additionallayout viaBOUNDARY_CHECKSinscripts/run-additional-boundary-checks.mjs; adds matchingpnpm run lint:agents-md:sizescript.AGENTS.md(root, 318 lines) — exempt until the planned root slim-down PR extracts operational content todocs/contributing/*.docs/reference/templates/AGENTS.md— permanent exemption (template exemplar content, not live rules).Why now
Context: the root
AGENTS.mdhas grown to 318 lines / ~42 KB and mixes ~12 unrelated domains (architecture boundaries, build/test, coding style, testing perf guardrails, platform tips, multi-agent safety…). Before any restructure lands, this guard establishes the floor so the new per-surface guides can't quietly regrow. Mechanical invariant > aspirational hygiene.Design notes
reason:field and are enforced by the test suite (documents every exemption with a reason).scripts/check-ts-max-loc.ts(git-ls-files + line count + descending offenders output).Test plan
pnpm test test/scripts/check-agents-md.test.ts— 7/7 passpnpm run lint:agents-md:size— exit 0 on currentorigin/mainAGENTS.mdand verified the guard reports it sorted-by-size-descending and sets exit 1Design verified against a 5-advisor Council session with peer review (transcript available on request).