From 1cd0aa06960feea474d2b81798a244d5a105b0c1 Mon Sep 17 00:00:00 2001 From: Chenjie Luo Date: Thu, 1 Oct 2026 06:43:16 +0000 Subject: [PATCH 1/2] Count only added lines toward the PR size budget in AGENTS.md Deletions are cheap to review, so a PR that removes a lot of code should not be pushed into a split. Measure the ~500-line budget by insertions from `git diff --shortstat` instead of total changed lines. Co-Authored-By: Claude Opus 5.5 (1M context) Signed-off-by: Chenjie Luo --- AGENTS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index c2258770297..aaee866f830 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -48,12 +48,12 @@ These instructions apply to AI-assisted work in this repository. ## Sizing and splitting PRs -- **Keep each PR that goes up for review under ~500 changed lines of source.** +- **Keep each PR that goes up for review under ~500 added lines of source.** Large PRs stall in review; exceed the budget only when the change genuinely cannot be split — a mechanical rename, generated files, or a self-contained drop such as a new example or a new model/backend that has no working - intermediate state. Check the size with `git diff --stat ...HEAD` - before opening. + intermediate state. Deletions don't count; check the insertions from + `git diff --shortstat ...HEAD` before opening. - **Propose the split before opening an oversized PR.** When the work in flight is already over budget, offer a series of smaller PRs and, once the user agrees, do the split — don't open the big one and ask afterwards. From 8b65cf2b07213edbd57472b3e74081012bbdbdc0 Mon Sep 17 00:00:00 2001 From: Chenjie Luo Date: Thu, 1 Oct 2026 06:45:52 +0000 Subject: [PATCH 2/2] Exclude tests and docs from the PR size budget in AGENTS.md The budget covers source lines, but `git diff --shortstat` also counted the tests every sub-PR must carry. Exclude tests/ and docs/ via pathspec. Co-Authored-By: Claude Opus 5.5 (1M context) Signed-off-by: Chenjie Luo --- AGENTS.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index aaee866f830..c2cebc9a399 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -52,8 +52,9 @@ These instructions apply to AI-assisted work in this repository. Large PRs stall in review; exceed the budget only when the change genuinely cannot be split — a mechanical rename, generated files, or a self-contained drop such as a new example or a new model/backend that has no working - intermediate state. Deletions don't count; check the insertions from - `git diff --shortstat ...HEAD` before opening. + intermediate state. Deletions, tests, and docs don't count; check the + insertions from `git diff --shortstat ...HEAD -- . ':!tests' ':!docs'` + before opening. - **Propose the split before opening an oversized PR.** When the work in flight is already over budget, offer a series of smaller PRs and, once the user agrees, do the split — don't open the big one and ask afterwards.