Skip to content

Commit 3edbed7

Browse files
dmealingclaude
andcommitted
fix(ci): unblock main — integration-test pom versions + regenerate metamodel-docs
Two pre-existing red gates on main, unrelated to each other, both unblocking: 1. release-gate (java)/(kotlin): server/java/integration-tests/pom.xml and integration-tests-kotlin/pom.xml pinned parent 7.4.4-SNAPSHOT, but the reactor is 7.5.1-SNAPSHOT — these two modules sit outside the root <modules> reactor, so the 7.5.0 release's `mvn versions:set` skipped them and the parent POM no longer resolves. Bump both to 7.5.1-SNAPSHOT. 2. metamodel-docs-conformance: the committed fixture had drifted — the metamodel providers carry authored `whenToUse` descriptions that were never regenerated into fixtures/metamodel-docs/expected. Regenerated (8 files, purely additive "When to use" guidance) via scripts/regen-metamodel-docs.ts. (A third local-only failure, cli detectPackageManager, is NOT a code bug: the impl correctly walks to the FS root for a lockfile, and a stray /tmp/package-lock.json on the dev box makes it resolve "npm" locally. Green in clean CI; no change needed.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuZWKnWzYGVnESijL7uuky
1 parent 4e262b3 commit 3edbed7

10 files changed

Lines changed: 76 additions & 2 deletions

File tree

fixtures/metamodel-docs/expected/types/field.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ True/false flag. Binds to the native boolean type; DB column is BOOLEAN.
4646

4747
**Owning provider:** metaobjects-core-types
4848

49+
**When to use:** A true/false flag.
50+
4951
**Attributes**
5052

5153
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -78,6 +80,8 @@ Stores money as integer minor units (cents). Binds to long; the client formats v
7880

7981
**Rules:** Storage is integer minor units (cents for USD, yen for JPY) — the wire form is unchanged from long. The server never formats currency; all formatting is client-side via Intl.NumberFormat using @currency (ISO 4217) and @locale (BCP 47). Float arithmetic for money is forbidden.
8082

83+
**When to use:** A column holds money. Use currency so it stores integer minor-units and the client formats it — never floats or hand-rolled cents math.
84+
8185
**Attributes**
8286

8387
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -109,6 +113,8 @@ Calendar date (no time-of-day). Binds to the native date/temporal type; DB colum
109113

110114
**Owning provider:** metaobjects-core-types
111115

116+
**When to use:** A column is a calendar date with no time-of-day. Use date instead of a string.
117+
112118
**Attributes**
113119

114120
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -142,6 +148,8 @@ Precision-exact decimal (use @precision/@scale). Native TS binding is string (lo
142148

143149
**Rules:** The wire and native-TS form is a STRING to stay precision-exact end-to-end (Drizzle pg numeric infers as string; SP-H/ADR-0019). Set @precision (total significant digits) and @scale (digits right of the point) to drive NUMERIC(p,s).
144150

151+
**When to use:** A value needs exact precision (money amounts, rates, quantities). Use decimal with @precision/@scale — never double, which loses precision.
152+
145153
**Attributes**
146154

147155
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -174,6 +182,8 @@ Double-precision (64-bit) IEEE-754 floating point. Binds to the native double/nu
174182

175183
**Owning provider:** metaobjects-core-types
176184

185+
**When to use:** An approximate floating-point number where exactness is not required. For money/precision use decimal.
186+
177187
**Attributes**
178188

179189
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -206,6 +216,8 @@ String-backed enumeration constrained to a closed set of member symbols (@values
206216

207217
**Rules:** Required @values is a non-empty, duplicate-free set; each member must match ^[A-Za-z_][A-Za-z0-9_]*$ so symbol == stored string in every target language. Optional FR-010/FR-011 overlays add tolerant-extract aliasing (@enumAlias), per-member docs (@enumDoc), an uncoercible-value fallback (@coerceDefault, must be one of @values), and ASCII normalization mode (@normalize).
208218

219+
**When to use:** A field is a fixed, closed set of string values. Set @values so the union type, DB CHECK, and validation are generated — don't hand-roll constants + checks.
220+
209221
**Attributes**
210222

211223
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -272,6 +284,8 @@ Single-precision floating point. Binds to the native double/number type (TS has
272284

273285
**Owning provider:** metaobjects-core-types
274286

287+
**When to use:** A whole number within +/-2^31. Use long instead if values can exceed that.
288+
275289
**Attributes**
276290

277291
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -302,6 +316,8 @@ Single-precision floating point. Binds to the native double/number type (TS has
302316

303317
**Owning provider:** metaobjects-core-types
304318

319+
**When to use:** A whole number that may exceed 32 bits (ids, counters, epoch millis).
320+
305321
**Attributes**
306322

307323
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -334,6 +350,8 @@ An open-keyed map (Record<string,V> / dict[str,V]) stored in a single jsonb colu
334350

335351
**Rules:** Keys are always strings. Set exactly one of @valueType (a scalar value subtype: string/int/long/double/float/decimal/boolean/date/time/timestamp/uuid) or @objectRef (a value-object name or FQN). Stored as a single jsonb column holding the JSON object — never a native array; isArray does not apply.
336352

353+
**When to use:** A field is an open-keyed map of values (Record<string,V>). Use it for dynamic keys instead of an untyped jsonb string.
354+
337355
**Attributes**
338356

339357
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -368,6 +386,8 @@ A nested structured value (set @objectRef to the target object). Storage is gove
368386

369387
**Rules:** Set @objectRef to the nested object's name (or FQN). @storage selects physical layout — flattened expands into prefixed parent columns (isArray must be false), jsonb stores the structured value (or array when isArray=true) in one jsonb column, subdocument emits no Postgres column. Defaults to single-jsonb-column when @storage is absent.
370388

389+
**When to use:** A field holds a nested structured value (or an array of them). Set @objectRef + @storage so the shape is typed and persisted (flattened/jsonb) instead of an untyped blob.
390+
371391
**Attributes**
372392

373393
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -400,6 +420,8 @@ Variable-length text. Binds to the native string type; DB column is VARCHAR/TEXT
400420

401421
**Owning provider:** metaobjects-core-types
402422

423+
**When to use:** Plain variable-length text. Set @maxLength to size the column. The default for textual data.
424+
403425
**Attributes**
404426

405427
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -462,6 +484,8 @@ Date + time-of-day instant (optionally with timezone). Binds to the native date/
462484

463485
**Owning provider:** metaobjects-core-types
464486

487+
**When to use:** A column records an instant (created/updated at). Use timestamp so it serializes ISO-8601 with timezone consistently.
488+
465489
**Attributes**
466490

467491
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -493,6 +517,8 @@ Logical UUID identity scalar. A bare scalar (no required attrs, no loader value-
493517

494518
**Owning provider:** metaobjects-core-types
495519

520+
**When to use:** A key or external identifier is a UUID. Use it for a typed UUID column instead of a plain string.
521+
496522
**Attributes**
497523

498524
| Attribute | Type | Required | Default | Allowed values | Provider | Description |

fixtures/metamodel-docs/expected/types/identity.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ The primary key — one per entity; @fields names its column(s), @generation the
1616

1717
**Owning provider:** metaobjects-core-types
1818

19+
**When to use:** Every entity needs exactly one — names the primary-key field(s) and how the value is generated. Always declare it.
20+
1921
**Attributes**
2022

2123
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -33,6 +35,8 @@ A foreign-key reference to another entity (@references target; @enforce toggles
3335

3436
**Owning provider:** metaobjects-core-types
3537

38+
**When to use:** This entity holds a foreign key to another. Declare it to generate the FK constraint + typed navigation, instead of a loose id field you join on by hand.
39+
3640
**Attributes**
3741

3842
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -52,6 +56,8 @@ A secondary index (unique by default via @unique).
5256

5357
**Owning provider:** metaobjects-core-types
5458

59+
**When to use:** A column or set must be unique, or you want an index for lookups/sorting. Declare it instead of a hand-written UNIQUE constraint or CREATE INDEX.
60+
5561
**Attributes**
5662

5763
| Attribute | Type | Required | Default | Allowed values | Provider | Description |

fixtures/metamodel-docs/expected/types/object.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ An object that owns its data: own identity, writable sources, and lifecycle. The
3636

3737
**Rules:** object.entity owns data — it declares its own identity, its primary source must be a writable @kind (read-only kinds may appear only in a read role), and it carries lifecycle. A field carrying origin.* is derived ⇒ read-only wherever it lives, including on an entity. Templates (template.*) may be nested so a prompt can be co-located with its owning entity. See ADR-0028 (object taxonomy).
3838

39+
**When to use:** The thing owns its own data and lifecycle — a table you create/read/update/delete. The default for any persisted resource.
40+
3941
**Attributes**
4042

4143
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -61,6 +63,8 @@ A derived read-only representation of entities. Its fields are extends-bound / o
6163

6264
**Rules:** object.projection is a derived read-only representation: every field is extends-bound, origin-derived, or self-declared-under-external-assembly, and all are read-only at the subtype level. Identity is optional and, when present, MUST extend an entity identity. Sources are restricted to read-only @kinds. The declared field set IS the exposure — an inclusive list, fail-closed. A projection NEVER declares relationships (derivation is expressed via @via, not a relationship child) and NEVER co-locates templates — hence its child set omits both relationship and template. See ADR-0028 (object taxonomy, projection).
6365

66+
**When to use:** You need a derived, read-only view over entities — a report, summary, or joined/aggregated read model. Declare it (with origin.* children) instead of hand-writing the SELECT/joins; it stays read-only and regenerates.
67+
6468
**Attributes**
6569

6670
_No subtype-specific attributes._
@@ -81,6 +85,8 @@ A value object — pure shape with NO identity and NO source, ever. Constructed
8185

8286
**Rules:** object.value is pure shape: it NEVER declares an identity and NEVER declares a source, in any role. It is constructed — by a caller, by assembly, or by embedding — and is never populated from a backing store. It may `extends` an entity's fields to reuse their shape. @normalize is the object-level default ASCII normalization mode applied to this value's enum fields' tolerant extract (each field may still override per-field). See ADR-0028 (object taxonomy, value purity).
8387

88+
**When to use:** You need a reusable typed shape with NO identity and NO table — an embedded value, a DTO, a prompt/response payload. Constructed in memory, never persisted on its own.
89+
8490
**Attributes**
8591

8692
| Attribute | Type | Required | Default | Allowed values | Provider | Description |

fixtures/metamodel-docs/expected/types/origin.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ A count/sum/avg/min/max (@agg) computed over a column (@of) reached along a rela
1818

1919
**Rules:** @via may be omitted only when exactly one single-hop relationship leads from the base entity to the @of entity (single-hop-unique inference; FR-024, ADR-0029). Multi-hop paths must always be stated explicitly.
2020

21+
**When to use:** A projection needs a derived count/sum/avg/min/max over related rows. Declare it instead of hand-writing the aggregate query — it stays consistent and regenerates.
22+
2123
**Attributes**
2224

2325
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -50,6 +52,8 @@ A relationship-derived array of nested view-objects: walks @via to produce the c
5052

5153
**Owning provider:** metaobjects-core-types
5254

55+
**When to use:** A projection needs an array of nested child view-objects (a parent with its children inline). Declare it instead of hand-assembling the nested query + mapping.
56+
5357
**Attributes**
5458

5559
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -66,6 +70,8 @@ A cross-entity field reference: this projection field passes a source entity's v
6670

6771
**Owning provider:** metaobjects-core-types
6872

73+
**When to use:** A projection field just surfaces a field from a related entity. Declare the cross-entity passthrough instead of re-joining and re-selecting it by hand.
74+
6975
**Attributes**
7076

7177
| Attribute | Type | Required | Default | Allowed values | Provider | Description |

fixtures/metamodel-docs/expected/types/relationship.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ A shared/independent containment — the parent groups the target but does not o
1818

1919
**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).
2020

21+
**When to use:** 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.
22+
2123
**Attributes**
2224

2325
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -42,6 +44,8 @@ A plain reference to another entity — no ownership; the target has an independ
4244

4345
**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).
4446

47+
**When to use:** A plain directed reference to another entity, no ownership or cascade. The lightest link — when you just need to point at another entity.
48+
4549
**Attributes**
4650

4751
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -90,6 +94,8 @@ An owned containment — the parent owns the target's lifecycle; deleting the pa
9094

9195
**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).
9296

97+
**When to use:** 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.
98+
9399
**Attributes**
94100

95101
| Attribute | Type | Required | Default | Allowed values | Provider | Description |

fixtures/metamodel-docs/expected/types/source.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ The relational-database paradigm source (ADR-0007): binds an object to a physica
3232

3333
**Rules:** ADR-0007: source declares where an object's data lives; rdb is the relational paradigm subtype. An object may declare multiple sources, distinguished by @role, with exactly ONE @role: "primary" per object (write-through CQRS: a writable table for writes plus a read-only view for reads). The physical name is the @table attr (or the @kind-matching alias), never the structural `name`. Read-only-ness is derived from @kind (table → writable; view / materializedView / storedProc / tableFunction → read-only). The pre-v2 dbTable / dbView subtypes are retired.
3434

35+
**When to use:** The entity is backed by a relational table or view. Set @table/@kind — the default persistence source for any entity.
36+
3537
**Attributes**
3638

3739
| Attribute | Type | Required | Default | Allowed values | Provider | Description |

fixtures/metamodel-docs/expected/types/template.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ An output / serialization template (FR-004): every rendered artifact other than
3434

3535
**Rules:** output is either a document (@kind="document" or absent → renders @textRef in @format to one string) or an email (@kind="email" → renders subject + html + optional text to a structured EmailDocument). The cross-field presence rule is enforced in the loader's validateTemplatePayloadRefs pass: document requires @textRef; email requires @subjectRef AND @htmlBodyRef (with @textBodyRef optional) and carries NO @textRef. @format is a closed enum keyed by the render engine's escaper; @promptStyle (FR-010) selects the output-format prompt presentation and is never emitted as comments.
3636

37+
**When to use:** You render a document/email/serialized output from typed data. Declare an output template so the {{fields}} are drift-checked against the payload VO at build time.
38+
3739
**Attributes**
3840

3941
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
@@ -63,6 +65,8 @@ An LLM-targeted renderable prompt template (FR-004). Carries the generic referen
6365

6466
**Rules:** prompt requires @payloadRef (the typed payload it renders against) AND @textRef (the body text, provider-resolved at render time — enforced in the loader's validateTemplatePayloadRefs pass, not at the attr layer where @textRef is relaxed to optional so template.output email can omit it). @format is a closed enum keyed by the render engine's escaper. @responseRef (optional) names the response value-object the prompt expects and drives typed LLM-call trace derivation.
6567

68+
**When to use:** You are sending text to an LLM. Declare a prompt template with a typed payload so the prompt is versioned, drift-checked against its fields, and cache-stable — instead of string-building it in code.
69+
6670
**Attributes**
6771

6872
| Attribute | Type | Required | Default | Allowed values | Provider | Description |

0 commit comments

Comments
 (0)