Skip to content

ci: require a whole-change check in pull requests that change docs or code - #235

Merged
eizedev merged 2 commits into
mainfrom
ci/whole-change-check
Nov 25, 2026
Merged

eizedev merged 2 commits into
mainfrom
ci/whole-change-check

Conversation

@eizedev

@eizedev eizedev commented Nov 25, 2026

Copy link
Copy Markdown
Owner

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.

  • Template: a "Whole-change check" section. Its prompts sit in a comment, so the untouched template does not pass.
  • CI: whole-change-check.yml runs build/whole-change-check.js on opened, synchronize, reopened and edited pull requests to main. It fails when the pull request changes docs/**/*.md, a README, root Markdown, a module's Components/, Public/, Private/, Apps/ or .psm1, shared/ or build/, and the description has no ## Whole-change check with text under it. Editing the description re-runs it.
  • Security: pull_request, never pull_request_target; contents: read; persist-credentials: false. The body, title and author reach the script only through env; no ${{ }} inside run (asserted in tests/js/ci.test.js).
  • Exempt: Dependabot (author dependabot[bot]) and release pull requests (title chore(<scope>): release … x.y.z or chore(release): … x.y.z). The title is the author's word; the review sees it.
  • Growth guard: a function, file or page that grew now says: stop and check the whole, then reshape for real or raise the baseline with the reason in the whole-change check and the maintainer's approval; never merge lines or cut words to pass.
  • Rules: the AGENTS.md growth paragraph and CONTRIBUTING.md's "Make a change" say the same.

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. Nothing removed.
  • AGENTS.md: I extended the existing growth paragraph by one sentence instead of adding a section.
  • CONTRIBUTING.md: step 5 "Open a pull request" says what the check needs, where a contributor reads it before opening.
  • I left docs/decisions/0010-growth-guards-are-a-ratchet.md as it is: "the pull request says why" is still true, and an accepted record is history.

Code, each read whole:

  • build/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 only process.env.
  • build/growth.js: I rewrote ADVICE for powershell, javascript and docs and the ACCEPT line. The shared wording is in STOP; ACCEPT stays the one place for raising the baseline. duplication stays as it is: its threshold is fixed and has no baseline to raise.
  • Tests: a new unit test file for the script. tests/js/ci.test.js gets one test for the new workflow. tests/js/growth.test.js checks the new message instead of "Shorten the page".

Neutral review

A separate read-only session reviewed the commit against the whole repository. Security found nothing: pull_request only, contents: read, and the body only through env. I fixed:

  • The showcase apps (modules/*/Apps/) were out of scope; now in scope.
  • The release exemption matched any chore(...): release title. It now needs a version at the end (test: "chore(docs): release notes page" is not exempt).
  • A # line inside a code fence counted as a heading. Fences are now tracked (two tests).
  • The changed files are listed with --no-renames, so a file moved out of scope still counts.
  • A filler sentence in CONTRIBUTING.md and the script header's mention of another repository are removed.

Left as is:

  • docs/site/ scripts and modules/*/examples/ stay out of scope, as the scope I was given lists.
  • Any text with a letter passes ("n/a" too): 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: 0 failures.
  • npm run growth: powershell, javascript, duplication, docs ok.
  • npm run lint: 0 errors (9 existing react-hooks warnings in files this change does not touch).
  • actionlint .github/workflows/whole-change-check.yml: clean.
  • This pull request changes build/ and root Markdown, so the new job runs on it.

🤖 Generated with Claude Code

eizedev and others added 2 commits November 25, 2026 23:12
… 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
- build/whole-change-check.js and whole-change-check.yml: fail a pull
  request that changes docs/, a README, root Markdown, a module's
  Components/, Public/, Private/ or .psm1, shared/ or build/ 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, file or page that grew says to stop and check
  the whole, then reshape or raise the baseline with a reason
- AGENTS.md, CONTRIBUTING.md: the raised baseline's reason and the check

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>
@eizedev
eizedev merged commit 77094ad into main Nov 25, 2026
12 checks passed
@eizedev
eizedev deleted the ci/whole-change-check branch November 25, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant