Repository navigation
ci: require a whole-change check in pull requests that change docs or code - #959
Merged
Merged
Conversation
… code The growth guards count lines, and a number cannot judge sense: pages and functions grew by appending, and a failing guard was passed by squeezing lines or cutting words. The guard stays an alarm. A pull request that changes docs or code now says in its description what its author read whole and how the change reshaped it, and the review judges that. - PULL_REQUEST_TEMPLATE.md: a "Whole-change check" section with its prompts in a comment, so the untouched template does not pass - scripts/whole-change-check.js and whole-change-check.yml: fail a pull request that changes docs/, a README, root Markdown, packages/*/src or scripts/ without text in that section; runs again on an edited description; the description reaches the script only through env; Dependabot and release pull requests are exempt - growth.js: a function or page that grew says to stop and check the whole, then reshape or raise the baseline with a reason - AGENTS.md, CONTRIBUTING.md, PRODUCT.md: the raised baseline's reason and the check as a deliverable Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- a release pull request's title ends in its version, so a "chore(release): ..." clean-up is no longer exempt - a "#" line inside a code fence of the description is no heading - the changed files are listed without rename detection, so a file moved out of scope still counts by its old path - the script names no other repository; wording aligned where the review found two texts disagreeing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The growth guards count lines, and a number cannot judge sense. Pages and functions grew by appending, and a failing guard was passed by squeezing lines or cutting words. The guard stays an alarm. A pull request that changes docs or code now carries a written whole-change check, and the review judges it.
whole-change-check.ymlrunsscripts/whole-change-check.jsonopened,synchronize,reopenedandedited. It fails when the pull request changesdocs/**/*.md, a README, root Markdown,packages/*/srcorscripts/and the description has no## Whole-change checkwith text under it. Editing the description re-runs it.pull_request, neverpull_request_target;contents: read;persist-credentials: false. The body, title and author reach the script only throughenv; no${{ }}insiderun(asserted intests/workflows.test.js).dependabot[bot]) and release pull requests (titlechore(release): … x.y.zorchore(<scope>): release … x.y.z). The title is the author's word; the review sees it.Whole-change check
Docs, each read whole:
.github/PULL_REQUEST_TEMPLATE.md(a contributor opening a pull request; task: know what to write). The new section sits after the Summary. Its prompts are one comment, so the page people see stays as short as before. The growth line of the test plan now points to the check instead of the Summary. Nothing removed.AGENTS.md, Commands: I rewrote the second growth line instead of adding one.CONTRIBUTING.md: I rewrote the known-entry bullet (summary to whole-change check, "fixes" to "decides"). "Pull request" gets one bullet between the issue and the tests, where a contributor reads it before opening.PRODUCT.md, "What a contribution delivers": the check is a deliverable, so it is one bullet in that list. The growth sentence there now says "decides", as CONTRIBUTING does.Code, each read whole:
scripts/whole-change-check.js: new, one job: the verdict on a pull request's description. Pure functions (inScope,sectionText,exemption,check) and a thin main that reads onlyprocess.env.scripts/growth.js: I rewroteADVICEfor functions and docs. The shared wording is extracted intoSTOPandOR_RAISE.unusedandduplicationstay as they are: an unused export is deleted, and duplication has a fixed threshold with no baseline to raise.tests/workflows.test.jsgets one test for the new workflow, as each workflow concern has its own test there.Neutral review
A separate read-only session reviewed the commit against the whole repository. Security found nothing:
pull_requestonly,contents: read, and the body only throughenv. I fixed:chore(release):title. It now needs a version at the end (test: "chore(release): fold the unreleased entries ..." is not exempt).#line inside a code fence counted as a heading. Fences are now tracked (two tests).--no-renames, so a file moved out of scope still counts.Left as is: any text with a letter passes ("n/a" too), because the check asks for the judgement and the review judges it. A pull request with merge conflicts has no merge ref, so the check does not run until the conflict is resolved.
Test plan
npm test: all workspaces andtests/*.test.jspass, 0 failures.npm run growth: functions, unused, duplication, docs ok.npm run lint,npm run types: clean.actionlint .github/workflows/whole-change-check.yml: clean.run, andeditedremoved from the types, each maketests/workflows.test.jsfail.scripts/and root Markdown, so the new job runs on it.🤖 Generated with Claude Code