@metaobjectsdev/metadata 1.0.2 → 1.0.4-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/core/parser-yaml.d.ts.map +1 -1
  2. package/dist/core/parser-yaml.js +4 -0
  3. package/dist/core/parser-yaml.js.map +1 -1
  4. package/dist/core/relationship/derive-m2m-fields.d.ts +3 -1
  5. package/dist/core/relationship/derive-m2m-fields.d.ts.map +1 -1
  6. package/dist/core/relationship/derive-m2m-fields.js +110 -15
  7. package/dist/core/relationship/derive-m2m-fields.js.map +1 -1
  8. package/dist/core/relationship/find-reference.d.ts +21 -5
  9. package/dist/core/relationship/find-reference.d.ts.map +1 -1
  10. package/dist/core/relationship/find-reference.js +29 -10
  11. package/dist/core/relationship/find-reference.js.map +1 -1
  12. package/dist/core/relationship/relationship-definition.embedded.js +8 -8
  13. package/dist/core/relationship/relationship-definition.embedded.js.map +1 -1
  14. package/dist/core/relationship/resolve-relationship-reference.d.ts +27 -0
  15. package/dist/core/relationship/resolve-relationship-reference.d.ts.map +1 -0
  16. package/dist/core/relationship/resolve-relationship-reference.js +84 -0
  17. package/dist/core/relationship/resolve-relationship-reference.js.map +1 -0
  18. package/dist/errors.d.ts +1 -1
  19. package/dist/errors.d.ts.map +1 -1
  20. package/dist/errors.js +31 -0
  21. package/dist/errors.js.map +1 -1
  22. package/dist/index.d.ts +8 -5
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +9 -4
  25. package/dist/index.js.map +1 -1
  26. package/dist/json-path.d.ts +14 -0
  27. package/dist/json-path.d.ts.map +1 -1
  28. package/dist/json-path.js +13 -0
  29. package/dist/json-path.js.map +1 -1
  30. package/dist/library/embedded-library.generated.d.ts +2 -0
  31. package/dist/library/embedded-library.generated.d.ts.map +1 -1
  32. package/dist/library/embedded-library.generated.js +11 -1
  33. package/dist/library/embedded-library.generated.js.map +1 -1
  34. package/dist/library/index.d.ts +2 -0
  35. package/dist/library/index.d.ts.map +1 -0
  36. package/dist/library/index.js +24 -0
  37. package/dist/library/index.js.map +1 -0
  38. package/dist/library/library-sources.d.ts +99 -6
  39. package/dist/library/library-sources.d.ts.map +1 -1
  40. package/dist/library/library-sources.js +165 -43
  41. package/dist/library/library-sources.js.map +1 -1
  42. package/dist/loader/meta-data-loader.d.ts +44 -21
  43. package/dist/loader/meta-data-loader.d.ts.map +1 -1
  44. package/dist/loader/meta-data-loader.js +118 -88
  45. package/dist/loader/meta-data-loader.js.map +1 -1
  46. package/dist/loader/sources/file-source.d.ts +7 -1
  47. package/dist/loader/sources/file-source.d.ts.map +1 -1
  48. package/dist/loader/sources/file-source.js +3 -2
  49. package/dist/loader/sources/file-source.js.map +1 -1
  50. package/dist/loader/validation-passes.d.ts +2 -0
  51. package/dist/loader/validation-passes.d.ts.map +1 -1
  52. package/dist/loader/validation-passes.js +162 -22
  53. package/dist/loader/validation-passes.js.map +1 -1
  54. package/dist/naming.d.ts +7 -0
  55. package/dist/naming.d.ts.map +1 -1
  56. package/dist/naming.js +10 -0
  57. package/dist/naming.js.map +1 -1
  58. package/dist/parser-core.d.ts +103 -0
  59. package/dist/parser-core.d.ts.map +1 -1
  60. package/dist/parser-core.js +202 -18
  61. package/dist/parser-core.js.map +1 -1
  62. package/dist/scope.d.ts +16 -0
  63. package/dist/scope.d.ts.map +1 -0
  64. package/dist/scope.js +78 -0
  65. package/dist/scope.js.map +1 -0
  66. package/dist/serializer-json.d.ts +1 -0
  67. package/dist/serializer-json.d.ts.map +1 -1
  68. package/dist/serializer-json.js +43 -1
  69. package/dist/serializer-json.js.map +1 -1
  70. package/dist/vocabulary-rewrite-yaml.d.ts +2 -0
  71. package/dist/vocabulary-rewrite-yaml.d.ts.map +1 -0
  72. package/dist/vocabulary-rewrite-yaml.js +22 -0
  73. package/dist/vocabulary-rewrite-yaml.js.map +1 -0
  74. package/package.json +7 -7
  75. package/src/core/parser-yaml.ts +4 -0
  76. package/src/core/relationship/derive-m2m-fields.ts +115 -15
  77. package/src/core/relationship/find-reference.ts +34 -11
  78. package/src/core/relationship/relationship-definition.embedded.ts +8 -8
  79. package/src/core/relationship/resolve-relationship-reference.ts +99 -0
  80. package/src/errors.ts +31 -0
  81. package/src/index.ts +18 -5
  82. package/src/json-path.ts +16 -1
  83. package/src/library/embedded-library.generated.ts +12 -1
  84. package/src/library/index.ts +23 -0
  85. package/src/library/library-sources.ts +197 -47
  86. package/src/loader/meta-data-loader.ts +154 -102
  87. package/src/loader/sources/file-source.ts +10 -2
  88. package/src/loader/validation-passes.ts +181 -23
  89. package/src/naming.ts +11 -0
  90. package/src/parser-core.ts +319 -22
  91. package/src/scope.ts +97 -0
  92. package/src/serializer-json.ts +46 -1
  93. package/src/vocabulary-rewrite-yaml.ts +21 -0
@@ -8,7 +8,8 @@
8
8
  import { ATTR_PREFIX, TYPE_SUBTYPE_SEPARATOR, RESERVED_KEY_NAME, RESERVED_KEY_PACKAGE, RESERVED_KEY_EXTENDS, RESERVED_KEY_ABSTRACT, RESERVED_KEY_IS_ARRAY, RESERVED_KEY_CHILDREN, } from "./shared/structural.js";
9
9
  import { ATTR_SUBTYPE_STRING, ATTR_SUBTYPE_INT, ATTR_SUBTYPE_LONG, ATTR_SUBTYPE_DOUBLE, ATTR_SUBTYPE_BOOLEAN, ATTR_SUBTYPE_STRINGARRAY, } from "./core/attr/attr-constants.js";
10
10
  import { SOURCE_SUBTYPE_RDB, SOURCE_ATTR_KIND, SOURCE_ATTR_TABLE, DEFAULT_SOURCE_KIND, PHYSICAL_NAME_ATTR_BY_KIND, } from "./persistence/source/source-constants.js";
11
- import { TYPE_SOURCE } from "./shared/base-types.js";
11
+ import { TYPE_METADATA, TYPE_SOURCE, SUBTYPE_ROOT } from "./shared/base-types.js";
12
+ import { packageOfResolutionKey } from "./naming.js";
12
13
  const SOURCE_RDB_FUSED_KEY = `${TYPE_SOURCE}${TYPE_SUBTYPE_SEPARATOR}${SOURCE_SUBTYPE_RDB}`;
13
14
  export function serializeJson(model, opts) {
14
15
  const indent = opts?.indent ?? 2;
@@ -236,4 +237,45 @@ function sortAttrValue(value) {
236
237
  }
237
238
  return value;
238
239
  }
240
+ // ---------------------------------------------------------------------------
241
+ // serializeSharedDocument — the FR-023 shared-model artifact form
242
+ //
243
+ // One canonical-JSON `metadata.root` document holding top-level nodes from any
244
+ // number of packages: NO root `package`, and every top-level node carries its own
245
+ // explicit `package` (a root-level child may name its package — ADR-0029's
246
+ // addressing model — so the document re-loads to the same resolution keys in
247
+ // every port). Each node is its canonicalSerialize form: raw own-layer, `extends`
248
+ // preserved (not flattened), attribute keys alphabetized, the FR-016 physical-name
249
+ // rewrite applied. Top-level nodes are sorted by resolution key; each node's
250
+ // children keep their authored order. Body key order: name, package, then the
251
+ // canonical rest. Byte-identical to Python's `serialize_shared_document`.
252
+ // ---------------------------------------------------------------------------
253
+ export function serializeSharedDocument(nodes) {
254
+ const sorted = [...nodes].sort((a, b) => {
255
+ const ka = a.resolutionKey();
256
+ const kb = b.resolutionKey();
257
+ return ka < kb ? -1 : ka > kb ? 1 : 0;
258
+ });
259
+ const children = sorted.map((node) => {
260
+ const pkg = packageOfResolutionKey(node.resolutionKey());
261
+ if (pkg === "") {
262
+ throw new Error(`serializeSharedDocument: ${node.resolutionKey()} has no package; a shared document carries only packaged nodes`);
263
+ }
264
+ const parsed = JSON.parse(canonicalSerialize(node));
265
+ const [fused, body] = Object.entries(parsed)[0];
266
+ // The node's own `package` (if it declared one) is replaced by the RESOLVED
267
+ // one: a node inheriting its file's root package declares none of its own.
268
+ const ordered = {
269
+ [RESERVED_KEY_NAME]: body[RESERVED_KEY_NAME],
270
+ [RESERVED_KEY_PACKAGE]: pkg,
271
+ };
272
+ for (const [key, value] of Object.entries(body)) {
273
+ if (key !== RESERVED_KEY_NAME && key !== RESERVED_KEY_PACKAGE)
274
+ ordered[key] = value;
275
+ }
276
+ return { [fused]: ordered };
277
+ });
278
+ const doc = { [fusedKey(TYPE_METADATA, SUBTYPE_ROOT)]: { [RESERVED_KEY_CHILDREN]: children } };
279
+ return JSON.stringify(doc, null, 2) + "\n";
280
+ }
239
281
  //# sourceMappingURL=serializer-json.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"serializer-json.js","sourceRoot":"","sources":["../src/serializer-json.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,4EAA4E;AAC5E,+EAA+E;AAC/E,8CAA8C;AAC9C,uDAAuD;AACvD,sEAAsE;AAGtE,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,oBAAoB,GAAG,GAAG,WAAW,GAAG,sBAAsB,GAAG,kBAAkB,EAAE,CAAC;AAW5F,MAAM,UAAU,aAAa,CAAC,KAAe,EAAE,IAAuB;IACpE,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,CAAC,CAAC;IAEjC,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1E,CAAC;AAED,8EAA8E;AAC9E,oFAAoF;AACpF,8EAA8E;AAE9E,iEAAiE;AACjE,MAAM,YAAY,GAAG,CAAC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URL=vocabulary-rewrite-yaml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocabulary-rewrite-yaml.d.ts","sourceRoot":"","sources":["../src/vocabulary-rewrite-yaml.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,mCAAmC,CAAC"}
@@ -0,0 +1,22 @@
1
+ // @metaobjectsdev/metadata/vocabulary-rewrite-yaml — the YAML arm of `meta upgrade`.
2
+ //
3
+ // The implementation stays under `core/`, beside the canonical-JSON rewriter it mirrors.
4
+ // This file exists so the SUBPATH NAME mirrors the layout under `src/`, which is what
5
+ // `tsconfig.scripts.json`'s `@metaobjectsdev/metadata/*` → `src/*` mapping requires.
6
+ //
7
+ // Nesting is NOT the problem — the `*` matches across `/`, which is why
8
+ // `@metaobjectsdev/codegen-ts/templates/entity-file` resolves to
9
+ // `src/templates/entity-file.ts` perfectly well. The problem was a subpath NAMED
10
+ // `vocabulary-rewrite-yaml` whose source sat at `src/core/vocabulary-rewrite-yaml.ts`:
11
+ // the substitution yields `src/vocabulary-rewrite-yaml`, and that is not where the module
12
+ // is. Renaming the export to `./core/vocabulary-rewrite-yaml` would also have satisfied
13
+ // the rule and was the cheaper edit, but this package is published and that subpath is
14
+ // public API, so the name stays and the layout moves to meet it.
15
+ //
16
+ // When the mapping misses, tsc falls through to `node_modules` and reads `dist/` — present
17
+ // for anyone who has built, absent on a fresh CI checkout where the `gates` lane runs
18
+ // `bun install` and never builds. `./library` shipped that way and took the lane down;
19
+ // this one had not been imported from anywhere `scripts/` typechecks, so it was latent.
20
+ // `cli/test/subpath-resolves-under-scripts-paths.test.ts` now gates the class.
21
+ export { rewriteYamlDocument } from "./core/vocabulary-rewrite-yaml.js";
22
+ //# sourceMappingURL=vocabulary-rewrite-yaml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocabulary-rewrite-yaml.js","sourceRoot":"","sources":["../src/vocabulary-rewrite-yaml.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,EAAE;AACF,yFAAyF;AACzF,sFAAsF;AACtF,qFAAqF;AACrF,EAAE;AACF,wEAAwE;AACxE,iEAAiE;AACjE,iFAAiF;AACjF,uFAAuF;AACvF,0FAA0F;AAC1F,wFAAwF;AACxF,uFAAuF;AACvF,iEAAiE;AACjE,EAAE;AACF,2FAA2F;AAC3F,sFAAsF;AACtF,uFAAuF;AACvF,wFAAwF;AACxF,+EAA+E;AAC/E,OAAO,EAAE,mBAAmB,EAA0B,MAAM,mCAAmC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metaobjectsdev/metadata",
3
- "version": "1.0.2",
3
+ "version": "1.0.4-rc.1",
4
4
  "description": "Metamodel loader, types, and constants for the MetaObjects standard.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,9 +17,9 @@
17
17
  "default": "./dist/core/index.js"
18
18
  },
19
19
  "./library": {
20
- "bun": "./src/library/library-sources.ts",
21
- "types": "./dist/library/library-sources.d.ts",
22
- "default": "./dist/library/library-sources.js"
20
+ "bun": "./src/library/index.ts",
21
+ "types": "./dist/library/index.d.ts",
22
+ "default": "./dist/library/index.js"
23
23
  },
24
24
  "./constants": {
25
25
  "bun": "./src/constants.ts",
@@ -27,9 +27,9 @@
27
27
  "default": "./dist/constants.js"
28
28
  },
29
29
  "./vocabulary-rewrite-yaml": {
30
- "bun": "./src/core/vocabulary-rewrite-yaml.ts",
31
- "types": "./dist/core/vocabulary-rewrite-yaml.d.ts",
32
- "default": "./dist/core/vocabulary-rewrite-yaml.js"
30
+ "bun": "./src/vocabulary-rewrite-yaml.ts",
31
+ "types": "./dist/vocabulary-rewrite-yaml.d.ts",
32
+ "default": "./dist/vocabulary-rewrite-yaml.js"
33
33
  }
34
34
  },
35
35
  "files": [
@@ -85,5 +85,9 @@ export function parseYaml(content: string, opts: ParseOptions): ParseResult {
85
85
  warnings: result.warnings,
86
86
  errors: [...desugarParseErrors, ...result.errors],
87
87
  envelopeWarnings: result.envelopeWarnings,
88
+ // ADR-0055 — pass the deferred-overlay queue through untouched. This door
89
+ // rebuilds the result to prepend desugar errors, so it has to forward every
90
+ // member; dropping it left the loader spreading `undefined`.
91
+ pendingOverlays: result.pendingOverlays,
88
92
  };
89
93
  }
@@ -17,12 +17,35 @@
17
17
  // two references are taken in declaration order (sourceField = first,
18
18
  // targetField = second). Resolution unions both at read time.
19
19
  // Ambiguous (source == target, neither @sourceRefField nor @symmetric) → throw.
20
+ //
21
+ // "source" above means the relationship's SUBJECT, and under `extends` there are two
22
+ // legitimate names for it. Every caller walks the RESOLVING `obj.relationships()`
23
+ // (codegen-ts's relation-resolver, runtime-ts's n2m-resolver, docs-site's link-graph)
24
+ // and passes the entity it is ITERATING, which for an inherited relationship is not
25
+ // the one that declared it. So the DECLARING entity is resolved here from `rel.parent`
26
+ // (same shape as the #368 loader fix, validation-passes' `declaringEntity = rel.parent
27
+ // ?? obj`), and the passed `source` is kept alongside it rather than discarded: a
28
+ // junction FK usually references the CONCRETE entity, because the abstract base has no
29
+ // table, while @objectRef on an inherited self-join names the base. Both are accepted,
30
+ // for the self-join classification and the hetero reference match alike. `source` is
31
+ // also the fallback when `rel` has no entity parent, which keeps the exported signature
32
+ // unchanged. Not covered: a junction reference naming an entity strictly BETWEEN the
33
+ // base and the navigating entity in a deeper hierarchy.
34
+ //
35
+ // The subject comparison is made on RESOLVED OBJECT IDENTITY, not on stripped
36
+ // short names, matching the Java reference (M2MFields.java). Bare-name equality
37
+ // cannot tell `a::NodeBase` from `b::NodeBase`, so once the subject set held two
38
+ // names a genuine CROSS-PACKAGE hetero M:N whose target shares a short name with
39
+ // the subject read as a self-join and refused to derive. Scoped deliberately to
40
+ // this one predicate — every other name comparison in this file is untouched.
20
41
 
21
42
  import type { MetaObject } from "../object/meta-object.js";
22
43
  import type { MetaRoot } from "../../shared/meta-root.js";
23
44
  import type { MetaRelationship } from "./meta-relationship.js";
24
45
  import type { MetaReferenceIdentity } from "../identity/meta-identity.js";
25
46
  import { stripPackage } from "../../naming.js";
47
+ import { TYPE_OBJECT } from "../../shared/base-types.js";
48
+ import { PACKAGE_SEPARATOR } from "../../shared/structural.js";
26
49
 
27
50
  /** Thrown when a M:N relationship's junction FK fields cannot be derived. */
28
51
  export class M2MDerivationError extends Error {
@@ -45,12 +68,36 @@ function refFkField(ref: MetaReferenceIdentity): string | undefined {
45
68
  return ref.fields[0];
46
69
  }
47
70
 
71
+ /**
72
+ * The root entity a reference name denotes, or undefined. Mirrors the Java
73
+ * reference's `M2MFields.findObject` exactly: a FULLY-QUALIFIED name (one
74
+ * containing "::") resolves EXACTLY on the object's package-folded key, never a
75
+ * bare-tail fallback; a bare name matches a short name, first match wins (the
76
+ * bare-collision case is the deferred follow-up Java records as issue #174).
77
+ *
78
+ * This exists so the SUBJECT comparison below can be made on object IDENTITY the
79
+ * way Java's already is. A bare-name compare cannot tell `a::NodeBase` from
80
+ * `b::NodeBase`, which made a genuine cross-package hetero M:N read as a
81
+ * self-join the moment the subject set held two names.
82
+ */
83
+ function findEntity(root: MetaRoot, name: string | undefined): MetaObject | undefined {
84
+ if (name === undefined || name === "") return undefined;
85
+ const objects = root.objects();
86
+ if (name.includes(PACKAGE_SEPARATOR)) {
87
+ return objects.find((o) => o.resolutionKey() === name);
88
+ }
89
+ const bare = stripPackage(name);
90
+ return objects.find((o) => o.name === bare);
91
+ }
92
+
48
93
  /**
49
94
  * Derive the source/target junction FK fields for a M:N relationship.
50
95
  *
51
96
  * @param rel the M:N relationship (carries @objectRef + @through + optional
52
97
  * @sourceRefField / @symmetric)
53
- * @param source the entity declaring `rel`
98
+ * @param source the entity the caller is navigating from. Accepted alongside
99
+ * `rel.parent` as a name for the relationship's subject, and used
100
+ * as the declaring entity when `rel` has no entity parent.
54
101
  * @param root the loaded model root (to find the junction entity)
55
102
  * @throws M2MDerivationError when the junction is missing/malformed or the
56
103
  * self-join is ambiguous.
@@ -60,10 +107,21 @@ export function deriveM2MFields(
60
107
  source: MetaObject,
61
108
  root: MetaRoot,
62
109
  ): M2MFields {
110
+ // The entity that DECLARES `rel` — see the header note. `rel.parent` is the
111
+ // owning entity for both an own declaration and an inherited one (an unmodified
112
+ // inherited child is the SAME node object, reused in place by
113
+ // MetaData._effectiveChildren; an override is a genuinely different node whose
114
+ // parent is the overriding entity, which is also correct).
115
+ const relParent = rel.parent;
116
+ const declaringEntity: MetaObject =
117
+ relParent !== undefined && relParent.type === TYPE_OBJECT
118
+ ? (relParent as MetaObject)
119
+ : source;
120
+
63
121
  const throughName = rel.through;
64
122
  if (throughName === undefined) {
65
123
  throw new M2MDerivationError(
66
- `relationship "${source.name}.${rel.name}" is missing @through (required for M:N derivation)`,
124
+ `relationship "${declaringEntity.name}.${rel.name}" is missing @through (required for M:N derivation)`,
67
125
  );
68
126
  }
69
127
  // @through may be package-qualified (FQN); findObject is keyed by bare name,
@@ -76,37 +134,79 @@ export function deriveM2MFields(
76
134
  : undefined);
77
135
  if (junction === undefined) {
78
136
  throw new M2MDerivationError(
79
- `relationship "${source.name}.${rel.name}" @through "${throughName}" does not resolve to an entity`,
137
+ `relationship "${declaringEntity.name}.${rel.name}" @through "${throughName}" does not resolve to an entity`,
80
138
  );
81
139
  }
82
140
 
83
141
  const targetName = rel.objectRef;
84
142
  if (targetName === undefined) {
85
143
  throw new M2MDerivationError(
86
- `relationship "${source.name}.${rel.name}" is missing @objectRef (the M:N target)`,
144
+ `relationship "${declaringEntity.name}.${rel.name}" is missing @objectRef (the M:N target)`,
87
145
  );
88
146
  }
89
147
 
90
148
  const refs = junction.referenceIdentities();
91
149
  if (refs.length !== 2) {
92
150
  throw new M2MDerivationError(
93
- `junction "${throughName}" for relationship "${source.name}.${rel.name}" must declare exactly two ` +
151
+ `junction "${throughName}" for relationship "${declaringEntity.name}.${rel.name}" must declare exactly two ` +
94
152
  `identity.reference children (found ${refs.length})`,
95
153
  );
96
154
  }
97
155
 
98
- const isSelfJoin = stripPackage(targetName) === source.name;
156
+ // The relationship's SUBJECT the entity the M:N hangs off. Under `extends`
157
+ // there are two legitimate names for it and BOTH occur in real models:
158
+ // * the DECLARING entity (rel.parent) — what @objectRef names for a self-join
159
+ // declared on an abstract base, and what a junction reference names when the
160
+ // author points the FK at the base type;
161
+ // * the NAVIGATING entity (`source`) — the concrete entity the caller is
162
+ // iterating, which is what a junction FK usually references, because that is
163
+ // the entity with the physical table.
164
+ // Accepting either is what makes the derivation independent of which entity's
165
+ // effective view reached the relationship. (Not covered: a junction reference
166
+ // naming an entity strictly BETWEEN the declaring base and the navigating
167
+ // entity in a deeper hierarchy — no model does that, and widening to the whole
168
+ // super chain would make the "must declare one identity.reference to ..." error
169
+ // unfalsifiable.)
170
+ const subjectNames = declaringEntity.name === source.name
171
+ ? [declaringEntity.name]
172
+ : [declaringEntity.name, source.name];
173
+ const subjectLabel = subjectNames.map((n) => `"${n}"`).join(" or ");
174
+ // Compared by resolved object IDENTITY, matching the Java reference. A
175
+ // stripPackage() compare cannot distinguish `a::NodeBase` from `b::NodeBase`,
176
+ // so with two names in the set a genuine cross-package hetero M:N read as a
177
+ // self-join and refused to derive.
178
+ const isSubject = (entity: MetaObject | undefined): boolean =>
179
+ entity !== undefined && (entity === declaringEntity || entity === source);
180
+ const isSubjectName = (name: string | undefined): boolean =>
181
+ name !== undefined && subjectNames.includes(stripPackage(name));
182
+
183
+ // Defensive bare fallback when @objectRef does not resolve — loader validation
184
+ // normally guarantees it does. Same carve-out the Java reference makes.
185
+ const targetEntityNode = findEntity(root, targetName);
186
+ const isSelfJoin = targetEntityNode !== undefined
187
+ ? isSubject(targetEntityNode)
188
+ : isSubjectName(targetName);
99
189
 
100
190
  if (!isSelfJoin) {
101
- // Hetero: match each reference by the entity it resolves to.
102
- const sourceRef = refs.find((r) => r.targetEntity !== undefined && stripPackage(r.targetEntity) === source.name);
103
- const targetRef = refs.find((r) => r.targetEntity !== undefined && stripPackage(r.targetEntity) === stripPackage(targetName));
191
+ // Hetero: match each reference by the ENTITY OBJECT it resolves to.
192
+ const sourceRef = refs.find((r) => isSubject(findEntity(root, r.targetEntity)));
193
+ // Identity here too. The two searches are INDEPENDENT nothing excludes
194
+ // sourceRef from this one, unlike the directed self-join branch below — so a
195
+ // bare compare could match the SOURCE-side reference again whenever the
196
+ // target's short name equals the source's, and silently return (srcFk, srcFk).
197
+ // Structurally unreachable while isSelfJoin was also bare (a colliding short
198
+ // name forced the self-join branch); making only isSelfJoin identity-based
199
+ // broke that invariant. Java matches identity on both sides (findRefToSubject
200
+ // + findRefToObject) and never had the hole.
201
+ const targetRef = targetEntityNode !== undefined
202
+ ? refs.find((r) => findEntity(root, r.targetEntity) === targetEntityNode)
203
+ : refs.find((r) => r.targetEntity !== undefined && stripPackage(r.targetEntity) === stripPackage(targetName));
104
204
  const sourceField = sourceRef ? refFkField(sourceRef) : undefined;
105
205
  const targetField = targetRef ? refFkField(targetRef) : undefined;
106
206
  if (sourceField === undefined || targetField === undefined) {
107
207
  throw new M2MDerivationError(
108
- `junction "${throughName}" for relationship "${source.name}.${rel.name}" must declare one ` +
109
- `identity.reference to "${source.name}" and one to "${stripPackage(targetName)}"`,
208
+ `junction "${throughName}" for relationship "${declaringEntity.name}.${rel.name}" must declare one ` +
209
+ `identity.reference to ${subjectLabel} and one to "${stripPackage(targetName)}"`,
110
210
  );
111
211
  }
112
212
  return { sourceField, targetField };
@@ -119,7 +219,7 @@ export function deriveM2MFields(
119
219
  const b = refFkField(refs[1]!);
120
220
  if (a === undefined || b === undefined) {
121
221
  throw new M2MDerivationError(
122
- `symmetric junction "${throughName}" for "${source.name}.${rel.name}" has a reference with no @fields`,
222
+ `symmetric junction "${throughName}" for "${declaringEntity.name}.${rel.name}" has a reference with no @fields`,
123
223
  );
124
224
  }
125
225
  return { sourceField: a, targetField: b };
@@ -128,7 +228,7 @@ export function deriveM2MFields(
128
228
  const sourceRefField = rel.sourceRefField;
129
229
  if (sourceRefField === undefined) {
130
230
  throw new M2MDerivationError(
131
- `self-join relationship "${source.name}.${rel.name}" through "${throughName}" is ambiguous: ` +
231
+ `self-join relationship "${declaringEntity.name}.${rel.name}" through "${throughName}" is ambiguous: ` +
132
232
  `set @sourceRefField (directed) or @symmetric (undirected)`,
133
233
  );
134
234
  }
@@ -137,7 +237,7 @@ export function deriveM2MFields(
137
237
  const sourceRef = refs.find((r) => refFkField(r) === sourceRefField);
138
238
  if (sourceRef === undefined) {
139
239
  throw new M2MDerivationError(
140
- `@sourceRefField "${sourceRefField}" on "${source.name}.${rel.name}" does not match any ` +
240
+ `@sourceRefField "${sourceRefField}" on "${declaringEntity.name}.${rel.name}" does not match any ` +
141
241
  `identity.reference FK field on junction "${throughName}"`,
142
242
  );
143
243
  }
@@ -145,7 +245,7 @@ export function deriveM2MFields(
145
245
  const targetField = targetRef ? refFkField(targetRef) : undefined;
146
246
  if (targetField === undefined) {
147
247
  throw new M2MDerivationError(
148
- `junction "${throughName}" for "${source.name}.${rel.name}" has no distinct target-side reference`,
248
+ `junction "${throughName}" for "${declaringEntity.name}.${rel.name}" has no distinct target-side reference`,
149
249
  );
150
250
  }
151
251
  return { sourceField: sourceRefField, targetField };
@@ -20,25 +20,48 @@ export interface ReferenceLookup {
20
20
  }
21
21
 
22
22
  /**
23
- * Find an identity.reference on either `a` or `b` whose @references targets the
24
- * other side. Returns undefined if neither side declares one.
23
+ * Every identity.reference on `a` or `b` whose @references targets the other
24
+ * side, `a` walked first. Comparison is package-insensitive: `@references` may
25
+ * be a bare entity name ("User") or a fully-qualified one ("pkg::User"); both
26
+ * match `other.name`.
25
27
  *
26
- * Comparison is package-insensitive: `@references` may be a bare entity name
27
- * ("User") or a fully-qualified one ("pkg::User"); both match `other.name`.
28
- *
29
- * If both sides declare references targeting each other (rare, but legal for
30
- * mutual 1:1), returns the first found, walking `a` first.
28
+ * #368: an entity may legally declare more than one identity.reference onto
29
+ * the same target (e.g. Match.homeTeamRef and Match.awayTeamRef both -> Team).
30
+ * Callers that must not silently guess which one is meant enumerate here and
31
+ * report the ambiguity themselves; see also `findReferenceBetween`, which
32
+ * keeps the historical first-match contract for callers that legitimately
33
+ * expect at most one reference between the pair.
31
34
  */
32
- export function findReferenceBetween(
35
+ export function findReferencesBetween(
33
36
  a: MetaObject,
34
37
  b: MetaObject,
35
- ): ReferenceLookup | undefined {
38
+ ): ReferenceLookup[] {
39
+ const found: ReferenceLookup[] = [];
36
40
  for (const [holder, other] of [[a, b], [b, a]] as const) {
37
41
  for (const ref of holder.referenceIdentities()) {
38
42
  if (stripPackage(ref.targetEntity) === other.name) {
39
- return { holder, other, referenceIdentity: ref };
43
+ found.push({ holder, other, referenceIdentity: ref });
40
44
  }
41
45
  }
42
46
  }
43
- return undefined;
47
+ return found;
48
+ }
49
+
50
+ /**
51
+ * Find an identity.reference on either `a` or `b` whose @references targets the
52
+ * other side. Returns undefined if neither side declares one.
53
+ *
54
+ * Delegates to `findReferencesBetween` and returns its first entry — kept for
55
+ * backward compatibility (this is exported public API) and for the mutual-1:1
56
+ * case where both sides declare references targeting each other. #368: two
57
+ * references onto the SAME target are also legal and indistinguishable from
58
+ * here — a caller that must not guess which one is meant should call
59
+ * `findReferencesBetween` directly and handle ambiguity explicitly rather than
60
+ * relying on this function's first-match behaviour.
61
+ */
62
+ export function findReferenceBetween(
63
+ a: MetaObject,
64
+ b: MetaObject,
65
+ ): ReferenceLookup | undefined {
66
+ return findReferencesBetween(a, b)[0];
44
67
  }
@@ -13,7 +13,7 @@ export const RELATIONSHIP_DEFINITION: ProviderDefinition = {
13
13
  "type": "relationship",
14
14
  "subType": "base",
15
15
  "description": "Abstract relationship base — shared shape for the concrete association/aggregation/composition subtypes; not authored directly. A `relationship.base` node fails to load (ERR_ABSTRACT_SUBTYPE_AUTHORED): this subtype is a registry anchor concrete subtypes inherit from, never a node in a document.",
16
- "rules": "@cardinality is an open string at the metamodel level ('one'/'many', and Java-canonical composite forms such as 'many-to-one'); @objectRef names the target entity. M:N is expressed by @cardinality:'many' + @objectRef + @through: @through names a junction entity that MUST declare two identity.reference children (one per FK side), and the relationship's FK fields are DERIVED from those references — never restated. @sourceRefField disambiguates a DIRECTED self-join by naming the source-side FK field on the junction; @symmetric marks an UNDIRECTED self-join (union-on-read) valid only when @objectRef == the declaring entity; the two are mutually exclusive. @onDelete/@onUpdate carry referential actions (cascade/set-null/restrict/no-action).",
16
+ "rules": "@cardinality is an open string at the metamodel level ('one'/'many', and Java-canonical composite forms such as 'many-to-one'); @objectRef names the target entity. M:N is expressed by @cardinality:'many' + @objectRef + @through: @through names a junction entity that MUST declare two identity.reference children (one per FK side), and the relationship's FK fields are DERIVED from those references — never restated. @sourceRefField disambiguates a DIRECTED self-join by naming the source-side FK field on the junction, or on a @cardinality:'one' relationship names which of several identity.reference nodes onto the same target it navigates when name-pairing does not resolve it uniquely; @symmetric marks an UNDIRECTED self-join (union-on-read) valid only when @objectRef == the declaring entity; the two are mutually exclusive. @onDelete/@onUpdate carry referential actions (cascade/set-null/restrict/no-action).",
17
17
  "children": [
18
18
  {
19
19
  "type": "attr",
@@ -45,7 +45,7 @@ export const RELATIONSHIP_DEFINITION: ProviderDefinition = {
45
45
  "name": "sourceRefField",
46
46
  "min": 0,
47
47
  "max": 1,
48
- "description": "Directed self-join disambiguator: names the source-side FK field on the junction (the other reference is the target side). Required only for directed/ambiguous self-join M:N. Mutually exclusive with @symmetric."
48
+ "description": "Disambiguates which reference/FK field a relationship uses when more than one candidate exists: on a directed self-join M:N it names the junction's source-side reference (mutually exclusive with @symmetric), and on a @cardinality:'one' relationship it names which of several identity.reference nodes onto the same target the relationship navigates when name-pairing does not resolve it uniquely."
49
49
  },
50
50
  {
51
51
  "type": "attr",
@@ -90,7 +90,7 @@ export const RELATIONSHIP_DEFINITION: ProviderDefinition = {
90
90
  "subType": "association",
91
91
  "description": "A plain reference to another entity — no ownership; the target has an independent lifecycle (default @onDelete restrict).",
92
92
  "whenToUse": "A plain directed reference to another entity, no ownership or cascade. The lightest link — when you just need to point at another entity.",
93
- "rules": "M:N is expressed by @cardinality:'many' + @objectRef + @through: @through names a junction entity that MUST declare two identity.reference children (one per FK side), and the relationship's FK fields are DERIVED from those references — never restated. @sourceRefField disambiguates a DIRECTED self-join by naming the source-side FK field on the junction; @symmetric marks an UNDIRECTED self-join (union-on-read) valid only when @objectRef == the declaring entity; the two are mutually exclusive. Association is a plain reference — the target's lifecycle is independent (default @onDelete restrict).",
93
+ "rules": "M:N is expressed by @cardinality:'many' + @objectRef + @through: @through names a junction entity that MUST declare two identity.reference children (one per FK side), and the relationship's FK fields are DERIVED from those references — never restated. @sourceRefField disambiguates a DIRECTED self-join by naming the source-side FK field on the junction, or on a @cardinality:'one' relationship names which of several identity.reference nodes onto the same target it navigates when name-pairing does not resolve it uniquely; @symmetric marks an UNDIRECTED self-join (union-on-read) valid only when @objectRef == the declaring entity; the two are mutually exclusive. Association is a plain reference — the target's lifecycle is independent (default @onDelete restrict).",
94
94
  "children": [
95
95
  {
96
96
  "type": "attr",
@@ -122,7 +122,7 @@ export const RELATIONSHIP_DEFINITION: ProviderDefinition = {
122
122
  "name": "sourceRefField",
123
123
  "min": 0,
124
124
  "max": 1,
125
- "description": "Directed self-join disambiguator: names the source-side FK field on the junction (the other reference is the target side). Required only for directed/ambiguous self-join M:N. Mutually exclusive with @symmetric."
125
+ "description": "Disambiguates which reference/FK field a relationship uses when more than one candidate exists: on a directed self-join M:N it names the junction's source-side reference (mutually exclusive with @symmetric), and on a @cardinality:'one' relationship it names which of several identity.reference nodes onto the same target the relationship navigates when name-pairing does not resolve it uniquely."
126
126
  },
127
127
  {
128
128
  "type": "attr",
@@ -167,7 +167,7 @@ export const RELATIONSHIP_DEFINITION: ProviderDefinition = {
167
167
  "subType": "aggregation",
168
168
  "description": "A shared/independent containment — the parent groups the target but does not own its lifecycle (default @onDelete set-null).",
169
169
  "whenToUse": "One entity groups others it does NOT own (children outlive the parent; delete sets the FK null). Use instead of composition when there is no ownership.",
170
- "rules": "M:N is expressed by @cardinality:'many' + @objectRef + @through: @through names a junction entity that MUST declare two identity.reference children (one per FK side), and the relationship's FK fields are DERIVED from those references — never restated. @sourceRefField disambiguates a DIRECTED self-join by naming the source-side FK field on the junction; @symmetric marks an UNDIRECTED self-join (union-on-read) valid only when @objectRef == the declaring entity; the two are mutually exclusive. Aggregation is shared/independent — the target outlives the parent (default @onDelete set-null).",
170
+ "rules": "M:N is expressed by @cardinality:'many' + @objectRef + @through: @through names a junction entity that MUST declare two identity.reference children (one per FK side), and the relationship's FK fields are DERIVED from those references — never restated. @sourceRefField disambiguates a DIRECTED self-join by naming the source-side FK field on the junction, or on a @cardinality:'one' relationship names which of several identity.reference nodes onto the same target it navigates when name-pairing does not resolve it uniquely; @symmetric marks an UNDIRECTED self-join (union-on-read) valid only when @objectRef == the declaring entity; the two are mutually exclusive. Aggregation is shared/independent — the target outlives the parent (default @onDelete set-null).",
171
171
  "children": [
172
172
  {
173
173
  "type": "attr",
@@ -199,7 +199,7 @@ export const RELATIONSHIP_DEFINITION: ProviderDefinition = {
199
199
  "name": "sourceRefField",
200
200
  "min": 0,
201
201
  "max": 1,
202
- "description": "Directed self-join disambiguator: names the source-side FK field on the junction (the other reference is the target side). Required only for directed/ambiguous self-join M:N. Mutually exclusive with @symmetric."
202
+ "description": "Disambiguates which reference/FK field a relationship uses when more than one candidate exists: on a directed self-join M:N it names the junction's source-side reference (mutually exclusive with @symmetric), and on a @cardinality:'one' relationship it names which of several identity.reference nodes onto the same target the relationship navigates when name-pairing does not resolve it uniquely."
203
203
  },
204
204
  {
205
205
  "type": "attr",
@@ -244,7 +244,7 @@ export const RELATIONSHIP_DEFINITION: ProviderDefinition = {
244
244
  "subType": "composition",
245
245
  "description": "An owned containment — the parent owns the target's lifecycle; deleting the parent deletes the children (default @onDelete cascade).",
246
246
  "whenToUse": "You need a parent that OWNS a child collection (one-to-many, cascade on delete). Declare it to generate the FK + typed navigation instead of a bare FK field + hand-written joins.",
247
- "rules": "M:N is expressed by @cardinality:'many' + @objectRef + @through: @through names a junction entity that MUST declare two identity.reference children (one per FK side), and the relationship's FK fields are DERIVED from those references — never restated. @sourceRefField disambiguates a DIRECTED self-join by naming the source-side FK field on the junction; @symmetric marks an UNDIRECTED self-join (union-on-read) valid only when @objectRef == the declaring entity; the two are mutually exclusive. Composition is owned lifecycle — the children do not outlive the parent (default @onDelete cascade).",
247
+ "rules": "M:N is expressed by @cardinality:'many' + @objectRef + @through: @through names a junction entity that MUST declare two identity.reference children (one per FK side), and the relationship's FK fields are DERIVED from those references — never restated. @sourceRefField disambiguates a DIRECTED self-join by naming the source-side FK field on the junction, or on a @cardinality:'one' relationship names which of several identity.reference nodes onto the same target it navigates when name-pairing does not resolve it uniquely; @symmetric marks an UNDIRECTED self-join (union-on-read) valid only when @objectRef == the declaring entity; the two are mutually exclusive. Composition is owned lifecycle — the children do not outlive the parent (default @onDelete cascade).",
248
248
  "children": [
249
249
  {
250
250
  "type": "attr",
@@ -276,7 +276,7 @@ export const RELATIONSHIP_DEFINITION: ProviderDefinition = {
276
276
  "name": "sourceRefField",
277
277
  "min": 0,
278
278
  "max": 1,
279
- "description": "Directed self-join disambiguator: names the source-side FK field on the junction (the other reference is the target side). Required only for directed/ambiguous self-join M:N. Mutually exclusive with @symmetric."
279
+ "description": "Disambiguates which reference/FK field a relationship uses when more than one candidate exists: on a directed self-join M:N it names the junction's source-side reference (mutually exclusive with @symmetric), and on a @cardinality:'one' relationship it names which of several identity.reference nodes onto the same target the relationship navigates when name-pairing does not resolve it uniquely."
280
280
  },
281
281
  {
282
282
  "type": "attr",