Skip to content

Commit 081ce41

Browse files
committed
feat(jvm): C4 metamodelVersion marker in the registry manifest
Add METAMODEL_VERSION = "0" constant and emit metamodelVersion as the first top-level JSON key in RegistryManifest.serialize(), matching the TS reference. Both Java and Kotlin conformance runners byte-match the shared expected-registry.json fixture. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GF9xLEQZaPus5Y6opk398n
1 parent 00c099a commit 081ce41

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

server/java/metadata/src/main/java/com/metaobjects/registry/RegistryManifest.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ public static List<MetaDataTypeProvider> metamodelProviders() {
216216
/** Wildcard token used by Java's {@link ChildRequirement} for "any name / any type". */
217217
private static final String WILDCARD = "*";
218218

219+
/**
220+
* The rolled-up spec-version string emitted as the first top-level key of
221+
* the registry manifest. Value {@code "0"} = pre-1.0/unstable (semver major-0);
222+
* the 1.0 cut will flip it to {@code "1.0"}. Mirrors the TS reference's
223+
* {@code METAMODEL_VERSION} constant.
224+
*/
225+
public static final String METAMODEL_VERSION = "0";
226+
219227
// ------------------------------------------------------------------
220228
// SP-G Phase1 Units2-3 — manifest emitter exclusions (documented, uniform
221229
// across all four ports; see fixtures/registry-conformance/README.md
@@ -562,7 +570,8 @@ private static String valueTypeOf(String attrName, String expectedSubType) {
562570
* <p>Serialization contract — every port MUST match this exactly:</p>
563571
* <ul>
564572
* <li>2-space indentation.</li>
565-
* <li>Object key order fixed by construction: {@code types}, {@code commonAttrs},
573+
* <li>Object key order fixed by construction: {@code metamodelVersion},
574+
* {@code types}, {@code commonAttrs},
566575
* {@code defaultSubTypes}; each type as {@code type}, {@code subType},
567576
* {@code attrs}; each attr as {@code name}, {@code valueType},
568577
* {@code isArray}, {@code required}.</li>
@@ -646,6 +655,9 @@ private static String serialize(List<ManifestType> types,
646655
StringBuilder sb = new StringBuilder();
647656
sb.append("{\n");
648657

658+
// "metamodelVersion": first top-level key (C4 of the 1.0 readiness program)
659+
sb.append(" \"metamodelVersion\": ").append(jsonString(METAMODEL_VERSION)).append(",\n");
660+
649661
// "types": [ ... ]
650662
sb.append(" \"types\": [");
651663
if (types.isEmpty()) {

0 commit comments

Comments
 (0)