From a1b03b20886282f81c22b0719b6f5d35b1d38a76 Mon Sep 17 00:00:00 2001 From: leemour Date: Mon, 23 Nov 2026 15:20:09 +0100 Subject: [PATCH 1/2] feat(release): 1.0 release rules for policy B: experimental and deprecated headings, real majors, rc on next MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CHANGELOG_HEADINGS gains "Changed — experimental" and "Deprecated"; both need a minor. "Changed — may break callers" and "Removed" stay for the stable API and need a major from 1.0.0 on (level.ts). - level.ts reads pre-release versions (1.0.0-rc.1 counts as 1.0.0) and takes the last plain release as the one below the top section. - next-version keeps a taken x.0.0 a major (2.0.0 → 3.0.0, not 2.1.0). - bin/release stops a version that raises the major unless run with --major; a pre-release publishes under npm's next tag, from bin/release and from release.yml (npm refuses a pre-release without a tag). - The optional peers commander and vitest are ^15.0.0 and ^5.0.0. - WC-REL-7 describes the 1.0 rules; WC-DOC-15 lists seven headings. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 5 +++-- CHANGELOG.md | 26 ++++++++++++++++++++++++-- bin/release | 22 ++++++++++++++++------ docs/PUBLISHING.md | 2 +- docs/dev/RELEASING.md | 2 +- docs/standards/docs.md | 5 +++-- docs/standards/releases.md | 27 ++++++++++++++++++--------- package.json | 4 ++-- scripts/next-version.mjs | 7 ++++++- src/dev/dev.test.ts | 6 ++++++ src/dev/main.ts | 2 +- src/dev/next-version.ts | 10 ++++++++-- src/release/fragments.ts | 15 +++++++++++++-- src/release/level.test.ts | 22 ++++++++++++++++++++++ src/release/level.ts | 29 ++++++++++++++++++----------- 15 files changed, 142 insertions(+), 42 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3bddbc30..9b4b83f5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,7 +99,8 @@ jobs: with: name: package # Permit checking an already published version; this job has no publishing permissions. - - run: npm publish ./*.tgz --access public --dry-run --force + # A pre-release goes to the next tag: npm refuses one without a tag, and latest must stay a release. + - run: npm publish ./*.tgz --access public --dry-run --force $(case "$(ls ./*.tgz)" in *[0-9]-*.tgz) echo --tag next ;; esac) publish: needs: build @@ -124,7 +125,7 @@ jobs: # npm, not pnpm: npm's trusted publishing is the documented path. A tarball runs no # lifecycle scripts, and nothing is installed here. - - run: npm publish "wirecat-cli-base-$VERSION.tgz" --access public + - run: npm publish "wirecat-cli-base-$VERSION.tgz" --access public $(case "$VERSION" in *-*) echo --tag next ;; esac) - name: wait for npm to show the version if: ${{ !inputs.dry_run }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 06bb90e7..b1f426aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,28 @@ Versions before 0.8.0 are in the [git tags](https://github.com/WireCatLabs/cli-b Every entry says what changed as a caller sees it, why, and what to watch for — the rules are [`docs/dev/CONVENTIONS.md`](docs/dev/CONVENTIONS.md#the-changelog). +## Unreleased + +### Added + +- **Two changelog headings for libraries on their way to 1.0: "Changed — experimental" and "Deprecated".** Both need + a minor release. "Changed — may break callers" and "Removed" stay for the stable API and, from 1.0.0 on, need a + major. See [WC-REL-7](docs/standards/releases.md). +- **`bin/release --major`.** A version that raises the major over npm's latest now stops unless this flag is given. + +### Changed — may break callers + +- **The version-level check reads 1.0.0 rules.** From 1.0.0 on, a stable break needs a major, an experimental change + a minor. A release candidate (`1.0.0-rc.1`) counts as its plain version and is never read as the release below. +- **The optional peers `commander` and `vitest` are now `^15.0.0` and `^5.0.0`** instead of open ranges: `./commands` + and `./skill` use commander internals that a new major may change. + +### Fixed + +- **`next-version` keeps a taken major a major**: with 2.0.0 on npm, `2.0.0` gives `3.0.0`, not `2.1.0`. +- **A pre-release is published under npm's `next` tag**, from `bin/release` and from the release workflow. npm refuses + a pre-release without a tag, and `latest` must stay a release. + ## 0.132.0 — 23.11.2026 ### Added @@ -1518,7 +1540,7 @@ Every entry says what changed as a caller sees it, why, and what to watch for fails as stale once the warning is gone. A CLI that keeps its short command name says why this way. - **`docs:check` refuses an entry under no `###` heading in the top changelog section.** It passed one, so a release could ship notes with an entry outside the five headings - ([the changelog rule](docs/standards/docs.md#wc-doc-15--changelog-entries-go-under-five-fixed-headings-each-at-most-once-per-section)). + ([the changelog rule](docs/standards/docs.md#wc-doc-15--changelog-entries-go-under-seven-fixed-headings-each-at-most-once-per-section)). Older sections are not checked: they are frozen, and several CLIs have such entries in them. - **The handbook's lines about gcal match gcal again:** `store status` (not `status`), a calendar sync's 15-minute terminal deadline, all-day events matched by local date, `mcp serve --profiles` built, gcal's own Node 22 job and @@ -2169,7 +2191,7 @@ Every entry says what changed as a caller sees it, why, and what to watch for ` / ci / coverage` to its required checks. With `cli: true`, `test:matrix:check` moves from `check` to `coverage` and reads the shards' argv logs joined. Default 1: the tests stay in `check`, as before. - **Before 1.0.0, a release with a breaking change raises the minor version** - ([Releases](docs/standards/releases.md#wc-rel-7--versions-are-xyz-before-100-a-breaking-change-raises-the-minor)). + ([Releases](docs/standards/releases.md#wc-rel-7--versions-are-xyz-a-break-of-the-stable-api-raises-the-major-from-100-on-and-the-minor-before-it)). A section with an entry under "Changed — may break callers" or "Removed", or a new feature, raises the minor; only fixes and document changes raise the patch. npm's `^0.x.y` takes every patch of that minor, so a patch must not break anyone. The rule used to allow a breaking change in a patch release. diff --git a/bin/release b/bin/release index 160e755e..ebe2c41c 100755 --- a/bin/release +++ b/bin/release @@ -7,6 +7,7 @@ # # bin/release # publishes from GitHub Actions (.github/workflows/release.yml) # bin/release --local # publishes from this machine: the keyring entry NPM_KEYRING_ACCOUNT names, else npm's login +# bin/release --major # also allows a new major version; without it, a version that raises the major stops # # The npm token is never printed — not on success, not in an error. set -eu @@ -24,11 +25,14 @@ rerun_if_changed() { } mode=ci -case "${1:-}" in - "") ;; - --local) mode=local ;; - *) echo "usage: bin/release [--local]" >&2; exit 2 ;; -esac +major="" +for flag in "$@"; do + case "$flag" in + --local) mode=local ;; + --major) major=1 ;; + *) echo "usage: bin/release [--local] [--major]" >&2; exit 2 ;; + esac +done git fetch -q origin [ "$(git branch --show-current)" = "main" ] || { echo "not on main" >&2; exit 1; } @@ -118,6 +122,11 @@ if published; then echo "$version is already on npm — raise the version first" >&2 exit 1 fi +# A major breaks every caller of the stable API, so it ships only when the owner chose to (WC-REL-7). +if [ "${version%%.*}" != "${latest%%.*}" ] && [ -n "$latest" ] && [ -z "$major" ]; then + echo "$version raises the major version over npm's $latest — run bin/release --major if that is meant" >&2 + exit 1 +fi if [ "$mode" = ci ]; then last_run() { @@ -154,7 +163,8 @@ if [ -n "${NPM_KEYRING_ACCOUNT:-}" ]; then fi echo "== publishing $version ==" -pnpm publish --access public --no-git-checks +case "$version" in *-*) tag=next ;; *) tag=latest ;; esac +pnpm publish --access public --no-git-checks --tag "$tag" echo "== waiting for npm to show $version (up to three minutes) ==" seen="" diff --git a/docs/PUBLISHING.md b/docs/PUBLISHING.md index 2edbb18a..155beccf 100644 --- a/docs/PUBLISHING.md +++ b/docs/PUBLISHING.md @@ -27,7 +27,7 @@ Nothing is published to Homebrew, winget, scoop, apt or skills.sh. skills.sh rea | Where | Version | Comes from | |---|---|---| -| npm, git tag, GitHub release, MCP Registry | `x.y.z` ([WC-REL-7](standards/releases.md#wc-rel-7--versions-are-xyz-before-100-a-breaking-change-raises-the-minor)) | `package.json` | +| npm, git tag, GitHub release, MCP Registry | `x.y.z` ([WC-REL-7](standards/releases.md#wc-rel-7--versions-are-xyz-a-break-of-the-stable-api-raises-the-major-from-100-on-and-the-minor-before-it)) | `package.json` | | ClawHub | its own `1.0.x`: the next patch after the latest **public** version, or `--version` | the ClawHub CLI | | Claude plugin `plugin.json` | the npm version at the skill's last change | claude-plugins `bin/sync-skills` | | `metadata.version` in an installed or indexed `SKILL.md` | the installed npm version, or cli-docs' `docsRef` | `withVersion` in [`src/skill`](../src/skill/index.ts) | diff --git a/docs/dev/RELEASING.md b/docs/dev/RELEASING.md index a22704ef..4a295e63 100644 --- a/docs/dev/RELEASING.md +++ b/docs/dev/RELEASING.md @@ -3,7 +3,7 @@ Raise `version` in `package.json` and date the `## Unreleased` section of [`CHANGELOG.md`](../../CHANGELOG.md) as that version, through a pull request. Before 1.0.0, a section with an Added, "Changed — may break callers" or Removed entry raises the minor; only fixes and document changes raise the patch -([Releases](../standards/releases.md#wc-rel-7--versions-are-xyz-before-100-a-breaking-change-raises-the-minor)). +([Releases](../standards/releases.md#wc-rel-7--versions-are-xyz-a-break-of-the-stable-api-raises-the-major-from-100-on-and-the-minor-before-it)). Merge it, then on `main`: ```sh diff --git a/docs/standards/docs.md b/docs/standards/docs.md index 45ae09b6..d3572e08 100644 --- a/docs/standards/docs.md +++ b/docs/standards/docs.md @@ -157,11 +157,12 @@ Rule ids on this page are `WC-DOC-`. How to read a rule, how ids work and whi - **Applies to:** all CLIs and shared libraries. **Since:** cli-base 0.41.0; the empty-section check since the release after 0.93.0. **Rulings:** none. -### WC-DOC-15 · Changelog entries go under five fixed headings, each at most once per section +### WC-DOC-15 · Changelog entries go under seven fixed headings, each at most once per section - **Why:** one heading set lets a reader, an agent and one guard read every repository the same way. - **Enforced by:** `pnpm docs:check` · `changelog-guard.yml`. -- **Example:** `### Added`, `### Changed — may break callers`, `### Fixed`, `### Security`, `### Removed`. max-cli +- **Example:** `### Added`, `### Changed — may break callers`, `### Changed — experimental`, `### Deprecated`, `### Fixed`, + `### Security`, `### Removed`. max-cli uses this fixed Russian rendering: `Что нового`, `Изменено — может сломать скрипты`, `Исправлено`, `Безопасность`, `Удалено`. Every entry sits under one of them: `docs:check` refuses an entry under no heading in the top section. diff --git a/docs/standards/releases.md b/docs/standards/releases.md index 88ef44af..3746d58a 100644 --- a/docs/standards/releases.md +++ b/docs/standards/releases.md @@ -82,16 +82,25 @@ on the [CI](ci.md) page. - **Exceptions:** a shared library that prints no version has no `src/version.ts`. - **Applies to:** all CLIs. **Since:** cli-base 0.41.0. **Rulings:** none. -### WC-REL-7 · Versions are `x.y.z`; before 1.0.0 a breaking change raises the minor +### WC-REL-7 · Versions are `x.y.z`; a break of the stable API raises the major from 1.0.0 on, and the minor before it -- **Why:** npm's `^0.40.4` takes every `0.40.x`, so a patch reaches callers who never read its changelog. It must not - break them. -- **Enforced by:** review only. -- **Example:** raise the minor (`0.40.4` to `0.41.0`) for a release with a new feature or with any entry under - "Changed — may break callers" or "Removed". Raise the patch (`0.40.4` to `0.40.5`) only when every entry is a fix - or a change to the documents. -- **Exceptions:** a pre-release version (`0.41.0-rc.1`) is chosen by hand. -- **Applies to:** all CLIs and shared libraries. **Since:** cli-base 0.41.0. **Rulings:** none. +- **Why:** npm's `^1.4.0` takes every `1.x`, so a minor reaches callers who never read its changelog: it must not break + what the package promises to keep. A library promises only its stable API; what it marks experimental may change in + a minor, so majors stay rare and work does not wait for them (NEED-2893). +- **Enforced by:** `: bin/release`, which also stops a version that raises the major unless it runs with + --major. +- **Example:** + - A break of the stable API goes under "Changed — may break callers" or "Removed". Before 1.0.0 it raises the + minor (`0.40.4` to `0.41.0`); from 1.0.0 on, the major (`1.4.0` to `2.0.0`). + - A change to what the library marks experimental goes under "Changed — experimental". A stable API that a later + major removes is marked deprecated and listed under "Deprecated". Both raise the minor, as "Added" does. + - Raise the patch (`1.4.0` to `1.4.1`) only when every entry is a fix or a change to the documents. + - A stable break waits for a major the owner chose. Until then it lands as an addition beside the old API, which is + deprecated, never as a change in place. +- **Exceptions:** a pre-release version (`1.0.0-rc.1`) is chosen by hand and published under npm's `next` tag; the + version check reads the last plain release as the one below it. +- **Applies to:** all CLIs and shared libraries. **Since:** cli-base 0.41.0; the 1.0.0 rules since the next release. + **Rulings:** NEED-2893. ### WC-REL-8 · Any package may release at any time diff --git a/package.json b/package.json index 29f20489..40c14eb4 100644 --- a/package.json +++ b/package.json @@ -163,10 +163,10 @@ }, "peerDependencies": { "@scalar/openapi-upgrader": "^0.4.6", - "commander": ">=15", + "commander": "^15.0.0", "esbuild": "^0.28.0", "swagger-converter": "^2.1.0", - "vitest": ">=5" + "vitest": "^5.0.0" }, "peerDependenciesMeta": { "@scalar/openapi-upgrader": { diff --git a/scripts/next-version.mjs b/scripts/next-version.mjs index 71a19a86..543d0937 100644 --- a/scripts/next-version.mjs +++ b/scripts/next-version.mjs @@ -37,8 +37,13 @@ if (!taken.has(wanted) && compare(want, top) > 0) { process.exit(0) } +// A taken x.0.0 stays a major: 2.0.0 taken goes to 3.0.0, never to 2.1.0. const step = - want[2] === 0 ? ([major, minor]) => [major, minor + 1, 0] : ([major, minor, patch]) => [major, minor, patch + 1] + want[1] === 0 && want[2] === 0 && want[0] >= 1 + ? ([major]) => [major + 1, 0, 0] + : want[2] === 0 + ? ([major, minor]) => [major, minor + 1, 0] + : ([major, minor, patch]) => [major, minor, patch + 1] let next = step(top) while (taken.has(next.join("."))) next = step(next) console.log(next.join(".")) diff --git a/src/dev/dev.test.ts b/src/dev/dev.test.ts index 86fea04c..922e039f 100644 --- a/src/dev/dev.test.ts +++ b/src/dev/dev.test.ts @@ -34,6 +34,12 @@ describe("next-version", () => { expect((await next("1.2.1", "1.2.3", '["1.2.3","1.2.4"]')).out).toEqual(["1.2.5"]) }) + it("keeps a taken major a major, and a first 1.0.0 over 0.x as it is", async () => { + expect((await next("2.0.0", "2.0.0", '["2.0.0"]')).out).toEqual(["3.0.0"]) + out.length = 0 + expect((await next("1.0.0", "0.130.0", '["0.130.0"]')).out).toEqual(["1.0.0"]) + }) + it("passes a pre-release through, and a first publish when npm knows nothing", async () => { expect((await next("2.0.0-rc.1", "1.0.0", "")).out).toEqual(["2.0.0-rc.1"]) out.length = 0 diff --git a/src/dev/main.ts b/src/dev/main.ts index 31c0b947..9ffc25cf 100644 --- a/src/dev/main.ts +++ b/src/dev/main.ts @@ -177,7 +177,7 @@ const docsCheck = async (args: string[], io: DevIo) => { } else { const ids = [...JOURNAL_IDS, ...(values.ids?.split(",").filter(Boolean) ?? [])] changelog = { - headings: ["Added", "Changed — may break callers", "Fixed", "Security", "Removed"], + headings: CHANGELOG_HEADINGS, unreleased: "Unreleased", ids, } diff --git a/src/dev/next-version.ts b/src/dev/next-version.ts index e21242e5..900520a8 100644 --- a/src/dev/next-version.ts +++ b/src/dev/next-version.ts @@ -1,6 +1,7 @@ /** * The version `bin/release` publishes: the one in package.json when npm has not taken it and it is - * above npm's latest, else the next free one at the same bump level (x.y.0 → minor, x.y.z → patch). + * above npm's latest, else the next free one at the same bump level (x.0.0 → major from 1.0.0 on, x.y.0 → minor, + * x.y.z → patch). * npm's answers are arguments, not calls, so CI and a test can hand it any registry state. */ export const nextVersion = ( @@ -31,8 +32,13 @@ export const nextVersion = ( if (!taken.has(wanted) && compare(want, top) > 0) return { version: wanted } + // A taken x.0.0 stays a major: 2.0.0 taken goes to 3.0.0, never to 2.1.0. const step = ([major = 0, minor = 0, patch = 0]: number[]) => - want[2] === 0 ? [major, minor + 1, 0] : [major, minor, patch + 1] + want[1] === 0 && want[2] === 0 && (want[0] ?? 0) >= 1 + ? [major + 1, 0, 0] + : want[2] === 0 + ? [major, minor + 1, 0] + : [major, minor, patch + 1] let next = step(top) while (taken.has(next.join("."))) next = step(next) return { version: next.join(".") } diff --git a/src/release/fragments.ts b/src/release/fragments.ts index f29b70b8..6a9a11b7 100644 --- a/src/release/fragments.ts +++ b/src/release/fragments.ts @@ -9,8 +9,19 @@ import { idPattern } from "./markdown.js" export type Fragment = { name: string; text: string } -/** The changelog's `###` headings in the WireCat CLIs, in their order. */ -export const CHANGELOG_HEADINGS = ["Added", "Changed — may break callers", "Fixed", "Security", "Removed"] as const +/** + * The changelog's `###` headings in the WireCat CLIs, in their order. `Changed — experimental` and `Deprecated` are a + * library's: a change to what it marks experimental, and a stable API that a later major removes; both need a minor. + */ +export const CHANGELOG_HEADINGS = [ + "Added", + "Changed — may break callers", + "Changed — experimental", + "Deprecated", + "Fixed", + "Security", + "Removed", +] as const export type FragmentRules = { headings: readonly string[]; ids: readonly string[] } const NAME = /^[a-z0-9][a-z0-9._-]*\.md$/ diff --git a/src/release/level.test.ts b/src/release/level.test.ts index e3a11309..211414d9 100644 --- a/src/release/level.test.ts +++ b/src/release/level.test.ts @@ -44,3 +44,25 @@ it.each([ it("raises a 1.x release that may break callers to the next major", () => { expect(levelledVersion(unreleased(["Changed — may break callers"], "1.4.2"), "1.4.3")).toBe("2.0.0") }) + +it.each([ + ["1.5.0", ["Changed — experimental"], "1.4.0"], + ["1.5.0", ["Deprecated", "Fixed"], "1.4.0"], + ["2.0.0", ["Changed — may break callers"], "1.4.0"], + ["1.0.0", ["Removed"], "1.0.0-rc.2\n## 1.0.0-rc.1 — 20.10.2026\n## 0.9.0"], +])("from 1.0.0 on accepts %s with %j", (version, headings, previous) => { + expect(versionLevelProblem(changelog(version, headings, previous))).toBeUndefined() +}) + +it("from 1.0.0 on needs a major for a stable break, and only a minor for an experimental one", () => { + expect(versionLevelProblem(changelog("1.5.0", ["Changed — may break callers"], "1.4.0"))).toMatch( + /needs a major release/, + ) + expect(levelledVersion(unreleased(["Changed — experimental"], "1.4.0"), "1.4.1")).toBe("1.5.0") + expect(levelledVersion(unreleased(["Removed"], "1.4.0"), "1.4.1")).toBe("2.0.0") +}) + +it("leaves a release candidate as chosen and never reads one as the release below", () => { + expect(levelledVersion(unreleased(["Removed"], "0.9.0"), "1.0.0-rc.1")).toBe("1.0.0-rc.1") + expect(versionLevelProblem(changelog("1.0.0-rc.2", ["Removed"], "1.0.0-rc.1"))).toBeUndefined() +}) diff --git a/src/release/level.ts b/src/release/level.ts index a49737d1..44ef24b6 100644 --- a/src/release/level.ts +++ b/src/release/level.ts @@ -1,8 +1,13 @@ -/** The version level a changelog section needs: `Added` a minor, a break a major (a minor before 1.0.0). */ +/** + * The version level a changelog section needs. `Added`, `Deprecated` and `Changed — experimental` need a minor; a + * break of the stable API (`Changed — may break callers`, `Removed`) a major from 1.0.0 on, a minor before it. + */ const LEVELS = ["patch", "minor", "major"] as const type Level = (typeof LEVELS)[number] -const parse = (version: string) => version.split(".").map(Number) +const PLAIN = /^\d+\.\d+\.\d+$/ +// `1.0.0-rc.1` counts as 1.0.0: the pre-release tail never makes a number of its own. +const parse = (version: string) => (version.split("-")[0] ?? "").split(".").map(Number) const raised = (from: string, to: string): Level => { const [a = 0, b = 0] = parse(from) @@ -11,11 +16,10 @@ const raised = (from: string, to: string): Level => { return y !== b ? "minor" : "patch" } -// Before 1.0.0 the minor carries what a major would; a fix-only release is the only patch. const needed = (version: string, section: string): Level => { - const breaks = /^### (Changed — may break callers|Removed)$/m.test(section) - if (breaks) return (parse(version)[0] ?? 0) >= 1 ? "major" : "minor" - return /^### Added$/m.test(section) ? "minor" : "patch" + if (/^### (Changed — may break callers|Removed)$/m.test(section)) + return (parse(version)[0] ?? 0) >= 1 ? "major" : "minor" + return /^### (Added|Deprecated|Changed — experimental)$/m.test(section) ? "minor" : "patch" } const raise = (from: string, level: Level) => { @@ -30,22 +34,25 @@ const later = (x: string, y: string) => { return i === -1 || (a[i] ?? 0) > (b[i] ?? 0) ? x : y } +/** The top section and the last plain release below it: a release candidate in between is not a release. */ const sections = (changelog: string) => { - const [top, below] = [...changelog.matchAll(/^## (\S+).*$/gm)] - if (!top || !below?.[1]) return undefined - return { version: top[1], previous: below[1], section: changelog.slice(top.index, below.index) } + const [top, ...below] = [...changelog.matchAll(/^## (\S+).*$/gm)] + const previous = below.find((one) => PLAIN.test(one[1] ?? "")) + const next = below[0] + if (!top || !previous?.[1] || !next) return undefined + return { version: top[1], previous: previous[1], section: changelog.slice(top.index, next.index) } } // The next free number on npm is a patch; the top section may need a minor or major over the version below it. export const levelledVersion = (changelog: string, next: string): string => { const parts = sections(changelog) - if (!parts) return next + if (!parts || !PLAIN.test(next)) return next return later(next, raise(parts.previous, needed(next, parts.section))) } export const versionLevelProblem = (changelog: string): string | undefined => { const parts = sections(changelog) - if (!parts?.version || !/^\d+\.\d+\.\d+$/.test(parts.version)) return undefined + if (!parts?.version || !PLAIN.test(parts.version)) return undefined const { version, previous, section } = parts const want = needed(version, section) const got = raised(previous, version) From e64afc37fb3e9249b076f31e5f09237a2e390f4a Mon Sep 17 00:00:00 2001 From: leemour Date: Mon, 23 Nov 2026 15:21:47 +0100 Subject: [PATCH 2/2] docs(standards): keep the old WC-REL-7 and WC-DOC-15 anchors instead of editing released changelog sections Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 4 ++-- docs/standards/docs.md | 2 ++ docs/standards/releases.md | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1f426aa..0d8819b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1540,7 +1540,7 @@ Every entry says what changed as a caller sees it, why, and what to watch for fails as stale once the warning is gone. A CLI that keeps its short command name says why this way. - **`docs:check` refuses an entry under no `###` heading in the top changelog section.** It passed one, so a release could ship notes with an entry outside the five headings - ([the changelog rule](docs/standards/docs.md#wc-doc-15--changelog-entries-go-under-seven-fixed-headings-each-at-most-once-per-section)). + ([the changelog rule](docs/standards/docs.md#wc-doc-15--changelog-entries-go-under-five-fixed-headings-each-at-most-once-per-section)). Older sections are not checked: they are frozen, and several CLIs have such entries in them. - **The handbook's lines about gcal match gcal again:** `store status` (not `status`), a calendar sync's 15-minute terminal deadline, all-day events matched by local date, `mcp serve --profiles` built, gcal's own Node 22 job and @@ -2191,7 +2191,7 @@ Every entry says what changed as a caller sees it, why, and what to watch for ` / ci / coverage` to its required checks. With `cli: true`, `test:matrix:check` moves from `check` to `coverage` and reads the shards' argv logs joined. Default 1: the tests stay in `check`, as before. - **Before 1.0.0, a release with a breaking change raises the minor version** - ([Releases](docs/standards/releases.md#wc-rel-7--versions-are-xyz-a-break-of-the-stable-api-raises-the-major-from-100-on-and-the-minor-before-it)). + ([Releases](docs/standards/releases.md#wc-rel-7--versions-are-xyz-before-100-a-breaking-change-raises-the-minor)). A section with an entry under "Changed — may break callers" or "Removed", or a new feature, raises the minor; only fixes and document changes raise the patch. npm's `^0.x.y` takes every patch of that minor, so a patch must not break anyone. The rule used to allow a breaking change in a patch release. diff --git a/docs/standards/docs.md b/docs/standards/docs.md index d3572e08..439fc5f8 100644 --- a/docs/standards/docs.md +++ b/docs/standards/docs.md @@ -157,6 +157,8 @@ Rule ids on this page are `WC-DOC-`. How to read a rule, how ids work and whi - **Applies to:** all CLIs and shared libraries. **Since:** cli-base 0.41.0; the empty-section check since the release after 0.93.0. **Rulings:** none. + + ### WC-DOC-15 · Changelog entries go under seven fixed headings, each at most once per section - **Why:** one heading set lets a reader, an agent and one guard read every repository the same way. diff --git a/docs/standards/releases.md b/docs/standards/releases.md index 3746d58a..dcf1c839 100644 --- a/docs/standards/releases.md +++ b/docs/standards/releases.md @@ -82,6 +82,8 @@ on the [CI](ci.md) page. - **Exceptions:** a shared library that prints no version has no `src/version.ts`. - **Applies to:** all CLIs. **Since:** cli-base 0.41.0. **Rulings:** none. + + ### WC-REL-7 · Versions are `x.y.z`; a break of the stable API raises the major from 1.0.0 on, and the minor before it - **Why:** npm's `^1.4.0` takes every `1.x`, so a minor reaches callers who never read its changelog: it must not break