Skip to content

Latest commit

 

History

History
1108 lines (935 loc) · 71.1 KB

RELEASING.md

File metadata and controls

1108 lines (935 loc) · 71.1 KB

Releasing MetaObjects

Who runs releases: the agent (Claude) does — end to end, for every registry. The credentials are on the maintainer's machine; there is no "hand it to the human to publish" step. Locations:

  • npm → ~/.npmrc (granular token, bypass-2FA). Publish with bun publish. It can publish but cannot change package access, so npm dist-tag rm 403s — see §4 Cleanup.
  • PyPI → the PYPI_API_TOKEN repo secret, via publish-python.yml: push a python-v<version> tag. Do not also uv publish by hand — see the PyPI procedure.
  • Maven Central → push a java-v<maven-version> tag (publish-java.yml signs and deploys from repo secrets), or locally ~/.m2/settings.xml (server ids central + gpg-credentials) + the local GPG signing key and mvn -Prelease deploy from server/java (autoPublish, so no manual staging promotion; run the eject release gate first, see the Java procedure). One route per version, never both.
  • NuGet → keyless OIDC via the publish-csharp.yml workflow: gh workflow run publish-csharp.yml (or push a csharp-v<version> tag).
  • crates.io → scripts/release.mjs publishes the four Rust crates after npm, behind the same confirm, with the token cargo login stores. See Releasing the Rust crates to crates.io.

Run network commands via the sandbox-disabled shell. Publish what changed; converge the number when you do (standing policy since 0.24.5, replacing the version-parity rule of 0.20.13): a registry publishes only when it has a changed product file, and when it does it adopts the current shared minor.patch — skipping the numbers it sat out. npm / PyPI / NuGet / crates.io on <M>.<m>.<p>, Maven on <M+7>.<m>.<p> — only the MAJOR differs, and the offset is permanent (scripts/maven-coordinate.mjs is the single derivation; every script imports it). Concretely: npm 0.25.0 is Maven 7.25.0, and npm 1.0.0 is Maven 8.0.0. Do not type a literal 7. anywhere — at the 1.0 cut it asks Central for a version BELOW the last release. Two carve-outs: the 13 npm packages still move atomically with each other (they cross-depend — that is intra-npm lockstep and it is unchanged), and a change to expected-registry.json / metamodelVersion forces all five, because that is the cross-port contract — whatever the release's level, so a vocabulary-adding PATCH publishes all five too (ADR-0035 Amendment 5). The rest of this doc is the per-registry procedure.

Step 0 (all registries): scan for unmerged work before you cut

Run this first, before the CHANGELOG is even written:

git fetch origin -q
for b in $(git branch -a --no-merged origin/main --format='%(refname)' | grep -v HEAD); do
  d=$(git log -1 --format=%ct "$b" 2>/dev/null); [ -z "$d" ] && continue
  age=$(( ( $(date +%s) - d ) / 86400 ))
  [ "$age" -le 14 ] && printf "%3sd  %s  %s\n" "$age" "$(git log -1 --format=%h "$b")" "${b#refs/}"
done | sort -n

The recency filter is load-bearing: a bare git branch -a --no-merged returns ~100 branches here (abandoned spikes, worktree-agent-* artifacts, old release branches). A wall that size gets skimmed, which defeats the check — so bound it to what could plausibly belong in this cut.

Decide explicitly for every branch the scan returns: merge it into this cut, or state why it waits. Note that no-mistakes/* branches are usually gate replays of work already on main — confirm rather than assume. Do not skip past the list.

The previous maintenance branch is on main (minor and major cuts). Before a minor or major is cut, every commit on the previous release/<major>.<minor> maintenance branch must be an ancestor of main. Otherwise a fix shipped as a patch from that branch is missing from the new line. Check it by hand while writing the CHANGELOG:

git fetch origin -q
git merge-base --is-ancestor origin/release/<M>.<m> origin/main && echo merged || git log --oneline origin/main..origin/release/<M>.<m>

scripts/release.mjs enforces it in its preflight: cutting X.Y.0 (or an RC of it) is refused while the highest release/<M>.<m> below X.Y on origin holds a commit HEAD does not. A patch is not gated. To clear it, merge the maintenance branch into main by PR (see "Then bring the branch to main" in the maintenance-branch section).

The eject pending list (1.1.0). 1.1.0 does not ship while fixtures/generator-registry-conformance/registry.json has an entry in eject.pending (ADR-0034 Amendment 8). The scripted paths enforce it: scripts/release.mjs (first check of its preflight), scripts/finish-release.mjs (gate 0, before the tag) and the four publish workflows (the step after checkout) refuse a version with no prerelease suffix while the list holds an entry. A release candidate (1.1.0-rc.3, or 1.1.0rc3 on PyPI) is allowed.

A publish you type by hand passes through none of those, so run the gate yourself as the command before it. This document has it before each of the three: the npm promote in step 3, the PyPI fallback uv publish, and the local mvn -Prelease deploy. It exits non-zero on a refusal:

node scripts/eject-release-gate.mjs <version>    # the version that registry is about to receive

To clear it for a final release: close the gaps and delete their entries. There is no other step. Each port's eject-contract test fails on a gap that is not listed, so an entry cannot be deleted before its gap is closed.

Why this is step 0 and not a nicety: 0.21.1 shipped without a timestampMode fix that was already written and sitting on an unmerged branch. Because versions are immutable on all five registries, the only correction was a full coordinated 0.21.2 within the hour — four publishes, an ~11-minute Maven deploy, and a second round of adopter notification, to ship work that already existed. The single shared patch number makes an omission cost four publishes, not one.

Releasing the TypeScript packages to npm

How to publish the @metaobjectsdev/* TypeScript packages. Read the Golden rules first — each one cost a broken/burned release to learn.

After any release, walk RELEASING-docs-checklist.md — it lists every doc + website (this repo, metaobjects.dev, metaobjects.com) whose version references must be refreshed. A version bump is not done until that list is walked.

What gets published

The publish-candidate packages, versioned in lockstep — there is no single-package release (see Isolated patch (one package) below). Enumerate the set each release — do not trust this count (it was 13 at 0.11.5); the lockstep set is "every non-private package at the previous version":

node scripts/publish-set.mjs --check    # the set + its tier order, and the invariants

scripts/publish-set.mjs is the single source of truth for the set and its order. Both publish paths read it — scripts/release.mjs and .github/workflows/publish-npm.yml — because they used to answer the question separately and drifted: the workflow's hardcoded list of 13 directories omitted @metaobjectsdev/docs-site, which @metaobjectsdev/cli depends on at runtime, so a release cut through the workflow would have published a cli pinning a docs-site version nobody published (npm i @metaobjectsdev/cli → ETARGET). It also asserts what the tier table below asserts in prose: every member has a declared tier, nothing publishes before its own dependencies, and the set is closed over its sibling deps. Runs in the gates lane; the table stays as the human-readable statement of intent.

Mind the gap in that rule. A non-private package on its OWN version line is at neither the previous lockstep version nor private, so it matches neither branch and gets silently skipped by every release. That is exactly what happened to @metaobjectsdev/angular + @metaobjectsdev/codegen-ts-angular (their own 0.6.x line): never published, while the README, CLAUDE.md, four port docs and a full recipe described them as installable. scripts/check-publish-intent.sh now fails the build on any non-private package that is neither at the lockstep version nor declared source-only, so the decision has to be made out loud. It runs in the gates lane; run it yourself before a cut.

For the Angular pair the decision has been made: they stay source-only on purpose (ADR-0048). A release cut must NOT sweep them into lockstep or publish them under any dist-tag; they join the tier table only when the ADR's promotion bar is met.

Tier Packages
0 metadata, render
1 codegen-ts, runtime-ts, migrate-ts, sdk, docs-site, runtime-web
2 codegen-ts-react, codegen-ts-tanstack, react
3 tanstack
4 cli (the leaf — nothing depends on it; publish last)

Publish in tier order so a dependent never lands before its dependency. conformance and ai-runtime are private: true and must never be published (bun refuses them). ai-runtime left the set in 1.3.0: the generated trace helper used to import it, and the trace-helper generator now writes that call loop into the project instead (ADR-0024 Amendment 2). Its last published version is 1.2.3, and it stays on the registry.

Golden rules (the non-obvious ones)

  1. Publish with bun publish, never npm publish. The packages depend on each other via workspace:*; only bun rewrites that to the concrete version in the published tarball. npm publish ships the literal string "workspace:*" and breaks every consumer.

  2. After ANY version bump, regenerate the lockfile: rm bun.lock && bun install. bun publish resolves workspace:* from bun.lock, not the live package.json. A plain bun install reports "no changes" and keeps the stale member versions — so packages publish with sibling deps pinned to the previous version (uninstallable). Then verify by inspecting a packed tarball, not just that it packs:

    cd server/typescript/packages/cli && bun pm pack --destination /tmp/p
    tar -xzOf /tmp/p/*.tgz package/package.json | grep '@metaobjectsdev'   # must show the version you're releasing
  3. Runtime imports must be dependencies, not devDependencies. The in-workspace test suite can't catch a misclassified dep (devDeps are installed there). Only a clean external install does.

  4. Always smoke-test a real external install before promoting to latest — in both npm and pnpm (pnpm's strict, non-nested node_modules exposes resolution bugs npm/bun hide). Install the cli into a throwaway dir, run meta --version, meta init, meta gen.

  5. npm versions are immutable, and a burned one never comes back. You can never re-publish a version. Unpublish is not a reliable escape hatch: it is refused (E405) once anything depends on the version, and deprecating it does not free the number. @metaobjectsdev/metadata@0.24.0-rc.1 is burned that way and no other package in the set carries it — so a lockstep RC at 0.24.0-rc.1 would publish thirteen packages and then fail irreversibly on the fourteenth. scripts/release.mjs now preflights the target version against every package in the set (it used to check only the cli), and bun run prerelease:publish skips burned numbers when choosing an iteration.

  6. Any commit that bumps a version must regenerate the site payload: bun run site:payload. examples/showcase/site-payload.json embeds all five coordinates — npm, PyPI, NuGet, Maven and metamodelVersion — so a bump changes it, and gate_site_payload in the gates lane compares the committed bytes against a fresh build on every scripts/ci-local.sh run (--quick included). A coordinated cut lands as two commits and both touch coordinates: scripts/release.mjs regenerates and stages the payload for the TypeScript one automatically, but the chore(release): … PyPI, NuGet and Maven Central commit is written by hand and must do it too. Forget it and the next scripts/ci-local.sh run goes red; once the site injection lands, the page would publish the previous release's versions.

  7. v<version> is cut LAST, and it is not just a marker — the website deploys from it. metaobjects.dev's Pages workflow resolves the newest vN.N.N release tag (version-agnostic), clones that tree, and injects its examples/showcase/site-payload.json into the pages. So the tag decides what the site states about the release, including all five version coordinates.

    A coordinated cut is two commits — npm's, then the hand-written PyPI/NuGet/Maven bump. release.mjs used to tag between them, which names a tree whose payload reads {npm: <new>, pypi: <old>, nuget: <old>, maven: <old>}: three versions that were never released. v0.24.5 carries exactly that, and nothing caught it because no page displayed a coordinate yet.

    So release.mjs pushes the branch it runs on (main, or a release/<major>.<minor> maintenance branch — see the maintenance-branch section below) and stops. After the ports are bumped, committed, pushed and tagged (python-v*, csharp-v*, java-v<npm major + 7>.* — java-v8.* at the 1.0 cut, NOT java-v7.*), run:

    bun scripts/finish-release.mjs <version>            # gates, then tags and pushes
    bun scripts/finish-release.mjs <version> --check    # gates only

    It refuses to tag a tree that does not state the release: a dirty or unpushed tree, a failed git fetch (which makes the sync claim unverifiable, so it is a refusal rather than a tick), a tag that already exists (never move one — a moved tag silently changes what the site deploys), payload coordinates that disagree with what shipped, a missing injector / payload / site-reference/, llms mirrors naming a version this release did not ship on any line that makes a registry claim, or a tag the deploy's own filter would not resolve.

    The tag does not trigger the site. After finish-release has pushed the tag, dispatch the website repository's Deploy to GitHub Pages workflow by hand (the previous releases did the same); until you do, the site keeps stating the previous release.

    A registry that genuinely sat out the release under publish-what-changed is declared (--sat-out pypi,nuget) rather than guessed — guessing "sat out" ships the stale number, and guessing "published" blocks a correct lagging registry. npm can never sit out: <version> is the npm version, so a mismatch there always means bun run site:payload was not re-run.

    --sat-out is corroborated, not believed. A registry that truly sat out has an UNMOVED manifest (pyproject.toml, Directory.Build.props, the reactor pom); a payload that was simply not rebuilt sits beside a manifest that DID move, and declaring that one --sat-out is refused with the manifest quoted back. This matters because an earlier version printed the flag as a ready-made remedy for any mismatch — which would have waived the exact defect the gate exists to catch.

    Every refusal above is pinned by scripts/finish-release.test.ts, which runs in the gates lane and exercises the real script against throwaway origin+clone pairs. Before it, this file ran in no lane and had no tests while deciding what the website publishes; a review found eight defects in 172 lines. If you change a gate, change its case there — and check the change against a mutation, not just a green run.

    A second effect. conformance.yml and integration-tests.yml are the heavy gates that run on a v* tag and nowhere else. (They were dormant while Actions was off, 2026-09-16 to 09-20, and step 3 above was what gated the cut instead; step 3 still earns its place, because it is the only gate that runs BEFORE the tag.) The ordering matters because those runs land on the FINAL coordinated tree — all five registries bumped, docs refreshed, payload true — instead of the npm-only commit, which is a tree that never actually shipped. publish-npm.yml triggers on npm-v*, not v*, so moving the tag does not re-trigger a publish.

Versioning policy

The version number's only mechanical meaning today is npm's caret rule. For 0.y.z, ^0.19.3 resolves >=0.19.3 <0.20.0, so: PATCH is auto-adopted by every consumer on a routine npm update; MINOR requires a deliberate bump of their range. That — not semver §8 — is the contract you are versioning against pre-1.0.

Litmus test. Whose surface moved? If the answer is "a generator, or what one emits", it is a PATCH and the test ends there. Otherwise: can a consumer on ^prev run npm update and still compile against the codegen ENGINE, the runtime libraries and the CLI they call? Yes → PATCH. No → MINOR. (Vocabulary always moves metamodelVersion, and moves this number by the feature test in "The vocabulary rule" below: vocabulary that augments an existing feature is a PATCH, a whole new feature is a MINOR.)

Generated output is never the axis (ADR-0035 Amendment 4). An adopter owns a COPY of each generator and gets our edit only by re-running meta gen and accepting the diff, so a generator change cannot reach a build that did not opt into it — the property a MINOR would signal is already provided by the mechanism. Every generator-tier change is a PATCH, however large the diff. The axis that remains is whose surface moved: the codegen ENGINE, a runtime library, the CLI's semantics, or the metamodel.

(This paragraph used to argue the opposite — that scaffold-and-own "does not firewall consumers from engine-output changes" because the render* primitives re-propagate. It conflated two surfaces: the primitives ARE engine API and still move the engine's number; what they render is generator output and does not.)

Change class Example Pre-1.0 Post-1.0
Anything in the generator tier — a new generator, a generator emitting different/added/removed output, a reference template rewritten ADR-0056's payload-tier rewrite; extStyle "none"→"js"; a new generator PATCH PATCH — always (ADR-0035 Amendment 4)
Codegen ENGINE public surface additive (new render* primitive, new GenContext field, optional param) new render* primitive PATCH (MINOR if it headlines a feature release) MINOR
Codegen ENGINE public surface breaking, or changed CLI semantics relativeModuleSpecifier +required param MINOR MAJOR
A runtime library's public surface (runtime-ts, render, OMDB, ObjectManager, web client) — additive / breaking a new mount option / a removed export PATCH / MINOR MINOR / MAJOR
Vocabulary that adds to or augments an EXISTING feature — any kind: type, subtype, attribute, enum value, expression node, view vocabulary — with nothing existing removed, narrowed or reinterpreted the rc.21 view vocabulary (origin.function, @union, @grain, cast), @dbCheck, measure.derived, @intValueMap PATCH (MINOR only by choice, when it headlines a release) PATCH, same choice (ADR-0035 Amendment 5)
Vocabulary for a whole NEW FEATURE (see the vocabulary rule below for the test) requirement.*, FR-044's object.report + dimension.* / measure.* / segment.* MINOR MINOR
Breaking metamodel-vocabulary change (retire an attr/subtype/type; narrow what is permitted) FR-037 @readOnly, FR-038 @verifiedBy, ADR-0052 @promptStyle re-homing MINOR (pre-1.0 MINOR is the breaking slot) metamodelVersion MAJOR, package MINOR (ADR-0035 Am. 2)
Wire-contract / conformance behavior change of already-valid deployments FR-036 enforcement MINOR, loud notice (pre-1.0 MINOR is the breaking slot) metamodelVersion MAJOR (Metamodel 2.0) + package MINOR — see the two-contracts rule below
Wire behavior fixed to match the documented/conformance contract 0.19.1 @min clamp PATCH PATCH
No changed product file in a port PyPI/NuGet/Maven at 0.24.4 while npm cuts 0.24.5 Do not publish that registry. It sits the release out and keeps its current version. When it next has a changed file it adopts the shared minor.patch then current, skipping the numbers between (publish-what-changed policy, standing since 0.24.5) same
A change to expected-registry.json / metamodelVersion any vocabulary move, at any release level — a vocabulary-adding PATCH included All five registries publish (npm, PyPI, NuGet, Maven Central, crates.io), changed file or not — the metamodel is the cross-port contract and every port byte-matches the manifest same

The two-contracts rule (post-1.0; ADR-0035 Amendment 2)

Package 1.0 does not freeze the metamodel. After the cut, the project versions two contracts on two numbers:

  • Package version (npm/PyPI/NuGet 1.x, Maven 8.x) promises the SOFTWARE surface — exports, CLI flags, generated-code shape, runtime helpers. A break here is 2.0.0 / 9.0.0.
  • metamodelVersion ("1.0" at the cut, "1.1" from 1.1.0; the current value is the first key of the byte-gated expected-registry.json) promises the METADATA contract — registered vocabulary, canonical/interchange format, wire contract. A break here moves ITS major, and does not force a package major.

That severance is the whole point: under the pre-amendment rule one vocabulary retirement dragged npm to 2.0.0 and Maven to 9.0.0, so the package majors became a running count of metamodel edits. Measured cadence at the time of the amendment: 19 minor lines in 87 days.

The gate: node scripts/check-metamodel-version.mjs (runs in the gates lane, so any scripts/ci-local.sh run that includes gates enforces it — --quick, --only gates, or the flagless full run). It diffs expected-registry.json — already the byte-exact bill of materials every port is gated against — against its content at the last release tag, classifies every difference, and fails if the declared version did not move by at least the amount the change requires. Same shape as buf breaking --against '.git#tag=…' / oasdiff.

Change Required move
a type/subtype removed; an attr removed; an attr made required, retyped or re-arrayed; an enum member removed or an open attr closed; a child rule removed, its min raised or its max lowered; a default subtype changed major (pre-1.0: minor — see below)
a type/subtype added; an optional attr added; an enum member added; a child rule added or relaxed; a default subtype added minor
prose only (description / rules / whenToUse) none — but read the warning

Pre-1.0 a breaking change moves the MINOR, for the same reason the package line works that way while it is 0.x: 0.y makes no compatibility claim there is anything to break. At 1.0 the major becomes real.

metamodelVersion gains a patch component (ADR-0035 Amendment 5, accepted, not yet implemented). It becomes <major>.<minor>.<patch>, always three components, moved by the same decision as the release: patch for vocabulary that augments an existing feature, minor for a whole new feature (or a correction under the compatibility policy's MINOR bar), major for a break. When it lands, the additive row above requires at least a patch, and choosing minor for a new feature is the maintainer's call made with --set — a manifest diff cannot tell a feature from an augmentation. Readers take a two-component value already written into a package or lock file as <major>.<minor>.0. One value names one vocabulary set: two release lines that ship the same metamodelVersion ship byte-identical expected-registry.json. Until it lands, the gate is as the table says: a vocabulary-adding PATCH moves the metamodel minor, as 1.1.4 did (1.1 to 1.2).

What the gate cannot see, and says so. A rule can change with NO machine-readable footprint. #210 is the proof: retiring assembly origins from object.value was a breaking metamodel change whose only manifest edit was a rules PROSE string. So prose changes are reported as a WARNING with a direct question — did the rule change, or only its wording? — rather than classified, because a typo fix and a semantics change are indistinguishable here and failing on every wording edit trains people to ignore the gate. Answering that question is a human step in every release.

When you cut a release that moves metamodelVersion:

  1. node scripts/check-metamodel-version.mjs --set <version> — it writes the manifest and all five port constants in one go (Kotlin emits through the JVM's). A partial edit is caught by registry-conformance, but only in the lane for the port you forgot, so do not hand-edit. Then re-run the corpus in every port.
  2. The changelog entry MUST say the metamodel version moved, and to what. Post-1.0 the caret rule is no longer a gate (^1.0.0 accepts 1.1.0), so the changelog is the adopter's only signal until the deferred loader check exists.
  3. Ship a migration guide under docs/features/migrations/, as every breaking metamodel change already does.

--explain prints the full classified diff and always exits 0; --against <ref> picks a different baseline.

Design + deferral triggers: docs/superpowers/specs/2026-08-20-two-contracts-versioning-design.md.

Cadence is a separate lever, and it is free. Nothing forces one release per merged change; batching a fortnight of work into one coordinated cut removes most of the number pressure without touching policy at all.

The vocabulary rule (the feature test; ADR-0035 Amendment 5, 2026-11-18)

The unit of the version decision is the FEATURE, not the kind of vocabulary. Adding or augmenting metadata for a feature that already exists is a normal PATCH; a whole new feature is a MINOR; a break stays a MAJOR.

  • Adds to or augments an EXISTING feature ⇒ PATCH, whatever the kind: a type, a subtype, an attribute, an enum value, an expression node, view vocabulary. It need not be inert. It must be additive: nothing existing is removed, narrowed or reinterpreted, and every document that loaded before still loads with the same meaning. A change to what an existing valid document means or produces by default is not an addition and keeps its own rules (a MINOR or a documented opt-in; a break is a metamodel MAJOR); generator output stays under Amendment 4.
  • A whole NEW FEATURE ⇒ MINOR.
  • Breaking ⇒ MAJOR: the metamodel's major for the metadata contract (shipped in a package MINOR, Amendment 2), the package's for the software surface.

The feature test. A feature is a modeling concept an adopter opts into as a whole, with its own page under docs/features/, its own vocabulary family and tooling of its own (a verify pass, a generator family, a CLI command). Ask: could this be documented as a new section of an existing feature's page, using the tooling that page already describes? Yes ⇒ augmentation ⇒ PATCH. No ⇒ new feature ⇒ MINOR.

Change Verdict
requirement.* (0.22.0): its own page, its own verify pass and ledger new feature ⇒ MINOR
FR-044 reporting (1.1.0): object.report, dimensions, measures, segments, a view lowering, served routes, the cube-model generator new feature ⇒ MINOR
the rc.21 view vocabulary (origin.function, @union / @unionAll, @grain / @grainOrdinal, cast) augments projections and views ⇒ PATCH
@dbCheck on a validator or field.enum augments the CHECK constraints meta migrate already writes ⇒ PATCH
measure.derived augments reporting ⇒ PATCH

Why the kind-based rule went. Amendment 1 (2026-08-17) sorted vocabulary by kind: an attribute a PATCH, a top-level type a MINOR, a subtype either by whether it was INERT. That corrected an older and worse reading ("any registry addition ⇒ MINOR", which spent 0.22.0's and 0.23.0's minors on changes no adopter could observe; expected-registry.json is an internal gate, and its churn is evidence about the ports, not about an adopter). But the kind did not track what an adopter experiences either, and it pushed additions to shipped features into a minor or a long-lived release line.

metamodelVersion moves by the same decision, and every move of it, at any release level, publishes all five registries. See "The two-contracts rule" above for its patch component and what the gate checks until that is implemented.

Do not invert the caret rule. "Pre-1.0 ^0.22.x resolves <0.23.0, so a consumer adopts a MINOR deliberately" is a reason to choose MINOR when you want that gate, for instance for an augmentation that headlines a release. It is not a reason additive vocabulary must be MINOR. The gate exists to be used on purpose, not by reflex — and a minor spent on a change nobody can observe is a gate you no longer have when something real needs it.

The extStyle 0.20.0 case, for calibration: it was correctly MINOR — but for the API break (relativeModuleSpecifier gained a required param — a public export) and the default flip (churns every existing project's diff on regen), NOT because "output changed." Had it kept "none" as the default and only scaffolded "js" for new projects, PATCH would have been defensible.

Changelog convention (required for output-changing releases). Every entry in classes (bugfix-output) and (shape/default-output) must carry the phrase "Generated-output change — regenerate to pick it up; three-way merge preserves hand edits." The real risk of the (correct) PATCH cadence is a consumer seeing an unexplained meta gen diff after npm update; the changelog flag + the planned gen-state engine-version stamp (see the tracking issue) are how you keep every such diff explained.

Entries arrive as fragments. A pull request does not edit CHANGELOG.md. It adds one file per change under changelog.d/, in the format given in changelog.d/README.md, so that parallel PRs never edit the same lines. The conventions above apply to a fragment as they do to a CHANGELOG entry. scripts/release.mjs places every fragment at the top of ## [Unreleased] and deletes the files before it promotes that section. To write a release section by hand ahead of the cut, run node scripts/changelog-fragments.mjs --assemble first, so the entries you are arranging are in CHANGELOG.md. The release then still ships one changelog.

Prerequisites

  • The JS/TS workspace root is the repo root (/package.json), globbing server/typescript/packages/* + client/web/packages/* (and the private examples/dynamic-grid, plus the private pack workspaces under packs/*/typescript (ADR-0069) — no core release publishes anything from either). This is what makes workspace:* resolve uniformly at publish time — don't move it.

  • npm auth as an owner of the metaobjectsdev org. The account has 2FA auth-and-writes, so for an unattended publish use a Granular/Automation token with the bypass-2FA option, scoped read+write to @metaobjectsdev, in ~/.npmrc (//registry.npmjs.org/:_authToken=...).

    The token TYPE is the whole game, and a wrong one looks right. A classic "Publish" token authenticates fine — npm whoami returns your username, npm access list packages shows read-write, and bun publish --dry-run passes — and then returns EOTP on every actual write. Worse, bun publish defaults to --auth-type=web, so it falls back to an interactive browser flow (https://www.npmjs.com/auth/cli/…) that cannot complete in CI or any non-interactive shell; --otp= is silently IGNORED (bun prompts Enter OTP: regardless, so a code must be piped on stdin). And if the account's 2FA is a security key rather than TOTP, there is no 6-digit code to supply at all. Use Classic → Automation (or a granular token with 2FA-bypass enabled).

    Do NOT try to prove the token type with a write against a published package. The obvious probe — npm dist-tag add … auth-probe then rm — is not reversible: since 2026-07-31 a bypass-2FA token may still publish but may not change package access, so the add succeeds and the rm returns 403 ("Granular access tokens that bypass two-factor authentication may not perform this action"). That strands a stray tag on a public package needing an interactive-2FA session to clear. It was tried on the 0.24.0 cut; don't repeat it.

    Verify what can be verified read-only, and let the publish itself be the rest:

    node scripts/release-verify.mjs --preflight       # auth + scope, no writes

    whoami and access list are both READS, so neither proves write capability — the preflight says so rather than implying otherwise. The tier-0 publish is the real probe: metadata publishes first, so a wrong token fails there, before anything depends on it. scripts/release.mjs also runs npm whoami in phase 0, so a dead credential is caught BEFORE the version bump is committed rather than after other registries have shipped irreversibly.

    Revoking the token after each release is a deliberate trade — it is also why the credential is reliably dead at the start of the next cut. Whichever you choose, do it knowingly.

    Deadline: npm removes direct publishing from 2FA-bypass tokens around January 2027 (changelog). The replacement is Trusted Publishing (OIDC) — the same mechanism publish-csharp.yml already uses for NuGet — via publish-npm.yml, which exists and needs a trusted-publisher registration per package on npmjs.com. This is a dated requirement. OIDC cannot drive npm dist-tag yet, so the RC-to-promote steps still need a token.

    The publishing path that replaces the token after the 2027 deadline is being decided and is not written down yet; until it is, the local-token procedure above is the npm publishing path we actually use. (It was additionally blocked while Actions was off, 2026-09-16 to 09-20 — Actions is back on, so publish-npm.yml can fire again.)

  • bun publish does not apply publishConfig field overrides (bin/main/exports) — only access/tag (oven-sh/bun#19205). So fields like bin must be correct at the top level, not swapped via publishConfig.

Procedure

Run everything from the repo root unless noted. Bump the publish-candidate set only (not the private root, not conformance/ai-runtime) — enumerate it (see "What gets published").

0. Build fresh — the stale-dist trap

bun publish does NOT rebuild, dist/ is gitignored, and main points at dist/, so a stale dist publishes code without your change. tsc also leaves orphaned .js for deleted sources. Clean-rebuild before publishing:

bun run clean && bun run build

Spot-check dist reflects the change (a deleted source's .js is gone, new code present).

1. Release candidate → next

Most changes do not need this. To try an unreleased change against a downstream project, publish a PRE-RELEASE to the private registry instead — docs/features/prerelease.md, bun run prerelease:publish. It is reversible, invisible to the public registries, and costs no version number.

A public RC is for the one case a private registry cannot cover: dependencies or package layout changed, so the thing being tested IS a real external install from the real registry — a misclassified dependencies/devDependencies entry, a peer range, a new package name, an exports map. Rule 4 below only means something against npmjs.org.

Remember what it costs: an RC version is permanent. Once anything depends on it, npm unpublish is refused outright and deprecating it does not free the number.

One public RC per batch, never one per fix. Verify each fix against a LOCAL build as it lands, and cut the public RC once, when the batch is done, for step 2c. For the JVM ports, install the reactor into an ISOLATED local repository and build the consumer against it at the reactor's own version:

mvn -f server/java/pom.xml -Dmaven.repo.local=<isolated-repo> -DskipTests \
    -pl maven-plugin,codegen-spring -am install
mvn -Dmaven.repo.local=<isolated-repo> -Dmetaobjects.version=<reactor version> package   # in the consumer

Never install into the shared ~/.m2. Between releases the reactor sits at the last RELEASED version, not a -SNAPSHOT, so the install silently replaces that release for every other build on the machine. The 1.0.5 cycle reached -rc.7 mostly by cutting a candidate to check one fix at a time; almost none of those checks needed a published artifact.

# bump the candidate set to <version>-rc.N (sed the "version" field in each publish-candidate package.json)
rm bun.lock && bun install                       # CRITICAL — re-pins workspace versions
# verify a packed tarball's deps show <version>-rc.N (rule 2)
# publish each package in tier order:
( cd <pkg-dir> && bun publish --tag=next )

Note: the first-ever publish of a brand-new package name sets latest even with --tag=next; move it after the smoke test (or accept it points at the RC until you promote).

2. Smoke-test the RC (rule 4)

cd $(mktemp -d) && npm init -y >/dev/null
npm i @metaobjectsdev/cli@next --prefer-online        # or pnpm in a pnpm project
npx meta --version && npx meta init && npx meta gen

Fix anything that surfaces, bump to -rc.(N+1), repeat. (rc.1 missed the lockfile regen; rc.2 missed a runtime dep; rc.3 was clean — expect iterations.)

2b. Cross-language persistence conformance (on-demand)

Before promoting to latest, run the cross-language persistence suite against real Postgres (spins up one ephemeral testcontainer per scenario, exercises each port's codegen + runtime end-to-end). It is not part of bun test / dotnet test because it requires a docker daemon:

scripts/integration-test.sh           # all runners (typescript + c# + java)
scripts/integration-test.sh ts        # just typescript
scripts/integration-test.sh csharp    # just c#
scripts/integration-test.sh java      # just java

The corpus lives at fixtures/persistence-conformance/. A red run here has caught real cross-port divergence (view-DDL identifier quoting, column-naming strategy mismatches) that the unit suites missed.

2c. Run an adopter estate against the RC (1.0 gate G3d)

Staged candidates. The checklist below is the final-cut gate. Each staged candidate (1.3.0-rc.N, published to the private registry with bun run prerelease:candidate) has its own run sheet and a script for its mechanical steps: tools/prerelease/estate-run.md and tools/prerelease/estate-run.sh. The commit each candidate was built from is recorded in tools/prerelease/candidates.md.

Every corpus in this repo can be green while a real application built on the release is broken — the defects live where features meet, in models no fixture composes. Before promoting, run at least one adopter estate against the candidate, end to end, and treat a red run as a blocker:

  1. Pin every @metaobjectsdev/* dependency to the RC, install clean, and read the resolved versions back — a declared range is not proof of the version that ran.
  2. meta gen, then meta verify --codegen. If the RC changes the estate's generated output, the estate regenerates and commits before the run counts.
  3. Compile the estate's owned codegen tier and every app that consumes generated code.
  4. On a fresh database: replay the estate's committed migrations, re-diff (must report no changes), and meta verify --db.
  5. The independent oracle, which re-derives FKs and columns from the metadata alone and reads them from pg_catalog — verify --db shares its expected schema with migrate, so it cannot see a constraint both of them omit:
    bun run --cwd server/typescript/packages/integration-tests oracle <estate-dir> <postgres-url>
  6. Boot the app on that database and exercise its API.

Every core change in the batch needs an estate scenario (ADR-0034 Amendment 3). A corpus fixture proves the ports agree; only a scenario in a real application proves the change is usable. A core change with no scenario in the estate holds the promote until one exists. A change to a reference generator does not need one: a generator is a helper, and its fixtures are its check.

3. Promote to latest

Before bun publish: run the FULL local CI on the release commit and confirm it is green. Its ts-slow section carries the real-Postgres migrate gate. Publishing is irreversible on all five registries, and the v* tag is pushed after bun publish, so even though Actions is on (since 2026-09-20), a tag-triggered integration-tests run could never be the pre-publish gate. This is the last gate that can precede the irreversible step, and it is the only one that runs before it, so the flagless script (all six ports, the reactor, the docker matrix) is what you run, not --quick. Run it on the commit you will tag, after every fix for this release has merged: the python-v, csharp-v and java-v tags must sit on that same commit, so cut the npm release commit from main only once the last fix is in, and tag all three ports on it (a Python tag on an earlier commit publishes without the later fixes).

scripts/ci-local.sh --strict-toolchains        # must end "LOCAL CI PASSED"
# bump the candidate set to the final <version>
rm bun.lock && bun install
# verify packed deps (rule 2); commit "chore(release): <version>"
node scripts/eject-release-gate.mjs <version>    # must exit 0; refuses while eject.pending has entries
( cd <pkg-dir> && bun publish )                  # default tag = latest, tier order
git push origin main                             # NO tag here — see golden rule 7

The v<version> tag is cut LAST, by scripts/finish-release.mjs — after PyPI, NuGet and Maven have been bumped, committed and published. See golden rule 7.

After the version propagation, check the site's prose. The site injects version numbers but not claims; walk the "Diff the CHANGELOG against the homepage's prose claims" item in RELEASING-docs-checklist.md §B.

4. Cleanup

# deprecate any broken/superseded RCs
npm deprecate '@metaobjectsdev/<pkg>@<bad-version>' "superseded; use <version>"

Retire the RC's next tag by REPOINTING it, not by deleting it. npm dist-tag rm returns 403 Forbidden - DELETE …/dist-tags/next for every credential this project has: the maintainer's local granular token AND the CI NPM_TOKEN that publishes the set, with --otp making no difference to either — so the registry is not asking for a second factor. It is npm's 2026-07-31 restriction: a bypass-2FA token may still publish but may not change package access, and deleting a dist-tag is package access. Measured across all 14 packages on 2026-09-10.

dist-tag add is not restricted, so point next at the version you just promoted. That removes the prerelease install path, which is the actual harm; the tag continuing to exist alongside an identical latest is cosmetic.

Either route works: the dist-tag add above run from your machine, per package, or the CI dispatch, which does the whole set at once from where the publish token already lives — Actions → npm dist-tag → Run workflow → tag next, action add, version <version> (.github/workflows/npm-dist-tag.yml; the set and its order come from scripts/publish-set.mjs, never a list maintained there). Action ls is the default, so a dispatch meant to report cannot write.

Then verify: npm dist-tag ls @metaobjectsdev/<pkg> — authoritative, where npm view is CDN-cached and lags right after publish.

Patch from a maintenance branch (release/<major>.<minor>)

When. main already holds work for the next minor (or major) that must not ship yet, and a fix has to go out on the line already released. Cut the patch from a maintenance branch named exactly release/<major>.<minor> (for example release/1.2), branched from that line's last release commit, with the fix merged into it by PR. If main has nothing unreleased beyond the patch, cut from main as usual instead.

What the scripts do differently. scripts/release.mjs and scripts/finish-release.mjs accept release/<major>.<minor> as well as main (the rule is scripts/lib/release-branch.mjs, shared by both):

  • The version must be on the branch's own line: release/1.2 cuts 1.2.x (and 1.2.x-rc.N) and refuses anything else, such as 1.3.0.
  • Every push goes to that branch (git push origin release/1.2), never main.
  • finish-release's sync check compares HEAD with origin/release/1.2, not origin/main.

Every other gate is unchanged. Bump the PyPI/NuGet/Maven manifests, run bun run site:payload, commit and push on the maintenance branch, and push the python-v* / csharp-v* / java-v* tags from it, exactly as on main.

The site follows the newest tag. The website deploys from the newest vN.N.N release tag (rule 7), wherever it was cut. A patch tag on a maintenance branch therefore becomes what metaobjects.dev shows, including its payload and coordinates, until the next release is tagged. The converse is enforced: finish-release refuses to tag a patch on a line older than a tag that already exists (v1.2.3 once v1.3.0 exists), because the deploy would never resolve it. So a maintenance patch is for a line that is still the newest release. The same holds on npm: release.mjs publishes to latest, and a patch cut after a newer minor shipped would move latest backwards — so release.mjs refuses, in its preflight and before anything is published, any version older than the newest release tag, and any release candidate of a version that has already shipped (npm sorts it below the full release; resolved the same way the site deploy resolves its tag). It offers no non-latest dist-tag path.

Then bring the branch to main. Re-land each fix on main by PR as soon as it ships. Before the next minor or major is cut, also merge the maintenance branch itself into main by PR, resolving its version bumps, site payload and CHANGELOG in main's favour, so that every commit on it is an ancestor of main. Step 0 checks this and release.mjs refuses the cut until it holds; a fix that exists only on the maintenance branch would otherwise be missing from the new line.

A squash forward-port does not satisfy that check. Re-landing a fix on main as a squashed PR copies the change but not the commit, so the maintenance commit stays "not an ancestor of main" and Step 0 keeps refusing. After the fixes are confirmed present on main (by their tests, not by the commit messages), record the branch as merged with an ancestry-only merge:

git checkout -b chore/record-release-1.2-merged origin/main
git merge -s ours --no-ff origin/release/1.2     # records ancestry; changes no file

Open that as a PR and merge it with a merge commit, never squash or rebase: either one discards the second parent, and the ancestry this exists to record is gone. Check afterwards that git rev-list --count origin/main..origin/release/1.2 prints 0. Use -s ours, not a plain merge: the maintenance branch carries release version bumps and a site payload that must never reach main.

Isolated patch (one package)

There is no single-package release on npm. The 13 @metaobjectsdev/* packages move atomically: the publish set is scripts/publish-set.mjs, and a fix to one of them (a cli bugfix, say) is a patch release of all 13, cut by the procedure above. What a patch can leave out is a registry: a registry with no changed product file sits the release out, under the convergent-publishing rule. A package that needs a release line of its own is an independent pack, never a core package published alone.

Independent packs (packs/)

An independent pack (ADR-0069) is not part of a core release, and a core release never waits for one. Nothing in this procedure touches packs/: scripts/publish-set.mjs, check-publish-intent.sh and check-no-prerelease-versions.sh do not enumerate it (scripts/check-pack-boundary.ts proves that in the gates lane), a pack's changelog is packs/<name>/CHANGELOG.md and not the root one, and a red pack canary is not a reason to hold a core cut. Pack work never needs the maintenance-branch procedure either, because core can be cut from main with pack work in flight.

A pack is released on its own, tagged pack-<name>-v<version>. Core's tag patterns, the site deploy and the metamodel gate's baseline all ignore that tag. A pack stays unpublished ("publish": false in pack.json, "private": true on its npm package) until an estate project runs it with the drift gate enforced. A pack's prerelease path — publishing it to the private registry for that adopter run — does not exist yet (docs/features/prerelease.md covers the core lockstep set only) and is built in a follow-up before the first adopter run. The pack release script, the pack version gate and the test against the lowest published core in its range are built before that first publish.

Releasing the C# packages to NuGet

How to publish the MetaObjects* C# packages to nuget.org. We use Trusted Publishing (OIDC from GitHub Actions) — no long-lived API key, no signing certificate. Read the Gotchas first.

What gets published

Five packages, version-locked at the C# port version (the <Version> in server/csharp/Directory.Build.props):

Package Contents
MetaObjects Loader + canonical serializer
MetaObjects.Render Mustache render + payload-VO + verify
MetaObjects.Codegen EF Core + ASP.NET codegen (writes EF and ASP.NET code as text; depends on neither)
MetaObjects.AspNetCore The helper runtime generated routes call (filter parser, EF Core filter dispatch, validation, wire forms); the APP references it, the tool does not
MetaObjects.Cli The dotnet meta .NET tool (gen / verify; agent-docs is a redirect stub to the Node meta CLI)

Shared package metadata lives in server/csharp/Directory.Build.props; per-package PackageId/Title/Description live in each .csproj. Test/integration projects set IsPackable=false and never publish. There are no inter-package version-rewrite concerns like npm's workspace:* — ProjectReferences become NuGet dependencies pinned to the same Version.

How we publish: Trusted Publishing (OIDC)

The workflow .github/workflows/publish-csharp.yml packs the four projects, exchanges a GitHub OIDC token for a short-lived (~1 hour) nuget.org key via NuGet/login@v1, then dotnet nuget pushes.

A NuGet publish fundamentally needs Actions for its OIDC exchange — there is no local stand-in. That is why Actions was re-enabled on 2026-09-20 after four days off: with it disabled, NuGet simply cannot be published. Trigger it manually (Actions → publish-csharp → Run workflow, with an optional version override) or by pushing a csharp-v* tag once it fires again.

One-time nuget.org setup

Create a Trusted Publishing policy (nuget.org → your username → Trusted Publishing → Create). For this repo (github.com/metaobjectsdev/metaobjects) enter exactly:

Field Value
Policy Name metaobjects-csharp-publish (any name)
Package Owner metaobjects (the org)
Repository Owner metaobjectsdev
Repository metaobjects
Workflow File publish-csharp.yml (filename only — not the .github/workflows/ path)
Environment (leave empty)

Then add a GitHub repo secret (Settings → Secrets and variables → Actions):

Secret Value
NUGET_USER Your nuget.org username (the profile name at nuget.org/profiles/<username>) — NOT your doug@dougmealing.com login email

Because this repo is public, the policy activates immediately. (The "pending for 7 days" status the nuget.org docs mention only applies to private repos, where NuGet waits for a first publish to lock the repo/owner IDs against resurrection attacks.)

Gotchas (the non-obvious ones)

  1. NuGet/login's user: is the nuget.org username (profile name), never the email. Email silently fails the token exchange. We pass it via the NUGET_USER secret.
  2. NuGet versions are immutable (like npm). You cannot re-push a version — only unlist or deprecate. So validate the packed .nupkg locally before triggering the workflow.
  3. Bump the version in Directory.Build.props (<Version>), not per-project. The workflow can also override per-run via the version dispatch input (-p:Version=).
  4. The temp key is single-use and ~1 h. The workflow requests it immediately before push — don't move the NuGet/login step earlier.
  5. The policy is bound to the org + repo + workflow filename. Renaming publish-csharp.yml, or the policy owner leaving/locking the metaobjects org, makes the policy inactive until fixed.
  6. Source Link + symbols are on (PublishRepositoryUrl, EmbedUntrackedSources, snupkg); CI sets ContinuousIntegrationBuild for deterministic builds. No action needed — just don't strip them.

Procedure

  1. Pick the publish commit on the branch the release is cut from (main, or the release/<major>.<minor> maintenance branch for a patch — the workflow publishes the COMMITTED <Version>, so the tag must name that branch's tree). Ensure the packaging config + publish-csharp.yml are on it. Set <Version> in Directory.Build.props.
  2. Validate locally (catches immutable-version mistakes before they're permanent):
    cd server/csharp
    # NOTE: pack ONE project per invocation. Passing all five to a single `dotnet pack`
    # fails on modern SDKs (verified on 8.0.129) with `MSBUILD : error MSB1008: Only one
    # project can be specified` — MSBuild treats the extra paths as switches.
    for p in MetaObjects/MetaObjects.csproj MetaObjects.Render/MetaObjects.Render.csproj \
             MetaObjects.Codegen/MetaObjects.Codegen.csproj MetaObjects.AspNetCore/MetaObjects.AspNetCore.csproj \
             MetaObjects.Cli/MetaObjects.Cli.csproj; do
      dotnet pack "$p" -c Release -o /tmp/mo-nupkg || echo "PACK FAILED: $p"
    done
    # inspect a nuspec — version, license, readme, deps:
    unzip -p /tmp/mo-nupkg/MetaObjects.Render.0.11.1.nupkg MetaObjects.Render.nuspec | grep -iE '<id>|<version>|<license|<readme>|<dependenc'
    # optional: install the tool from the local dir and smoke-test it
    dotnet tool install --global --add-source /tmp/mo-nupkg MetaObjects.Cli && dotnet meta --help
  3. Run persistence conformance if the runtime/codegen changed: scripts/integration-test.sh csharp.
  4. Publish: GitHub → Actions → publish-csharp → Run workflow (or push a csharp-v<version> tag). This is the one registry that CANNOT be published locally — see "How we publish" above.
  5. Verify on nuget.org: all five packages listed (MetaObjects.AspNetCore is a new package id from 1.3.0: check its first push landed) and owned by the metaobjects org (indexing/validation takes a few minutes).

Releasing the Python package to PyPI

How to publish the metaobjects Python package to PyPI: push a python-v<version> tag and the workflow publishes it with the PYPI_API_TOKEN repo secret. PyPI publishing here runs only through that workflow — there is no local stand-in. Note publish-python.yml takes no version override, so it publishes the COMMITTED version: in the RC dance, do not fire it for a pre-release you have not committed.

What gets published

One package, metaobjects (version in server/python/pyproject.toml), as an sdist + a universal py3-none-any wheel (pure Python).

How we publish: a tag-triggered workflow (API token)

The workflow .github/workflows/publish-python.yml builds with uv and publishes via pypa/gh-action-pypi-publish, authenticating with the PYPI_API_TOKEN repo secret (already set). Trigger it with a python-v* tag or manually (Actions → publish-python → Run workflow). It published 1.0.1 and 1.0.4 this way.

Trusted Publishing (OIDC) is NOT in use. #36 closed on the token route, not by registering a publisher: the action logs "an explicit password was also set, disabling Trusted Publishing" on every run. That warning is expected, not a failure.

Switching to OIDC later (optional)

Project metaobjects → Settings → Publishing → Add a new GitHub publisher, then drop password: from the workflow and add permissions: id-token: write:

Field Value
Owner metaobjectsdev
Repository metaobjects
Workflow publish-python.yml
Environment (leave empty)

(The initial 0.9.0 was published from a local uv publish.)

Gotchas (the non-obvious ones)

  1. PyPI versions are immutable (like npm/NuGet). You can't re-upload a version — only yank. Validate locally first (below).

  2. Bump the version in pyproject.toml ([project].version).

  3. The wheel is pure-Python/universal (py3-none-any) — one wheel serves every platform.

    (The wheel carries the shipped agent files as a committed copy of agent-context-shipped/ under src/metaobjects/agent_context/shipped/, so metaobjects agent-docs needs no Node. Refresh it with scripts/sync-python-agent-context.sh; the gates lane and a Python test fail when it is stale. There is no build hook and no force-include of ../../agent-context.)

Procedure

  1. Bump [project].version in server/python/pyproject.toml.
  2. Validate locally (versions are immutable):
    cd server/python
    rm -rf dist && uv build --out-dir dist        # must produce BOTH .tar.gz and .whl
    uvx twine check dist/*                         # metadata + README render
  3. Publish — push the tag: git tag -a python-v<version> -m "…" && git push origin python-v<version>. Do not ALSO publish by hand. The 1.0.3 cut ran a local uv publish and then pushed the tag, so the workflow went red with 400 File already exists on a release that had shipped — a red run that reads exactly like a failed publish. The local route is the fallback only when the workflow cannot run. Run node scripts/eject-release-gate.mjs <version> from the repository root first (it must exit 0; the workflow runs the same gate), then UV_PUBLISH_TOKEN=<a PyPI API token> uv publish dist/* from server/python, and then do not push a python-v* tag for that version.
  4. Verify: curl -s https://pypi.org/pypi/metaobjects/json | python3 -c "import sys,json;print(json.load(sys.stdin)['info']['version'])".

Releasing the Rust crates to crates.io

The four Rust crates (ADR-0065 Amendment 3) ship to crates.io on the shared <M>.<m>.<p> line, from one workspace version ([workspace.package] in server/rust/Cargo.toml):

Crate What it is
metaobjects the loader, registry and canonical serializer
metaobjects-render prompt render, the reply parser and the output-format fragment
metaobjects-codegen the run engine and the shipped generators
metaobjects-cli the cargo-meta binary (cargo meta)

scripts/release.mjs publishes them; there is no separate procedure. The rules it applies live in scripts/lib/rust-release.mjs and are tested by scripts/test-rust-release.mjs (the gates lane runs it):

  1. Whether they ship. Publish what changed: the crates publish when a file they ship (a crate's sources, data, build script or manifest, or the workspace manifest and lockfile, but not tests, examples, benches or baselines) changed since the newest rust-v* tag, and always when expected-registry.json moved. With no rust-v* tag they have never shipped, and the cut publishes them. --crates=publish or --crates=skip overrides the decision; the preflight prints the reason either way.
  2. Preflight, with npm's, before anything is bumped: a crates.io token (from cargo login or CARGO_REGISTRY_TOKEN), and the version free on every crate. crates.io versions are permanent: a yank hides a version from new resolutions and does not free its number.
  3. Bump: the workspace version and every sibling crate's version requirement move to the release's, then cargo update --workspace updates the lockfile. The commit carries them with npm's.
  4. Pack-verify: cargo publish --dry-run --workspace packages each crate and builds it against its siblings' tarballs, so a crate that builds only from a path in the checkout fails before the confirm.
  5. Publish, after npm: cargo publish -p <crate> in dependency order (metaobjects, metaobjects-render, metaobjects-codegen, metaobjects-cli). cargo waits for each crate to reach the index before it returns, so the next one resolves it.
  6. Tag rust-v<version> with the other ports' tags, before finish-release.mjs. The next cut compares against it.

The generated prompt crates name metaobjects-render by this release's major and minor (metaobjects_render::REQUIREMENT), so code generated by 1.3.x needs a 1.3 or later render crate and never resolves to an older one.

Nothing is published without the owner's go. That holds for crates.io as for every registry. A crate name is reserved only by publishing it, and the CLI's package name is metaobjects-cli because cargo-meta is held by an unrelated crate.

Releasing the Java/Kotlin modules to Maven Central

The 14 com.metaobjects:* modules (15 artifacts, counting the parent POM) ship to Maven Central via the Sonatype Central Portal, versioned on its own major line — npm major + 7, so 7.x while npm was 0.x and 8.x from the 1.0 cut (the reactor version in server/java/pom.xml) — in the parent + module poms. Signed with the maintainer's GPG key.

Procedure

  1. Bump the version in all poms — parent + reactor modules and the three reactor-EXCLUDED modules (server/java/integration-tests/pom.xml, server/java/integration-tests-kotlin/pom.xml, and — issue #390, excluded for a different reason (a newer Kotlin compiler than the reactor's, not docker) — server/java/codegen-kotlin-exposed1x-check/pom.xml). Use the tree-wide grep, NOT mvn versions:set: versions:set only walks the reactor and silently leaves the excluded modules behind, so their <parent><version> lags and the next tag fails release-gate (java|kotlin) with "Non-resolvable parent POM". Derive both ends — never type a major. The offset lives in scripts/maven-coordinate.mjs and nowhere else; typing 7. by hand at the 1.0 cut asks Central for a version BELOW the last release, which is how two scripts were already wrong:
    CUR=$(sed -n 's:.*<version>\([0-9][0-9.]*\)</version>.*:\1:p' server/java/pom.xml | head -1)
    NEXT=$(node -e 'import("./scripts/maven-coordinate.mjs").then(m=>console.log(m.mavenVersion(process.argv[1])))' <npm-version>)
    echo "$CUR -> $NEXT"        # eyeball it BEFORE the sed; both are immutable once deployed
    grep -rl "$CUR" --include=pom.xml server/java | xargs sed -i "s/${CUR//./\\.}/$NEXT/g"
    (Verify every <version> the grep matched is the project version, not a third-party dep that happens to share the number.) Then assert the excluded modules are in sync: scripts/check-pom-versions.sh (also enforced on every push by .githooks/pre-push and by scripts/ci-local.sh).
  2. Validate locally: cd server/java && mvn -q clean verify -DskipTests (or with tests / scripts/integration-test.sh java if runtime changed). Use verify, not install: installing writes this unreleased version into the shared ~/.m2 (RELEASING-java.md).
  3. Deploy — ONE of two routes, never both (a second deploy of a published version fails with Component … already exists): push a java-v<maven-version> tag, and publish-java.yml runs the deploy below in CI with the signing secrets (how 8.0.4 shipped; it takes no version override, so it deploys the COMMITTED version — do not fire it for an uncommitted pre-release); or run node scripts/eject-release-gate.mjs <maven-version> from the repository root (it must exit 0; the workflow runs the same gate) and then mvn -Prelease deploy from server/java. The central-publishing-maven-plugin (<publishingServerId>central</publishingServerId>, <autoPublish>true</autoPublish>) uploads the signed bundle and auto-releases — no manual staging → release promotion. Auth + the GPG passphrase come from ~/.m2/settings.xml (server ids central + gpg-credentials); the GPG secret key must be present (gpg --list-secret-keys). The release profile activates GPG signing
    • the javadoc/sources jars Central requires.
  4. Verify: the modules appear at https://central.sonatype.com/ / https://repo1.maven.org/maven2/com/metaobjects/ (indexing takes minutes).

Gotchas: Maven Central versions are immutable (like the others); groupId ownership is already verified for com.metaobjects; a missing GPG key or expired Central token fails the deploy with an auth error, not a clear message.

central-publishing-maven-plugin 0.6.0 crashes COSMETICALLY (UnrecognizedPropertyException: "warnings" while parsing Sonatype's response) — mvn exits non-zero, but the bundle DID publish (all modules go live on Central via autoPublish). Do not blindly re-run (versions are immutable) — first VERIFY:

for m in metadata om omdb-ktx render codegen-spring spring-boot-starter; do
  curl -s -o /dev/null -w "%{http_code} metaobjects-$m\n" \
    "https://repo1.maven.org/maven2/com/metaobjects/metaobjects-$m/<version>/metaobjects-$m-<version>.pom"; done

If all are 200, the release is out — the error was just the response parse. Bump the plugin to ≥0.7.0 to stop the crash on the next release.

A polling timeout can also report red after the deployment published. java-v8.0.11 failed with Polling for … timed out before the deployment completed, yet 8.0.11 is on Central (HTTP 200). Check Central with the loop above before any re-run: a re-run of a published version fails as a duplicate.

The runner's Maven version can change under the workflow. java-v8.1.0 was rejected with Bundle has content that does NOT have a .pom file: the ubuntu-latest (24.04) image (2026-10-12 and later) ships Maven 3.10.0, which writes maven-metadata-local.xml into the install target, and central-publishing-maven-plugin 0.11.0 left it in the staged bundle. Fixed in plugin 0.12.0 (8.1.0 published with it); if that signature returns, inspect the bundle for maven-metadata-local.xml and check the runner's mvn -v before suspecting the poms.

The minor.patch is CONVERGENT across languages, not lockstepped (standing policy since 0.25.0): npm, PyPI and NuGet share one major.minor.patch and Maven Central takes the same minor.patch on npm major + 7 — but a registry only takes a number when it actually publishes. A port with no changed product file sits the release out and keeps its current version; the next time it ships, it adopts whatever minor.patch is current and skips the gap.

This used to read "every release bumps all four registries, with version-parity bumps where a port has no changed file" — which contradicted the very next sentence. The cross-language behavior contract is the conformance corpus + fixtures/conformance/CAPABILITIES.json: each release states which capabilities/conformance level it satisfies, and that manifest — not a shared version — is the coordination point. If the shared version is not the coordination point, then publishing byte-identical content to three registries to keep that version aligned buys nothing, and the phrase "version-parity bump" appeared ten times in CHANGELOG.md paying for it. (Generated code runs without any MetaObjects runtime, so a language only publishes the libraries it actually ships: runtime helpers, and codegen where it exists.)

A lagging version is now information. PyPI at 0.24.4 while npm is at 0.24.7 says PyPI has had no product change since 0.24.4. Under version-parity that was unreadable, because every registry carried the same number whether or not anything in it had moved.

One thing this broke, fixed in the same release. The agent-context staleness nudge assumed the four registries shared a minor.patch. Under convergent publishing a port legitimately sits behind npm — while meta agent-docs, the canonical scaffolder for every port, stamps the npm version it ran from — so every port nudged a correct setup, and the remedy re-stamped the same newer version: #347's permanently-loud advisory, in all four ports at once. A context stamped by a strictly newer release is no longer treated as stale. Anything not orderable as a plain N.N.N still nudges — prereleases, build metadata, and the 0.0.0 unresolved-install sentinel — so the "any drift nudges" property is intact.

Content, not version, decides in TypeScript (1.1.0). meta init stamps a contentHash of the shipped agent-context tree (and the docs ref its links are pinned to) into the manifest, and the TypeScript check compares that hash: a context whose content differs from what this CLI ships nudges even at an equal version, and one whose content is identical is silent at any version. A manifest written before 1.1.0 has no hash and falls back to the version rule above. The C#, Python and JVM checks keep the version rule: each stamps its own release into the manifest it writes, and no port but TypeScript hashes the tree. A context stamped at that port's own version is the context that release documents, so the version rule is the right answer there.

Public-repo hygiene

This repo is public. Before committing release changes, ensure no local paths or private/consumer names leak (the .githooks/pre-commit guard enforces this — activate with git config core.hooksPath .githooks). See CLAUDE.md → Public repository hygiene.