docs(review-checklist): rule 35 — a published package's src change needs a version bump - #1884
Merged
Merged
Conversation
…ion bump The version guard's own comments explain why it exists, and they live in .github/workflows/package-version-guard.yml — a file nobody editing commonly-mcp/src/tools.js opens. The rule cost a red CI run on #1876 today, so it goes where an author and a reviewer actually read: rule 35 of the incident-derived checklist, with the three ways it can fail (no bump, a bump below base, a version an older open PR already claimed) and the things it deliberately permits (tests, docs, anything outside $pkg/src). Numbered 35, not 34: #1877 landed its own rule 34 on main while this was open, and the two additions conflict in the same file. Renumbered rather than inserted above it, so the file's numbering stays ascending.
samxu01
force-pushed
the
docs/review-checklist-package-version-guard
branch
from
September 25, 2026 12:27
ea64d96 to
43cc947
Compare
…essage actually printed Two phrases wren held the rule on (73940/73941), both against the artifact: - "its second job" → the guard is a single job (`Source changed ⇒ version bumped`) and the `gh` calls are in its second check step, `No older open PR is taking this package to the same version`. - the earned note's "named the file, the count of changed src files and both versions" → #1876's red run (36114019989 at `ac62996d`) printed `commonly-mcp/src changed (1 file(s)) but version is still 0.3.12`: the package, the count, and the version it was still on. A no-bump failure has only one version to name — only the below-base arm has two — and the annotation lands on `commonly-mcp/package.json`, not on the source file that moved. Docs-only, one line of prose; the re-gate covers these lines.
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.
What this is
Rule 34 for
docs/development/review-checklist.md, the incident-derived reviewer checklist. Docs only — one file, no code, no test changes.Why it is worth a file
The version guard already documents itself, at length and well — in
.github/workflows/package-version-guard.yml, which is exactly the file someone editingcommonly-mcp/src/tools.jshas no reason to open. The rule therefore exists in the repo and reaches none of the people it applies to. That is the same shape as the defects the guard was written for: knowledge present, reader absent.It cost a red run today. #1876 fixed
commonly-mcp/src/tools.js; the tool suite was green,lint:tswas clean, and CI went red on this guard alone. The fix was one commit (0.3.12 → 0.3.13), which is the right size — but I only knew that because the guard's message happened to be specific.What the rule says, and what it deliberately does not
Three ways the guard fails a PR, each predictable from the checklist now:
$pkg/srcmoved and the version still equals base's.cli0.1.30 → 0.1.31 touch different files, merge with no conflict, and npm ends up with one 0.1.31 built from both PRs' source. Older PR keeps the number; the newer picks the next.What it does not require is also stated, because a reviewer pattern-matching on "version guard" will otherwise demand bumps for tests: tests, docs, and anything outside
$pkg/srcneed none. A backend-test-only change needs none. The guard says so by name (· cli: no src changes).Two operator facts included because they change how a red run should be read:
sort -Vorders1.0.0before1.0.0-beta.1, inverting in both directions, so0.1.0-beta.1→0.1.0would be rejected as a backwards move. Compare such a PR by hand.ghcall in the guard's second job is fatal on failure on purpose: an unchecked failure yields an empty version list, which reads as "this PR bumps nothing" and passes. A guard going blind must not look like a clean run.Verification
Re-read the guard at
main(a2913955) rather than citing it from memory:on.pull_request.typesincludeseditedfor base retargeting; the source test isgit diff --name-only "$BASE"...HEAD -- "$pkg/src"forpkg in cli commonly-mcp; the "below base" branch is thenewest != head_vcase; the prerelease case refuses; the second job'sproposed()returns non-zero on a failedgh api. Each of those is what the rule text claims.No test is added: the artifact is prose about an existing guard, and the guard's own behaviour is what CI verifies. The reviewer gate for this PR is "is any sentence here false of the guard as it stands", which is why the two awkward cases (prerelease, and the deliberate fatality) are stated rather than smoothed over.
Rebased: this is rule 35, not 34
#1877 landed its own rule 34 on main while this was open, in the same file. GitHub reported the PR
DIRTY, and the measurement agrees:git merge-tree --write-tree HEAD origin/mainexits 1 with three conflict stages ondocs/development/review-checklist.md. Rebased ontoe3a32f32and renumbered to 35 so the file's numbering stays ascending; the rule's content is unchanged.Recorded because the shape recurs: a numbered list is a shared counter, and each author sees only their own next number. Here git caught it as a textual conflict, which is the lucky version — the same class as the guard's second job, where two branches claim one version and merge clean.