fix(release): unblock the release train's scope gate for mcp version PRs - #104
Conversation
Two latent breakages that would make the train refuse every Version PR bumping @openrouter/mcp: 1. verify-version-pr-scope.sh rejected packages/mcp/src/version.ts, the committed gen:version output that pnpm run version regenerates in every Version PR (see publish.yaml). Allowlist it and content-vet its diff against the fixed gen-version.mjs output shape, same as package.json. 2. packages/agent/package.json carried a literal \u2014 escape in its description; changeset version re-serializes with JSON.stringify and normalizes it to the literal em-dash, so every Version PR showed a non-version diff line and failed the content vet. The parsed string is identical, so package metadata is unchanged.
| OK_VERSION_TS_LINE = re.compile( | ||
| r"^[+-]\s*(//.*|/\*\*.*\*/|export const PACKAGE_VERSION = \x27[^\x27]+\x27;)?\s*$" | ||
| ) |
There was a problem hiding this comment.
🟨 Block-comment allowance in the version.ts scope check lets executable code pass the auto-merge gate
The new content vet for packages/*/src/version.ts accepts any changed line matching /\*\*.*\*/. Because .* may itself contain */ ... /*, a line such as +/** */globalThis.x=eval(process.env.P)/**/ satisfies the regex while being valid, executing TypeScript. The gate's stated purpose (see the header comment at .github/scripts/verify-version-pr-scope.sh:20-22) is that "a smuggled statement can't ride the auto-merge either", but this alternative breaks that guarantee: version.ts is imported by the mcp package and is compiled/executed by CI and publish jobs (.github/workflows/release-train.yaml:211-228 auto-merges once this check passes).
Was this helpful? React with 👍 or 👎 to provide feedback.
Problem
While triaging why CI on main has been red (release stall since 2026-08-04), I regenerated the stale Version Packages PR #88 against current main and ran the release train's scope gate (
verify-version-pr-scope.sh) against it. It failed on two false positives that would block every Version PR bumping@openrouter/mcp:packages/mcp/src/version.tsrejected aspath outside allowlist— but this is the committedgen:versionoutput thatpnpm run versiondeliberately regenerates inside every Version PR (see theversion:note in publish.yaml). The allowlist was written beforegen:versionexisted.non-version change in packages/agent/package.json— main's package.json contains a literal\u2014escape indescription.changeset versionre-serializes viaJSON.stringify, which emits the literal em-dash, so every regenerated Version PR carries a spurious non-version diff line. (The parsed JSON string is byte-identical, so published metadata does not change.)Fix
packages/*/src/version.tsand content-vet it against the fixedgen-version.mjsoutput shape (comment lines / thePACKAGE_VERSIONconstant only) — same fail-closed treatment as package.json, so a smuggled statement still can't ride the auto-merge. Regex negative-tested againstimport/require/evalpayloads.packages/agent/package.json.Notes
changeset-release/main, previously CONFLICTING since 2026-08-03) is now MERGEABLE with all checks green. After this lands I'll re-version it on top of the new main so its diff vets clean.openrouter-port-botGitHub App installation (id 151022729) doesn't includetypescript-agent, so every Release / Release train run 404s minting its token.