LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtNov 9, 2026, 4:09 PM
updatedAtNov 10, 2026, 1:48 AM
githubUrlhttps://github.com/neomjs/neo/issues/20664
authorneo-opus-grace
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 10, 2026, 1:48 AM
milestonev13.5

publish.mjs prepare sets the version in its release commit

Closed v14.0.0/archive-v14-0-0-chunk-1 enhancementaibuild
neo-opus-grace
neo-opus-grace commented on Nov 9, 2026, 4:09 PM

Context

On 2026-11-09 the operator directed a new ticket for this ("a new ticket mentioning the closed one is cleaner"), after Vega's evidence from the 13.4.0 cut. #19827 ("publish.mjs prepare sets the release version itself") was closed not planned on 2026-10-16 at his direction ("bumping package.json before prepare works as is"). Its PR #19828 was closed unmerged at a reviewed head.

What the 13.4.0 cut showed:

  • The bump cannot be a one-file edit. A manual bump must drop the last released note in the same commit, or test/playwright/unit/buildScripts/release/PublishReleaseNoteOrphan.spec.mjs fails.
  • The committed Portal index still points at the dropped note. apps/portal/resources/data/releases.json keeps the reference until something regenerates it, so dev's news route fetches a 404 page.
    • 13.4.0: CI caught it on #20658's first head through test/playwright/e2e/portal/NewsTabOverflow.spec.mjs (#20599). A second commit (508dcb93f5) regenerated the index.
    • 13.3.1: #20024 made the same drop without touching the index, before any spec covered news routes.
  • Each cut whose notes merge before the bump pays twice: an extra ticket, PR, full CI run, review and operator merge (13.4.0: #20656 → #20658).

The Problem

The version is a manual precondition of the cut, but three things must change with it: package.json and package-lock.json, the drop of the released note, and the Portal release index. prepare already does the last two in its release commit. The manual bump splits them across two PRs and two merges, and dev breaks in the gap between those merges. Since #20599, CI refuses a bump that skips the index, so the broken news route can no longer reach dev. What remains is a second PR per cut and three coupled hand edits that each cut must remember.

The Architectural Reality

  • buildScripts/release/publish.mjs:60 reads the version from package.json when it loads. The comment at :61 says it "was bumped to before the cut", and the summary at :9 lists "version bumped" as a preflight condition.
  • prepare already does the rest, then commits to release/v<version>:
    • It drops every note older than the version being released (publish.mjs:71).
    • It stamps the note.
    • It runs prepare.mjs, which regenerates the Portal release index (prepare.mjs:14 imports createReleaseIndex from buildScripts/docs/index/release.mjs).
    • It runs build-all.
  • releaseState.mjs:91 blocks an existing tag with "bump package.json first", and :182 ends with "(bump package.json)".
  • buildScripts/README.md:80 says prepare.mjs "Handles version bumping, changelog generation, and git tagging". It does none of the three.
  • package.json defines no preversion, version or postversion scripts (checked at origin/dev), so npm version <v> --no-git-tag-version touches only package.json and package-lock.json.
  • Design authority: the operator on 2026-11-09, "a new ticket mentioning the closed one is cleaner". On the 13.4.0 evidence, it supersedes his 2026-10-16 "bumping package.json before prepare works as is" (#19827).

The Fix

  • publish.mjs prepare --version <semver>.
    • The preflight requires a valid semver newer than package.json's version, its note present and no existing tag.
    • The release commit sets the version first, with npm version <v> --no-git-tag-version.
    • It then runs the existing steps: the note drop, the stamp, prepare.mjs (which propagates the version and regenerates the Portal index) and build-all. The bump, the drop and the index land in one commit.
  • finish derives the version from origin/dev's package.json, which the merged release PR set.
  • Stale messages and docs that ask for a manual bump are corrected: releaseState.mjs:91 and :182, publish.mjs:9 and :61, and buildScripts/README.md:80.
  • Starting point: #19828's reviewed head, where it still applies. Its RA-1, to canonicalize the target version before deriving the release identity, was addressed there.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
publish.mjs prepare --version <semver> the operator, 2026-11-09; #19827's design the release commit sets the version, then drops released notes and regenerates the Portal index a missing or malformed --version stops prepare before any read, naming the flag; one not newer than package.json's fails the build-step preflight, because a resumed prepare runs on its release branch, where package.json already carries the version publish.mjs JSDoc, buildScripts/README.md unit (ReleaseState.spec.mjs), --rehearse receipt
publish.mjs finish: the version source the same read from origin/dev's package.json none publish.mjs JSDoc unit or --rehearse receipt

Decision Record impact: none.

Acceptance Criteria

  • A missing or malformed --version stops prepare before any read, and one not newer than package.json's fails the build-step preflight; each names the problem (unit, ReleaseState.spec.mjs).
  • prepare --version <next> --rehearse on the current tree reports the version check as passing (receipt).
  • The release commit sets package.json and package-lock.json to the version before prepare.mjs runs. The released-note drop and the regenerated apps/portal/resources/data/releases.json land in that same commit (source plus --rehearse receipt).
  • finish derives the version from origin/dev.
  • No doc or message still asks for a manual package.json bump.
  • Post-merge: the next cut runs without a separate bump PR, and NewsTabOverflow.spec.mjs stays green on dev throughout. This one can only be verified after merge.

Out of Scope

  • Note content: the stamped counts and the banner.
  • Which notes PublishReleaseNoteOrphan.spec.mjs allows.
  • The SSR snapshots of example pages (middleware-v2).

Avoided Traps

  • Reopening #19827: its not-planned is the operator's recorded decision. A new ticket keeps that record intact, as he directed.
  • A bump script that also regenerates the index: it keeps the second PR per cut and the three coupled edits. CI already guards the window, so the only gain would be convenience.

Related

  • #19827: closed not planned; this ticket supersedes its premise with the 13.4.0 evidence.
  • #19828: its reviewed PR, closed unmerged.
  • #20656, #20658: the 13.4.0 bump.
  • #20024: the 13.3.1 bump.
  • #20599: the news-route spec.
  • #20655: the 13.4.0 cut record.

Not good first issue: I own it and build it, and Vega reviews.

Live latest-open + closed sweep: checked all 7 open issues (green band, under 25) and a closed search ("release version bump prepare") at 15:08Z, reading Out of Scope and Avoided Traps on #19637 and #20656. No equivalent or prior exclusion exists beyond #19827 itself. A2A claim sweep: the last 30 messages in all read states (13:48Z to 15:06Z) carry no claim on the release pipeline. Vega's Tier 2.5 on #19827 is this ticket's source. MC sweep ("manual version bump before release cut extra PR, released note drop, Portal release index 404"): 5 results, no prior decision beyond #19827's not-planned. Own-assignment sweep: 0 open.

Origin Session ID: a8b5ad5e-2840-4d22-8b3b-a1b21344abe9 Retrieval Hint: "publish.mjs prepare --version release commit bump note drop Portal releases index one commit"

tobiu referenced in commit 5343d94 - "feat(release): publish.mjs prepare sets the version in its release commit (#20664) (#20678) on Nov 10, 2026, 1:48 AM
tobiu closed this issue on Nov 10, 2026, 1:48 AM