Skip to content

Commit 00c099a

Browse files
committed
feat(python): C4 metamodelVersion marker in the registry manifest
Add METAMODEL_VERSION = "0" constant and emit metamodelVersion as the first top-level key in build_registry_manifest(), mirroring the TS reference. Registry-conformance byte-match now green (3/3). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GF9xLEQZaPus5Y6opk398n
1 parent 36ded53 commit 00c099a

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

server/python/src/metaobjects/registry_manifest.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,15 @@ def _sorted_children(definition: TypeDefinition) -> list[dict[str, object]]:
255255
return children
256256

257257

258+
METAMODEL_VERSION = "0"
259+
"""Rolled-up spec-version for the cross-port registry manifest.
260+
261+
``"0"`` = pre-1.0 / unstable (semver major-0). Flips to ``"1.0"`` at the
262+
1.0 vocabulary cut. Emitted as the first top-level key in the canonical
263+
manifest so every port's byte-comparison gate sees it at position 0.
264+
"""
265+
266+
258267
def build_registry_manifest(registry: TypeRegistry) -> dict[str, object]:
259268
"""Build the canonical registry-manifest object from an assembled registry.
260269
@@ -306,8 +315,9 @@ def build_registry_manifest(registry: TypeRegistry) -> dict[str, object]:
306315
if default_sub is not None:
307316
default_sub_types[type_name] = default_sub
308317

309-
# Fixed top-level key order: types, commonAttrs, defaultSubTypes.
318+
# Fixed top-level key order: metamodelVersion (C4), types, commonAttrs, defaultSubTypes.
310319
return {
320+
"metamodelVersion": METAMODEL_VERSION,
311321
"types": types,
312322
"commonAttrs": common_attrs,
313323
"defaultSubTypes": default_sub_types,

0 commit comments

Comments
 (0)