mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #386] [MERGED] feat(agents-md-integrity): add total and per-line character limits #389
Labels
No labels
cursor-review-catalog-drift
groom
groom
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/github-workflows#389
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/github-workflows/pull/386
Author: @mattmillerai
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @mattmillerai
Base:
main← Head:agents-md-char-ceiling📝 Commits (3)
5e3366dfeat(agents-md-integrity): add total and per-line character limits4592f38fix(agents-md-integrity): count both CRLF characters toward the char ceiling6fdc55cfix(agents-md-integrity): reject a non-integer char limit; split lines on CR/LF only📊 Changes
7 files changed (+500 additions, -34 deletions)
View changed files
📝
.github/agents-md-integrity/README.md(+29 -3)📝
.github/agents-md-integrity/check_agents_md.py(+171 -26)📝
.github/agents-md-integrity/tests/test_check_agents_md.py(+207 -0)📝
.github/workflows/agents-md-integrity.yml(+46 -4)📝
.github/workflows/test-agents-md-integrity.yml(+31 -0)📝
README.md(+1 -1)📝
docs/callers/agents-md-integrity.md(+15 -0)📄 Description
ELI-5
The AGENTS.md checker only counted lines, so a file could stay at 111 lines and still be 200k+ characters, because one paragraph counts as one line. Everything in that file gets loaded into every agent session. This PR adds character limits too, on the root file and on every nested
AGENTS.md. By default they only warn, so no caller goes red when it bumps its pin.What changed
New optional inputs on
agents-md-integrity.yml(envMAX_CHARS/WARN_CHARS/MAX_LINE_CHARSon the script):max_chars0(off)40000is suggested, matching Claude Code's oversized-memory-file floor.warn_chars25000max_line_chars3000AGENTS.mdthe walk already visits.exclude_pathsstill prunes as before.L42 (89015 chars)), and the fix: move the rationale intodocs/agents/and leave a one-line pointer (a plain link, not an@import).splitlines()), soL<n>matches an editor._size_findingshelper that both the root and nested paths call, and the existing messages are kept word for word.docs/callers/agents-md-integrity.md(Inputs table + a "warn-first" gotcha), the checker README, and the catalog row inREADME.md.Judgment calls
max_charsdefaults to off, not40000. The ticket asks that existing callers not break, and a hard 40000 default would fail every oversized caller the day it bumps. The two warn limits default on, so oversized files show up right away without failing anything.max_line_charsis always warn-only. The ticket asks for "warn-only by default" but only names three inputs. I didn't add a fourth input just to escalate long lines to failures;max_charsalready supplies the failing ceiling.40k,40000.5) is a config error (exit 2), not a fallback to the default. Formax_charsthe default is "off", so a fallback would quietly disable the ceiling the caller asked for.40000.0is accepted.max_lines/warn_lineskeep their existing fallback.Residual
max_chars: 40000set.max_charsfleet-wide means each caller sets it after its warnings are cleared. I didn't sweep the callers to count how many files are currently over 25000 chars or have lines over 3000 chars, so I don't know how many would warn after a bump.MAX_LINES/WARN_LINESvalue is still silently replaced by its default. Only the new character limits are strict.CLAUDE.mditself is not measured, so Claude-only text below the@AGENTS.mdimport escapes the character limits. This is proposed as a follow-up.Provenance
agents-md-integritysuite green (62 tests). New tests cover pass, warn, fail, at-limit,0=off, nested, exclusions, line checks unchanged, env wiring, defaults-pass, CRLF counted as two, U+2028/NEL not splitting a line, and exit 2 on a non-integer limit. The CRLF test was confirmed to fail without the fix.test-agents-md-integrity.yml(default warns + exit 0;MAX_CHARS=40000exits 1) passes locally.workflow-pinssuite green, including the declared-vs-documented input drift harness.check_workflow_pins.py,check-org-repo-literals.sh,check_agents_md.py --root ..max_line_charscannot be escalated to a failure (it is warn-only, see Judgment calls).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.