Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ PyPI has had no product change since `0.25.0` — nothing is broken.
- **Kotlin** — `codegen-kotlin` (laid out by `KotlinWriter`, ADR-0063, on the JVM): entity + Exposed table + Spring controller + payload + relations + filter allowlist + validator + stored-proc + output-parser generators. `integration-tests-kotlin` runs the persistence-conformance corpus through Exposed against Testcontainers Postgres.

**Cross-port conformance corpora** (every port runs the shared corpus):
- Metamodel: `fixtures/conformance/` (596 fixtures; 49 shared corpora in total — per-corpus counts + the corpus x port matrix live in `docs/CONFORMANCE.md`). TS / C# / Java / Python all green.
- Metamodel: `fixtures/conformance/` (599 fixtures; 49 shared corpora in total — per-corpus counts + the corpus x port matrix live in `docs/CONFORMANCE.md`). TS / C# / Java / Python all green.
- Render: `fixtures/render-conformance/`. TS / Java / Kotlin / Python / C# / Rust byte-identical; the C# and Rust drift ledgers are empty (`docs/CONFORMANCE.md`).
- Persistence: `fixtures/persistence-conformance/`. **Query** scenarios run on every port (TS / C# / Java / Kotlin / Python; `op: guardedUpdate` is TS-only until each port's 1.3.0 guarded update lands), each provisioning its test DB by executing the committed, TS-produced `canonical/schema.postgres.sql` (Postgres only — Derby dropped for the cross-port query corpus, ADR-0015; the FR-044 `report-*` scenarios also run on SQLite, MySQL and D1 where a port has the engine, see [docs/CONFORMANCE.md](docs/CONFORMANCE.md)). The **migration** scenarios are exercised by **TS only** (the Node reference helper writes them; a native tool is equally first-class, ADR-0015 Amendment 2). **The corpus now gates WRITES, not just reads (SP-H):** an `op: roundtrip` scenario type INSERTs through each port's runtime/ORM write codec (NOT raw SQL), reads the row back, and asserts the wire-normalized value. The `AllTypes` entity (`roundtrip-all-types.yaml`) carries one field of **every** persistable `field.*` subtype — string/int/long/double/float/decimal/boolean/date/time/timestamp(+tz)/currency/enum/uuid/object — plus an **array-of-VO** `field.object @isArray @storage:jsonb` column (`labels`, written as 2-element / empty-`[]` / single-element arrays across the three rows) — so every subtype write+read (incl. the array-of-value-object jsonb codec) round-trips through every port against Testcontainers PG. (`field.byte`/`field.short`/`field.class` were cut as non-functional registration-only stubs — the matrix tracks only genuinely-supported subtypes; see `fixtures/registry-conformance/README.md` → "Per-subtype write-round-trip matrix".)
- API-contract: `fixtures/api-contract-conformance/`. TS / C# / Java / Kotlin / Python all green — each port runs **two lanes**: a hand-rolled reference server AND its **generated** API artifact booted over HTTP (the deployed controller/routes; TS+C# full-stack vs Testcontainers PG, Java/Kotlin/Python generated controller + in-memory repo behind the consumer seam). The generated fan-out found 10 real deployment bugs golden snapshots missed. Three sub-corpora run the **generated lane only, on all five ports** — `write-through/`, `projection/` (F22: a view-only `object.projection` serves GET list + GET by id and answers every write verb with `405 {"error": "method_not_allowed"}`) and `report/` (FR-044: a view-backed `object.report` serves GET list, answers `POST` with that same `405`, and mounts no `/{id}` route). That is deliberate, not a gap: what is under test is whether a port's GENERATOR emits those routes, and a hand-rolled reference server would answer every scenario by construction. The `m2m/` sub-corpus also gates **TPH x M:N together** (base-declared, subtype-declared, abstract-mid-declared, a non-subtype source onto a subtype TARGET, and the cross-subtype source id answering `200 []`) — the two corpora were originally built disjoint (`tph/` had no relationships, `m2m/` no discriminators), which is precisely how that defect class survived.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ first-week wedge plan — and `meta init` picks up from there.
| Kotlin | **Maven Central `8.3.1`** — codegen tier on top of Java: 17 generators (entity, Exposed table, names, relations, repository, output-parser, output-prompt, render-helper, extractor, filter-allowlist, validator, Spring config, storedProc, Spring controller, requirement-tests, api-docs, report-export); 24 / 24 persistence-conformance | [`docs/ports/kotlin.md`](docs/ports/kotlin.md) | [`server/java/codegen-kotlin/`](server/java/codegen-kotlin/) · [`server/java/metadata-ktx/`](server/java/metadata-ktx/) |
| C# | **NuGet `1.3.1`** — loader + conformance + EF Core codegen + render engine + `dotnet meta` CLI all shipped | [`docs/ports/csharp.md`](docs/ports/csharp.md) | [`server/csharp/`](server/csharp/) |
| Python | **PyPI `1.3.1`** — loader + conformance + render + entity-model codegen + ObjectManager runtime shipped; schema migrations in your own tool or the Node `meta migrate` reference helper (ADR-0015) | [`docs/ports/python.md`](docs/ports/python.md) | [`server/python/`](server/python/) |
| Rust | **Crates ready to publish, not yet published** — loader (JSON + YAML), project and source resolution, naming and all 41 validation passes; 596 / 596 metamodel conformance; prompt render and the reply parser (`metaobjects-render`); `cargo meta init` / `gen` / `verify` / `eject` with generators: the model crate through the sqlx store, the service and its opt-in axum routes (`service-routes`) to a typed client and its commands (ADR-0065). Schema migrations stay with the Node `meta` tool | [`docs/ports/rust.md`](docs/ports/rust.md) | [`server/rust/`](server/rust/) |
| Rust | **Crates ready to publish, not yet published** — loader (JSON + YAML), project and source resolution, naming and all 41 validation passes; 599 / 599 metamodel conformance; prompt render and the reply parser (`metaobjects-render`); `cargo meta init` / `gen` / `verify` / `eject` with generators: the model crate through the sqlx store, the service and its opt-in axum routes (`service-routes`) to a typed client and its commands (ADR-0065). Schema migrations stay with the Node `meta` tool | [`docs/ports/rust.md`](docs/ports/rust.md) | [`server/rust/`](server/rust/) |

## Capability matrix

Expand Down
2 changes: 1 addition & 1 deletion changelog.d/csharp-reference-facet.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@

Upgrading: C# `ReferenceDescriptor` is now `(Attr, Facet)`. A provider that sets
`TypeDefinition.References` in code builds `new ReferenceDescriptor(attr, new ReferenceFacet(...))`.
`TargetType` and `ErrorCode` move onto `ReferenceFacet` (where `ErrorCode` is optional),
`TargetType` (now the list `TargetTypes`, since a facet may name several types; a constructor taking one type name remains) and `ErrorCode` move onto `ReferenceFacet` (where `ErrorCode` is optional),
`TargetSubType` becomes the list `ReferenceFacet.TargetSubTypes`, and `DottedFieldPath` becomes
`ReferenceFacet.FieldPath`.
18 changes: 18 additions & 0 deletions changelog.d/reference-facet-target-type-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- **The reference facet's `targetType` may list several types, in every port, and
`role.token @heldBy` names an organization or a system (ADR-0070, call 9).** A definition file
may now write `"targetType": ["organization", "system"]`: a list of two or more distinct types,
never `*`, where a value resolves to a node of any listed type and `targetSubTypes` still
narrows whichever type it found. One type stays a plain string. When nodes of two listed types
share the name at the step that finds the target (two children of one container, or one
top-level key), the value is ambiguous and raises the facet's `errorCode`, else
`ERR_REF_UNRESOLVED`; a value naming another kind of node keeps `ERR_REF_WRONG_KIND`. The
TypeScript, C#, Java and Kotlin, Python and Rust readers, resolvers and registry manifests all
take the list, and the manifest writes it sorted. `spec/metamodel-definitions.md` and
`spec/metamodel-definition.schema.json` describe it. `role.token @heldBy` moves from
`organization` to `[organization, system]`, so a token held by a system now loads. New
conformance fixtures `ref-target-type-list-heldby`, `error-ref-wrong-kind-heldby` and
`error-ref-ambiguous-heldby` pin the three cases. `metamodelVersion` stays `1.4`: 1.4 is not
yet published.

Upgrading: TypeScript code that reads `ReferenceFacet.targetType` now gets `string | readonly
string[]`; `referenceTargetTypes(facet)` returns it as a list.
4 changes: 2 additions & 2 deletions changelog.d/systems-vocabulary-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
and Rust, so a model that declares none of these types is unchanged. `@owner`, `@runsAs`,
`@memberOf` and `@heldBy` are checked by the reference facet with its default codes: a name
that resolves to nothing is `ERR_REF_UNRESOLVED`, and one that names the wrong kind of node is
`ERR_REF_WRONG_KIND`. `@heldBy` names an organization only for now: a token held by a system
raises `ERR_REF_WRONG_KIND` until the facet accepts more than one target type. New conformance
`ERR_REF_WRONG_KIND`. `@heldBy` names an organization or a system (see the reference facet's
target type list). New conformance
fixtures `systems-vocabulary`, `error-ref-wrong-kind-runsas` and `error-ref-unresolved-runsas`
pin the vocabulary and the facet's two worked cases. `@residency` is a closed set (`free`,
`confined`) in every port: any other value is `ERR_BAD_ATTR_VALUE` (fixture
Expand Down
10 changes: 5 additions & 5 deletions docs/CONFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ regenerate with `ls -d fixtures/<corpus>/*/ | wc -l` for directory-shaped corpor

| Corpus | Fixtures | TS | Java | Kotlin | C# | Python | Rust |
|---|---|---|---|---|---|---|---|
| [`fixtures/conformance/`](../fixtures/conformance/) (metamodel) | 596 | ✓ | ✓ | inherits via `metadata-ktx` | ✓ | ✓ | ✓ (596 / 596, empty ledger) |
| [`fixtures/conformance/`](../fixtures/conformance/) (metamodel) | 599 | ✓ | ✓ | inherits via `metadata-ktx` | ✓ | ✓ | ✓ (599 / 599, empty ledger) |
| [`fixtures/yaml-conformance/`](../fixtures/yaml-conformance/) | 19 | 19 / 19 | 19 / 19 | inherits via Java | 18 / 19 (1 ledgered: `error-yaml-coerced-hex-in-string` — YamlDotNet doesn't coerce `0xFF`) | 19 / 19 | 19 / 19 |
| [`fixtures/verify-conformance/`](../fixtures/verify-conformance/) | 45 | ✓ | ✓ | inherits via Java | ✓ | ✓ | ✓ |
| [`fixtures/verify-strict-conformance/`](../fixtures/verify-strict-conformance/) | 1 | ✓ | — | — | — | ✓ | — |
Expand Down Expand Up @@ -82,7 +82,7 @@ and render ledgers; the api-contract runner's list of sub-corpora not built yet)
shrink, and the corpora without one assert each case outright. A new fixture that fails in
Rust and is not on the ledger prints a warning and does not fail the lane; it becomes a hard
failure when ADR-0065 turns the warning off. A regression still fails: the ledger's
`minPassing` (596) is the number of fixtures known to pass, and the run fails when fewer do.
`minPassing` (599) is the number of fixtures known to pass, and the run fails when fewer do.
Beside the corpora it runs the codegen-compile gate (below) with every shipped generator, a
scale gate over twenty copies of the fitness model, and `examples/rust-service/`'s HTTP test.
[The Rust port page](ports/rust.md#conformance) has the detail.
Expand Down Expand Up @@ -445,7 +445,7 @@ carry it, and a model that uses it fails there by name. There is no row per pack

## Fixture-to-doc mapping

### `fixtures/conformance/` — metamodel loader + canonical serializer (596)
### `fixtures/conformance/` — metamodel loader + canonical serializer (599)

| Fixture prefix | Feature doc |
|---|---|
Expand All @@ -468,7 +468,7 @@ carry it, and a model that uses it fails there by name. There is no row per pack
| `origin-*`, `error-origin-*` | [features/templates-and-payloads.md](features/templates-and-payloads.md) (payload origins) |
| `projection-*`, `error-projection-*`, `field-readonly-on-view-projection` | [features/source-kinds.md](features/source-kinds.md) (projections + the object taxonomy, ADR-0028) |
| `requirement-*`, `error-unknown-attr-requirement` | [features/requirements.md](features/requirements.md) (vocabulary only — the gate has its own corpus, `requirement-check-conformance/`; see "Split coverage" above) |
| `systems-vocabulary`, `error-ref-wrong-kind-runsas`, `error-ref-unresolved-runsas`, `error-resource-residency-bad-value`, `error-app-two-builds`, `error-app-three-builds`, `error-app-build-beside-inherited` | [spec/metamodel-definitions.md](../spec/metamodel-definitions.md) (the systems vocabulary, ADR-0070: the reference facet's two worked cases, the closed `@residency` set, and an app's one build, counting a build it inherits) |
| `systems-vocabulary`, `error-ref-wrong-kind-runsas`, `error-ref-unresolved-runsas`, `ref-target-type-list-heldby`, `error-ref-wrong-kind-heldby`, `error-ref-ambiguous-heldby`, `error-resource-residency-bad-value`, `error-app-two-builds`, `error-app-three-builds`, `error-app-build-beside-inherited` | [spec/metamodel-definitions.md](../spec/metamodel-definitions.md) (the systems vocabulary, ADR-0070: the reference facet's worked cases, including the target type list behind `@heldBy`, the closed `@residency` set, and an app's one build, counting a build it inherits) |
| `reporting-*`, `error-dimension-*`, `error-measure-*`, `error-ratio-*`, `error-segment-*`, `error-report-*`, `error-relative-date-*` | [features/reporting.md](features/reporting.md) (the `dimension` / `measure` / `segment` / `object.report` vocabulary and its load-time rules; design in the [FR-044 spec](superpowers/specs/2026-10-02-fr-044-core-reporting-design.md)) |
| `rules-*`, `error-rules-*` | [features/business-rules.md](features/business-rules.md) (operations, permission names and lifecycles: the vocabulary and its load-time rules, ADR-0066; the `verify` gate has its own corpus, `rules-check-conformance/`) |
| `provider-extension-*`, `provider-custom-vocabulary-*` | [features/extending-with-providers.md](features/extending-with-providers.md) (a project's own provider: a new subtype plus attributes on an existing type load with it and are refused without it, every port writing the provider in its own language) |
Expand Down Expand Up @@ -961,7 +961,7 @@ shared input.

## Orphaned fixtures (tested but not yet documented)

The fixtures in the nine corpora mapped above (metamodel 596 + yaml 19 + verify 45
The fixtures in the nine corpora mapped above (metamodel 599 + yaml 19 + verify 45
+ render 26 + persistence 68 + api-contract 191 + source-resolution 30 + scope 10 +
dependency 47) each map to a feature doc, and so do the two requirement corpora, `rules-check-conformance`, `shared-model-conformance`, the
`cube-model` corpus, `explorer-conformance` and `list-query-conformance`, whose case lists live in their own READMEs. None are orphaned today. The remaining
Expand Down
2 changes: 1 addition & 1 deletion docs/ports/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ outright.
| Corpus | Rust today |
|---|---|
| `registry-conformance` | byte-identical manifest |
| `conformance` (the metamodel corpus) | **596 of 596**, and the ledger is empty |
| `conformance` (the metamodel corpus) | **599 of 599**, and the ledger is empty |
| `yaml-conformance` | all 19, and the ledger is empty |
| `source-resolution-conformance` | all 30 cases |
| `reference-source-conformance` | all 6 cases: a `reference: true` source loads so references resolve against it, a node declared only in reference files is a reference node no generator emits, and a `template.*` declared only there is refused (`ERR_REFERENCE_SOURCE_TEMPLATE`) |
Expand Down
2 changes: 1 addition & 1 deletion examples/showcase/site-payload.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"metamodel": "1.4"
},
"counts": {
"fixtures": 596,
"fixtures": 599,
"corpora": 49,
"baseTypes": 27
},
Expand Down
4 changes: 2 additions & 2 deletions fixtures/conformance/ERROR-CODES.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"ERR_STORAGE_WITHOUT_OBJECT_REF": "@storage was set on a field that has no @objectRef.",
"ERR_OBJECT_FIELD_WITHOUT_OBJECT_REF": "ADR-0013: a field.object declares no @objectRef. A field.object models a typed nested value and REQUIRES @objectRef. The message states the whole ladder rather than only the escape hatch: a known key set is an object.value the field @objectRefs; dynamic keys over a known value type are a field.map (@objectRef for a value object, @valueType for a scalar); only a bag no reader pins a key in is @dbColumnType: jsonb on a field.string. Naming the escape hatch alone is what taught adopters to reach for the bag by default.",
"ERR_UNRESOLVED_OBJECT_REF": "ADR-0042: a field.object / field.map @objectRef does not resolve to any object in the loaded tree (a dangling target). The ref resolves package-locally when bare (referrer's package, else root-level) and exactly when FQN — a bare cross-package ref no longer binds elsewhere. The error names same-short-name objects in other packages so the author can qualify it.",
"ERR_REF_UNRESOLVED": "spec/metamodel-definitions.md: an attribute whose definition carries the reference facet (`ref`) names a node that resolves to nothing, by the typed lookup or by the untyped lookup the loader runs to choose its error. The default code when the facet names no `errorCode`.",
"ERR_REF_WRONG_KIND": "spec/metamodel-definitions.md: an attribute whose definition carries the reference facet (`ref`) names a node of another type than the facet's `targetType`, or a subtype outside its `targetSubTypes`. The default code when the facet names no `errorCode`.",
"ERR_REF_UNRESOLVED": "spec/metamodel-definitions.md: an attribute whose definition carries the reference facet (`ref`) names a node that resolves to nothing, by the typed lookup or by the untyped lookup the loader runs to choose its error, or names nodes of two of the facet's listed target types that share the name (ambiguous). The default code when the facet names no `errorCode`.",
"ERR_REF_WRONG_KIND": "spec/metamodel-definitions.md: an attribute whose definition carries the reference facet (`ref`) names a node of another type than the facet's `targetType` (or than every type in it, when it is a list), or a subtype outside its `targetSubTypes`. The default code when the facet names no `errorCode`.",
"ERR_RESERVED_ATTR": "An @-prefixed reserved structural keyword (e.g. @name, @isArray, @children) was used as an inline attribute.",
"ERR_SCOPE_PATTERN_INVALID": "Phase-1 metadata-source-resolution: a scope include/exclude package pattern is malformed (empty pattern or empty :: segment).",
"ERR_SOURCE_NO_PRIMARY": "An object declares source nodes but none has role=primary.",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"errors": [
{
"code": "ERR_REF_UNRESOLVED",
"source": {
"format": "json",
"files": [
"meta.parcels.json"
],
"jsonPath": "$['metadata.root'].children[0]['system.software'].children[0]['role.token']"
}
}
],
"warnings": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"metadata.root": {
"package": "acme::parcels",
"children": [
{
"system.software": {
"name": "Parcels",
"children": [
{ "role.token": { "name": "tidewellFeeds", "@heldBy": "acme::tidewell::Tidewell" } }
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"metadata.root": {
"package": "acme::tidewell",
"children": [
{ "organization.company": { "name": "Tidewell" } },
{ "system.software": { "name": "Tidewell" } }
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"errors": [
{
"code": "ERR_REF_WRONG_KIND",
"source": {
"format": "json",
"files": [
"meta.parcels.json"
],
"jsonPath": "$['metadata.root'].children[0]['system.software'].children[1]['role.token']"
}
}
],
"warnings": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"metadata.root": {
"package": "acme::parcels",
"children": [
{
"system.software": {
"name": "Parcels",
"children": [
{ "resource.rdb": { "name": "db" } },
{ "role.token": { "name": "exporter", "@heldBy": "db" } }
]
}
}
]
}
}
Loading
Loading