Skip to content

Commit a1277b5

Browse files
committed
feat(metadata): C4 metamodelVersion marker — TS reference + shared manifest tag
Adds a rolled-up Metamodel spec-version string to the registry manifest as the first top-level key (`metamodelVersion: "0"` — pre-1.0/unstable; the 1.0 cut freezes it to "1.0"). A version TAG on the existing expected-registry.json manifest, exposed via METAMODEL_VERSION + emitted by buildRegistryManifest, gated byte-for-byte by registry-conformance (all ports must emit the same string). Not per-provider, not per-file. TS reference; C#/Java/Kotlin/Python fan-out follows against the shared fixture. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GF9xLEQZaPus5Y6opk398n
1 parent a00b4ad commit a1277b5

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

fixtures/registry-conformance/expected-registry.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"metamodelVersion": "0",
23
"types": [
34
{
45
"type": "attr",

server/typescript/packages/metadata/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export type { EffectiveConstraints } from "./constraint-merge.js";
146146
export { validateConstraints } from "./constraint-validate.js";
147147

148148
// Registry conformance manifest (SP-G) — the canonical logical-vocabulary serializer.
149-
export { buildRegistryManifest, emitRegistryManifest, classifyPerTypeAttr } from "./registry-manifest.js";
149+
export { buildRegistryManifest, emitRegistryManifest, classifyPerTypeAttr, METAMODEL_VERSION } from "./registry-manifest.js";
150150
export type { AttrClassification } from "./registry-manifest.js";
151151
export { ExclusionReason } from "./registry-manifest-exclusions.js";
152152

server/typescript/packages/metadata/src/registry-manifest.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,20 @@ interface ManifestType {
9797
parents?: string[];
9898
}
9999

100+
/**
101+
* The Metamodel spec version — the shared, rolled-up name for the frozen core
102+
* vocabulary (ADR-0035 §2 / docs/1.0-readiness.md C4). It is a version TAG on this
103+
* manifest (the byte-exact bill of materials), NOT a per-provider or per-file marker:
104+
* every port emits the same string, asserted by registry-conformance. Pre-1.0 the
105+
* vocabulary is in development, so this is `"0"` (semver major-0 = unstable); the 1.0
106+
* cut (readiness G1) freezes it to `"1.0"`.
107+
*/
108+
export const METAMODEL_VERSION = "0";
109+
100110
/** The full canonical manifest. All collections are sorted for byte-stability. */
101111
interface RegistryManifest {
112+
/** The Metamodel spec version (first key — a header). See {@link METAMODEL_VERSION}. */
113+
metamodelVersion: string;
102114
types: ManifestType[];
103115
commonAttrs: ManifestAttr[];
104116
defaultSubTypes: Record<string, string>;
@@ -317,7 +329,7 @@ export function buildRegistryManifest(registry: TypeRegistry): RegistryManifest
317329
}
318330
}
319331

320-
return { types, commonAttrs, defaultSubTypes };
332+
return { metamodelVersion: METAMODEL_VERSION, types, commonAttrs, defaultSubTypes };
321333
}
322334

323335
/**
@@ -326,7 +338,8 @@ export function buildRegistryManifest(registry: TypeRegistry): RegistryManifest
326338
* Serialization contract — every port MUST match this exactly:
327339
* - 2-space indentation (JSON.stringify(_, _, 2)).
328340
* - Object keys in a fixed order (JSON.stringify preserves insertion order):
329-
* the manifest is built with `types`, `commonAttrs`, `defaultSubTypes`.
341+
* the manifest is built with `metamodelVersion` (first — the spec-version
342+
* header), then `types`, `commonAttrs`, `defaultSubTypes`.
330343
* - Each attr: `name`, `valueType`, `isArray`, `required`, then optional
331344
* `allowedValues` (omitted unless the attr declares a non-empty closed set —
332345
* decision 5), then `description`, then optional `rules`, `example`,

0 commit comments

Comments
 (0)