Skip to content

CI: add AGENTS.md size guard to check-additional - #71113

Closed
Yellowfish23 wants to merge 1 commit into
openclaw:mainfrom
Yellowfish23:chore/agents-md-size-guard
Closed

Yellowfish23 wants to merge 1 commit into
openclaw:mainfrom
Yellowfish23:chore/agents-md-size-guard

Conversation

@Yellowfish23

Copy link
Copy Markdown

Summary

  • Adds scripts/check-agents-md.ts — caps every tracked AGENTS.md at 150 lines to stop any single guide from regrowing into a monolith.
  • Wires into the sharded check-additional layout via BOUNDARY_CHECKS in scripts/run-additional-boundary-checks.mjs; adds matching pnpm run lint:agents-md:size script.
  • Tombstoned exemptions (must be removed when each condition fires):
    • AGENTS.md (root, 318 lines) — exempt until the planned root slim-down PR extracts operational content to docs/contributing/*.
    • docs/reference/templates/AGENTS.md — permanent exemption (template exemplar content, not live rules).

Why now

Context: the root AGENTS.md has 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

  • Line-count only in PR1. A follow-up will add a duplicate-rule-sentence guard once the root extraction lands — running it today would fire on current-state near-duplicates across root and scoped guides.
  • Exemptions carry a reason: field and are enforced by the test suite (documents every exemption with a reason).
  • Uses the same shape as 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 pass
  • pnpm run lint:agents-md:size — exit 0 on current origin/main
  • Manual: introduced a fake 200-line AGENTS.md and verified the guard reports it sorted-by-size-descending and sets exit 1
  • Manual: confirmed exempt paths bypass the cap (root + templates)

Design verified against a 5-advisor Council session with peer review (transcript available on request).

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.
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M labels Apr 24, 2026
@clawsweeper

clawsweeper Bot commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

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 details

Best 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:

  • vincentkoc: Recent commits repeatedly hardened scripts/run-additional-boundary-checks.mjs and its tests around boundary-check execution, sharding, timers, and process cleanup. (role: recent area contributor; confidence: high; commits: b99812b3b143, 36db108fc153, e2c567538d89; files: scripts/run-additional-boundary-checks.mjs, test/scripts/run-additional-boundary-checks.test.ts, scripts/check-ts-max-loc.ts)
  • steipete: History shows CI shard consolidation, script documentation, and adjacent boundary-check/test work on the same scripts and CI surfaces. (role: adjacent boundary-check refactor contributor; confidence: high; commits: eca402da79d1, f4d90eb36aee, b8d08f0cfd0c; files: scripts/run-additional-boundary-checks.mjs, test/scripts/run-additional-boundary-checks.test.ts, scripts/check-ts-max-loc.ts)
  • jesse-merhi: Recent history includes replacing and classifying entries in the additional boundary-check guard list, making this person relevant to runner list churn but not broad ownership. (role: adjacent guard-list contributor; confidence: medium; commits: dd0a9bf86930, 9cc5e49e6512, f4797921ac01; files: scripts/run-additional-boundary-checks.mjs, package.json)

Codex review notes: model internal, reasoning high; reviewed against e9f9a68d68c9.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 20, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels May 20, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 7, 2026
@clawsweeper

clawsweeper Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: M stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant