diff --git a/.claude/skills/releasing/SKILL.md b/.claude/skills/releasing/SKILL.md index 24a742c746..ac13e8b153 100644 --- a/.claude/skills/releasing/SKILL.md +++ b/.claude/skills/releasing/SKILL.md @@ -103,11 +103,12 @@ package number is the codegen **ENGINE**'s surface, a runtime library's surface, CLI semantics; vocabulary moves `metamodelVersion` instead. Do NOT reason from "generated output changed" — ask whose surface moved. -**Registry vocabulary does not force a MINOR** — a new *attribute* is a PATCH, a new -top-level *type* is a MINOR, and a new *subtype* is a PATCH when inert. See -`docs/RELEASING.md` → "The vocabulary rule" before choosing the level; the old -"any registry addition ⇒ MINOR" reading spent two minors on changes no adopter -could observe. +**Vocabulary is decided by FEATURE, not by kind** (ADR-0035 **Amendment 5**): a type, +subtype, attribute, enum value or view vocabulary that adds to or augments an EXISTING +feature is a PATCH, inert or not, as long as nothing existing is removed, narrowed or +reinterpreted; a whole new feature (its own docs page and tooling, as `requirement.*` was) +is a MINOR. See `docs/RELEASING.md` → "The vocabulary rule" for the feature test before +choosing the level. Any `metamodelVersion` move still publishes all four registries. ## Phase 2 — Build fresh (the stale-`dist` trap) diff --git a/AGENTS.md b/AGENTS.md index 3b60cc2827..f178c0a15f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -56,10 +56,11 @@ bar. **A lagging version number is INFORMATION, not drift.** Since `0.24.5` a registry publishes only when it has a changed product file, and when it does it adopts the shared `minor.patch` -then current, skipping the numbers it sat out (ADR-0035 Amendment 1, operative table in -`docs/RELEASING.md`). Two carve-outs: the 14 npm packages move atomically with each other, and -a change to `expected-registry.json` / `metamodelVersion` still forces all four, because that -is the contract every port byte-matches. So PyPI at `0.25.0` while npm is at `0.25.2` says +then current, skipping the numbers it sat out (operative table in `docs/RELEASING.md`; +the level vocabulary takes is ADR-0035 Amendment 5's feature test). Two carve-outs: the 14 +npm packages move atomically with each other, and a change to `expected-registry.json` / +`metamodelVersion` still forces all four, at any release level, because that is the contract +every port byte-matches. So PyPI at `0.25.0` while npm is at `0.25.2` says PyPI has had no product change since `0.25.0` — nothing is broken. **All five ports ship loader + canonical serializer + conformance + codegen + render + payload-VO + `verify`:** diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b79327ee4..0ce0d232df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,17 @@ here.** `scripts/ci-local.sh --only rust`, `pr-ci` and `local-ci`, selected by changes under `server/rust/`. +### Changed + +- **Release policy: vocabulary is versioned by feature, not by kind (ADR-0035 Amendment 5).** Adding + to or augmenting an existing feature (a type, subtype, attribute, enum value or view vocabulary, + additive and loading every existing document with the same meaning) is a PATCH; a whole new + feature is a MINOR; a break stays a MAJOR. `metamodelVersion` will gain a patch component moved by + the same decision (accepted, not yet implemented: it stays `.` until every port + reads three components), and any move of it still publishes all four registries. Policy text only: + no version, vocabulary or `metamodelVersion` changes here. See `docs/RELEASING.md`, "The + vocabulary rule". + ## [1.3.0] — 2026-11-17 _npm `1.3.0` (full lockstep across all 14 `@metaobjectsdev/*` publish candidates)._ diff --git a/docs/1.0-readiness.md b/docs/1.0-readiness.md index 1b86418736..c5b15a7ad6 100644 --- a/docs/1.0-readiness.md +++ b/docs/1.0-readiness.md @@ -115,9 +115,11 @@ Status legend: ✅ done · 🔶 in progress · ⬜ not started · ❓ **[RATIFY] Written up as the decision table in [`docs/RELEASING.md`](RELEASING.md) and applied every cut since `0.23.2`; Amendment 1 splits "a newly-supported vocab member" three ways (attribute ⇒ PATCH, top-level type ⇒ MINOR, subtype ⇒ PATCH when inert), and Amendment 2 - separates the package and metamodel axes. Trigger + separates the package and metamodel axes. *(Amendment 5, 2026-11-18, replaces the three-way + split with a feature test: augmenting an existing feature is a PATCH, a whole new feature a + MINOR.)* Trigger is *new public surface, not code size*: package **MINOR** only for newly-dependable - surface (codegen-engine surface, CLI flag, a new top-level type); package **PATCH** + surface (codegen-engine surface, CLI flag, a whole new metadata feature); package **PATCH** for bugfix/refactor; the **Metamodel spec version** bumps only on a shared vocabulary/wire change. The fast `7.3→7.7` minor run was breaking *velocity*; decouple + this rule ends the churn. diff --git a/docs/RELEASING.md b/docs/RELEASING.md index 7f824c5798..f20cd30521 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -26,7 +26,8 @@ > Two carve-outs: the **14 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 four**, because that is the -> cross-port contract. The rest of this doc is the per-registry procedure. +> cross-port contract — whatever the release's level, so a vocabulary-adding PATCH publishes +> all four 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 @@ -262,8 +263,9 @@ 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 is a third axis entirely and moves -`metamodelVersion`, not this number.) +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 @@ -283,14 +285,13 @@ what they render is generator output and does not.) | 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 | -| New **attribute** on an existing type/subtype | `@intValueMap`, `@lenient`, `@maxTokens` | **PATCH** | **PATCH** | -| New **subtype** of an existing type | `field.uri`, `index.lookup`, `attr.intMap` | **PATCH** when inert (see the vocabulary rule below); **MINOR** when it changes existing metadata's meaning/output, narrows something previously permitted, or headlines a feature | MINOR | -| New top-level metadata **type** | `requirement.*`, `index.*`, `api.*` | **MINOR** | MINOR | +| 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 | **All four registries publish**, changed file or not — the metamodel is the cross-port contract and every port byte-matches the manifest | same | +| A change to `expected-registry.json` / `metamodelVersion` | any vocabulary move, at any release level — a vocabulary-adding PATCH included | **All four registries publish**, 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) @@ -328,6 +329,18 @@ requires. Same shape as `buf breaking --against '.git#tag=…'` / `oasdiff`. 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 `..`, 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 `..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 @@ -358,40 +371,53 @@ Design + deferral triggers: change; batching a fortnight of work into one coordinated cut removes most of the number pressure without touching policy at all. -### The vocabulary rule (corrected 2026-08-17) - -**Adding registry vocabulary does NOT, by itself, force a MINOR.** The rule used to read -"PATCH (MINOR if it adds registry vocabulary — cross-port conformance surface)", and that was -wrong on its own terms: `expected-registry.json` is an **internal** gate. Every port -byte-matching one manifest is how we stop the five ports drifting from each other — it says -nothing about whether an *adopter's* project changes. Treating an internal gate's churn as an -adopter-facing event is what burned the minors: `0.22.0` and `0.23.0` were both cut MINOR for -changes that a project declaring no `requirement.*` nodes could not observe at all, which each -changelog says out loud in its own opening paragraph. Sort vocabulary by what it can do to a -consumer, which splits three ways: - -- **A new ATTRIBUTE is a PATCH.** You get it only by authoring it. Every existing document - loads unchanged and emits byte-identical output, so there is nothing for a consumer to adopt - deliberately. -- **A new TOP-LEVEL TYPE is a MINOR.** A type is a new modeling concept with its own children, - validation and (usually) tooling surface — `requirement.*` brought its own `verify` pass and - summary output. That is a thing a consumer newly depends on, and it deserves a deliberate - range bump. -- **A new SUBTYPE goes either way, and the test is whether it is INERT.** PATCH when nothing - but authoring it can reach it: no existing valid document changes meaning or output, nothing - previously permitted is narrowed, nothing reserved is consumed. MINOR when any of those - fails — a subtype that closes a wildcard, promotes a reserved-not-registered member - (ADR-0007 Amendment 2 / ADR-0040), or shifts what the recommended shape for an existing - field *is* — or when you deliberately want it behind a range bump because it headlines a - release. Most subtypes carry a native type and behavior (that is ADR-0037's very test for - making something a subtype), so read them carefully; but "it appears in the registry - manifest" is not the deciding fact. +### 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 four 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. 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. +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** diff --git a/docs/compatibility-policy.md b/docs/compatibility-policy.md index 6efcd3d598..47fe1ba379 100644 --- a/docs/compatibility-policy.md +++ b/docs/compatibility-policy.md @@ -100,16 +100,27 @@ The library's own REQUIREMENTS carry the same reading rule as its model: `live` ## MINOR vs. PATCH (what a version bump means) -The trigger is **new public surface, not code size**: - -- **MINOR** — adds surface a consumer can newly depend on: a new generated artifact, - a new CLI flag, or a newly-supported metamodel member. Additive; never breaking **on - the software surface**. A release that breaks the *metadata* contract also moves - `metamodelVersion` — the package coordinate is not where that fact lives. -- **PATCH** — a bug fix or internal refactor with no new surface. +The trigger is **new public surface, not code size**, and for metadata the unit is the +**feature**, not the kind of vocabulary +([ADR-0035 Amendment 5](../spec/decisions/ADR-0035-one-zero-stability-commitment-and-version-unification.md)): + +- **MINOR** — adds surface a consumer can newly depend on: a new CLI flag, a new codegen-engine + or runtime-library API, or a **whole new metadata feature** (a modeling concept with its own + documentation page and tooling, as `requirement.*` and reporting were). Additive; never + breaking **on the software surface**. A release that breaks the *metadata* contract also + moves `metamodelVersion` — the package coordinate is not where that fact lives. +- **PATCH** — a bug fix, an internal refactor, a generator change, or **vocabulary that adds to + or augments an existing feature**: a new type, subtype, attribute, enum value or view + vocabulary within a feature that already exists. It must be additive — nothing existing is + removed, narrowed or reinterpreted, and every document that loaded before still loads with + the same meaning. You get the new vocabulary only by writing it. A change to what an existing + document means or produces by default is not covered by this and keeps its own rules. - **Metamodel spec-version bump** — only when the shared vocabulary or wire/canonical - contract itself changes. Most releases are per-port package moves that do *not* - touch the spec version. + contract itself changes, by the same three levels: a patch for an augmentation, a minor for + a new feature, a major for a break. (`metamodelVersion` is `.` today; the + `..` form is accepted and not yet implemented, and until it is an + augmentation moves the minor.) Any move of it means every port ships together. Most releases + are per-port package moves that do *not* touch the spec version. ## Correcting input we wrongly accepted (the one narrow exception) diff --git a/scripts/check-metamodel-version.mjs b/scripts/check-metamodel-version.mjs index ba0a7c8c39..211602f688 100755 --- a/scripts/check-metamodel-version.mjs +++ b/scripts/check-metamodel-version.mjs @@ -88,8 +88,10 @@ const SITES = [ // --------------------------------------------------------------------------- // Version arithmetic. `metamodelVersion` is `major.minor` ("0.9", "1.0") — the -// `Metamodel N.M` form ADR-0035 §2 names. No patch component: a metamodel has no -// bug-fix axis, only "what is declarable" and "what it means". +// `Metamodel N.M` form ADR-0035 §2 names. ADR-0035 Amendment 5 (accepted, not yet +// implemented) adds a patch component for vocabulary that augments an existing feature; +// that change moves every port's reader and this parser together. Until then an additive +// difference requires the minor. // --------------------------------------------------------------------------- export function parseVersion(raw, where) { diff --git a/spec/decisions/ADR-0035-one-zero-stability-commitment-and-version-unification.md b/spec/decisions/ADR-0035-one-zero-stability-commitment-and-version-unification.md index 0c86817532..080853fc85 100644 --- a/spec/decisions/ADR-0035-one-zero-stability-commitment-and-version-unification.md +++ b/spec/decisions/ADR-0035-one-zero-stability-commitment-and-version-unification.md @@ -2,7 +2,8 @@ ## Status -**Accepted** (2026-06-29; all **[RATIFY]** items resolved 2026-07-02). +**Accepted** (2026-06-29; all **[RATIFY]** items resolved 2026-07-02). Amended 1–5; the +release-level rule in force is **Amendment 5** (2026-11-18), which supersedes Amendment 1. Companion checklist: [`docs/1.0-readiness.md`](../../docs/1.0-readiness.md). This ADR frames the decisions a 1.0 release commits to. All bracketed **[RATIFY]** @@ -175,7 +176,7 @@ still want, then freeze. Before cutting 1.0: **package MINOR** adds surface a consumer can newly depend on (codegen output, a CLI flag, a newly-supported vocab member — **but see Amendment 1: "vocab member" is too coarse, and taking it literally re-created exactly the minor churn this bullet was - written to stop**); a **package PATCH** is a bugfix/refactor with + written to stop; Amendment 5 replaces both with a feature test**); a **package PATCH** is a bugfix/refactor with no new surface (e.g. the `0.15.2` output-prompt fix — one-port, no surface); the **Metamodel spec version** bumps only when the shared vocabulary/wire contract itself changes. A run of minors for non-additive changes is the "minor churn" @@ -187,6 +188,9 @@ still want, then freeze. Before cutting 1.0: ## Amendment 1 (2026-08-17) — "a newly-supported vocab member" splits three ways +> **Superseded by Amendment 5 (2026-11-18)** for choosing a release's level: the unit is now +> the feature, not the kind of vocabulary. Kept as the record of the reasoning at the time. + The cadence-discipline bullet above lists "a newly-supported vocab member" among the triggers for a package MINOR. Applied literally it became a rule that **any** registry addition is a MINOR — and that rule produced the churn this ADR exists to prevent: @@ -347,7 +351,7 @@ choose to take: | the codegen **ENGINE**'s public surface: the `Generator` interface, `GenContext`/`EmittedFile`, the `render*` primitives, target/config resolution, the three-way-merge and gen-state contract | MINOR (breaking: MAJOR) | | CLI command or flag **semantics**; the scaffold-and-own contract itself | MINOR (breaking: MAJOR) | | a runtime library's public surface (`runtime-ts`, `render`, OMDB, ObjectManager, the web client) | MINOR (breaking: MAJOR) | -| registered metamodel vocabulary, the canonical/interchange format, the wire contract | **`metamodelVersion`** (Amendment 2) — package number unaffected | +| registered metamodel vocabulary, the canonical/interchange format, the wire contract | **`metamodelVersion`** (Amendment 2) — package number unaffected *(narrowed by Amendment 5: vocabulary for a whole new feature takes a package MINOR; an augmentation or a correction keeps PATCH)* | **This supersedes three rows of `docs/RELEASING.md`'s change-class table** — "Public API additive" read as covering a generator factory, "Output change alters shape/default of @@ -362,6 +366,125 @@ running. vocabulary, and `check-metamodel-version.mjs` still gates it. Convergent publishing is untouched: a port with no changed product file still sits the release out. +## Amendment 5 (2026-11-18) — the unit of the version decision is the FEATURE, and `metamodelVersion` gains a patch + +**Status: Accepted.** **Supersedes Amendment 1's three-way split** (attribute ⇒ PATCH, top-level +type ⇒ MINOR, subtype ⇒ either by the inert test) as the rule for choosing a release's level. +Amendment 2's two contracts, Amendment 3's correction bar and Amendment 4's generator tier stand +unchanged. + +**Why.** Amendment 1 sorted vocabulary by its KIND. In practice the kind did not track what an +adopter experiences, and the rule pushed additions that belong to an existing feature into a +MINOR or into a long-lived release line. The rc.21 view vocabulary (`origin.function`, +`@union` / `@unionAll`, `@grain` / `@grainOrdinal`, the `cast` node) is the worked case: it +extends projections and views that already had their page, their tooling and their adopters, +yet a new subtype and a new expression node had to argue their way past the inert test. Owner ruling, 2026-11-18, in these words: *"Change the rules so we can +add or augment metadata in a patch release for an existing feature. This should be normal. A +whole new feature can be a minor increase."* And, on the metamodel number: *"Meta model version +probably needs a patch now too, yes."* + +### The rule + +- **(a) Adding to or augmenting an EXISTING feature is a PATCH**, whatever the kind: a type, a + subtype, an attribute, an enum value, an expression node or other view vocabulary. It does not + have to be inert. It does have to 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 is not covered here. It keeps the rules that already govern it (a MINOR or a documented + opt-in; a break is a metamodel MAJOR under Amendment 2), and generator output stays under + Amendment 4. A reserved-not-registered member promoted into a feature that already reserves it + (ADR-0007 Amendment 2 / ADR-0040) is an addition: no document that loaded before used it. +- **(b) A whole NEW FEATURE is a MINOR.** +- **(c) A breaking change stays a MAJOR**: a break in the metadata contract moves the + metamodel's major and ships in a package MINOR (Amendment 2, unchanged); a break in the software + surface is a package MAJOR. + +(a) and (b) set the **release's** level, which is the package number. `metamodelVersion` moves by +the same decision (below). This narrows Amendment 4's last table row, which read "package number +unaffected" for any vocabulary: that is true of an augmentation and of a correction, not of a +whole new feature, which has always taken a package MINOR (the `0.22.0` and `1.1.0` cuts). + +**What a feature is.** A feature is a modeling concept an adopter opts into as a whole: it has +its own page under `docs/features/`, its own vocabulary family, and tooling of its own that a +project newly depends on (a `verify` pass, a generator family, a CLI command). The test is one +question: **could this be documented as a new section of an existing feature's page, using the +tooling that page already describes?** Yes ⇒ it augments that feature ⇒ PATCH. No, it needs a +page and tooling of its own ⇒ a new feature ⇒ MINOR. Worked examples from this repository: + +| Change | Verdict | Why | +|---|---|---| +| `requirement.functional` / `requirement.architectural` (`0.22.0`) | **new feature ⇒ MINOR** | a new modeling concept with its own page (`docs/features/requirements.md`), its own `verify` pass and ledger output; nothing before it modeled requirements | +| `object.report` with `dimension.*`, `measure.*`, `segment.*` (FR-044, `1.1.0`) | **new feature ⇒ MINOR** | its own page (`docs/features/reporting.md`), a SQL view lowered by `meta migrate`, served routes in every port and the `cube-model` generator | +| the rc.21 view vocabulary: `origin.function`, `@union` / `@unionAll`, `@grain` / `@grainOrdinal`, `cast` | **augments projections and views ⇒ PATCH** | documented as sections of the existing projection material in `docs/features/relationships.md`, served by the view lowering and routes that already existed | +| `@dbCheck` on a validator or `field.enum` | **augments validation and schema ⇒ PATCH** | a switch on the CHECK constraints `meta migrate` already wrote, documented in `docs/features/migrations-and-drift.md` | +| `measure.derived` and its `@expr` (shipped in `1.3.0`) | **augments reporting ⇒ PATCH** on its own | a new measure kind beside `measure.aggregate` / `measure.ratio`, documented in `docs/features/reporting.md` | + +**The caret rule is still not to be inverted.** A maintainer may choose a MINOR on purpose for +an augmentation that headlines a release; that is a choice, never a requirement. A minor spent +by reflex is a gate you no longer have when something real needs it. + +### `metamodelVersion` gains a PATCH component + +`metamodelVersion` is today `.` (`"1.3"`): Amendment 2 gave it no patch, on the +reasoning that "a metamodel has no bug-fix axis". Under this amendment it carries the same +three-level decision the package does, so it becomes **`..`**: + +| Move | When | +|---|---| +| **major** | a breaking metadata change (unchanged from Amendment 2; pre-1.0 it moved the minor) | +| **minor** | a new feature's vocabulary, or a correction under the "What a metamodel MINOR may refuse" bar of `docs/compatibility-policy.md` | +| **patch** | vocabulary that augments an existing feature | +| none | no change to `expected-registry.json` beyond prose (prose still raises the gate's question) | + +- **The string is always three components** (`"1.3.0"`, never `"1.3"` once realized), so one + vocabulary set has exactly one spelling and the byte-match stays exact. A reader that meets a + two-component value written before the change (a published `metaobjects.pkg.json`, a lock entry) + reads `"1.3"` as `1.3.0`, forever. +- **Compare as a tuple**: `(major, minor, patch)`, never component by component. Compatibility + stays major-scoped, as FR-023's dependency check is today: a different major is incompatible; a + dependency published against a newer `(minor, patch)` than the toolchain's is refused, because + it may use vocabulary the toolchain does not register. +- **The gate cannot tell a feature from an augmentation**, so it does not try. + `check-metamodel-version.mjs` requires at least a **patch** move for an additive difference and + at least a major for a breaking one. Choosing minor instead of patch for a new feature is the + maintainer's call, made with `--set`, exactly as headlining a release is. +- **One value names one vocabulary set.** Two release lines that ship the same + `metamodelVersion` must ship byte-identical `expected-registry.json`. A maintenance line that + adds vocabulary takes a value no other line has shipped. + +**The registries.** The carve-out "a change to `expected-registry.json` / `metamodelVersion` +forces all four registries" stands, for every component: a release that moves the major, the +minor **or the patch** publishes npm, PyPI, NuGet and Maven Central together, changed file or +not. The manifest is the cross-port contract and every port byte-matches it; a model that uses +the new vocabulary needs every port at that release. In practice no registry is exempt anyway: +`--set` writes the version constant into every port, so each port has a changed product file. +A vocabulary-adding release is therefore a coordinated cut at whatever package level the rule +above gives it, PATCH included. + +### Realization status + +The rule in "The rule" is **in force now**. The three-component `metamodelVersion` is +**Accepted, not yet implemented**: the value flows into published shared-model packages +(`metaobjects.pkg.json`), lock entries and FR-023's dependency check in all five ports, and every +reader validates it against `^\d+\.\d+$`. Changing it touches each port's manifest constant, its +dependency reader and comparison, the shared-model writer, `check-metamodel-version.mjs` and its +tests, `expected-registry.json`, and the `dependency-conformance` and `shared-model-conformance` +corpora. That lands as its own change, all ports together, with readers accepting both forms in +the same release that first writes three. **Until it lands**, the gate and the ports keep +`.`, and a vocabulary-adding PATCH moves the metamodel MINOR, as `1.1.4` did +(`1.1` to `1.2`). + +### Alternatives considered + +- **Keep the kind-based split (Amendment 1).** Rejected by the owner: the kind does not track + what an adopter sees, and it made augmentations of shipped features wait for a minor. +- **Keep `metamodelVersion` at two components and move its minor for every addition.** It needs + no implementation and was the interim practice. Rejected because the package and metamodel + numbers would then disagree on the same decision (a PATCH release moving a metamodel MINOR), and + the metamodel number would no longer say whether a new feature arrived. +- **A feature-level two-component `metamodelVersion` that ignores augmentations.** Rejected: a + model that uses an augmentation would need a newer port with no number saying so. + ## Consequences - After 1.0, a breaking change to the CLI surface or the scaffold-and-own contract @@ -370,6 +493,10 @@ untouched: a port with no changed product file still sits the release out. major instead (**Amendment 2**). The small stable surface (a consequence of scaffold-and-own) makes that a realistic commitment, not a straitjacket. +- Vocabulary that augments an existing feature ships in a PATCH; a whole new feature is a + MINOR (**Amendment 5**). `metamodelVersion` carries the same three levels once Amendment 5's + `..` form is realized, and any move of it still publishes all four + registries. - The deprecation removal and the version-line re-baselining (npm/PyPI/NuGet `→1.0.0`, Java/Kotlin `→8.0.0`) are **one-time 1.0 moves** — do them at the boundary, not after. - A new durable artifact is introduced: the **`Metamodel N.M` spec version** and its