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/` (584 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/` (589 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.2.0`** — 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.2.0`** — 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.2.0`** — 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; 584 / 584 metamodel conformance; prompt render and the reply parser (`metaobjects-render`); `cargo meta init` / `gen` / `verify` / `eject` with eleven 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; 589 / 589 metamodel conformance; prompt render and the reply parser (`metaobjects-render`); `cargo meta init` / `gen` / `verify` / `eject` with eleven 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
13 changes: 13 additions & 0 deletions changelog.d/origin-parent-relative-paths.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- **Origin paths accept parent-relative references in every port.** An origin's `@from`, `@of`
or `@via` written `..::Entity.field` (ADR-0059 sections 2 and 4) was refused with
`ERR_INVALID_ORIGIN` because the loaders cut the value at its first `.`, inside the `..::`
prefix. The TypeScript, C#, Java (and so Kotlin), Python and Rust loaders now split it where
ADR-0059 says, at the first `.` after the last `::`, and resolve it exactly as the qualified
`pkg::Entity.field` form. The new conformance fixture `origin-parent-relative-refs` loads to the
same model as its `pkg::` twin, and `error-origin-parent-relative-unresolved` and
`error-origin-parent-relative-wrong-kind` keep the existing `ERR_INVALID_ORIGIN` refusals. A
`..::` origin path that climbs above the root package is `ERR_BAD_ATTR_VALUE`, the code every
other reference uses for that case (`error-origin-parent-relative-over-drop`). No registry,
manifest or generated output changes. Java (and so Kotlin) now refuses a trailing-dot `@via`
(such as `acme::Week.days.`) with `ERR_INVALID_ORIGIN`, like the other ports, and reports one
error per broken origin instead of only the first (`error-origin-via-trailing-dot`).
8 changes: 4 additions & 4 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) | 584 | ✓ | ✓ | inherits via `metadata-ktx` | ✓ | ✓ | ✓ (584 / 584, empty ledger) |
| [`fixtures/conformance/`](../fixtures/conformance/) (metamodel) | 589 | ✓ | ✓ | inherits via `metadata-ktx` | ✓ | ✓ | ✓ (589 / 589, 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` (584) is the number of fixtures known to pass, and the run fails when fewer do.
`minPassing` (589) 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 (584)
### `fixtures/conformance/` — metamodel loader + canonical serializer (589)

| Fixture prefix | Feature doc |
|---|---|
Expand Down Expand Up @@ -951,7 +951,7 @@ shared input.

## Orphaned fixtures (tested but not yet documented)

The fixtures in the nine corpora mapped above (metamodel 584 + yaml 19 + verify 45
The fixtures in the nine corpora mapped above (metamodel 589 + 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
5 changes: 5 additions & 0 deletions docs/features/templates-and-payloads.md
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,11 @@ for payload typing per #270)
- [`fixtures/conformance/origin-aggregate-sum/`](../../fixtures/conformance/origin-aggregate-sum/) — `origin.aggregate @agg=sum`
- [`fixtures/conformance/origin-multi-level-via/`](../../fixtures/conformance/origin-multi-level-via/) — dotted-path `@via` traversal across hops
- [`fixtures/conformance/error-origin-bad-via-path/`](../../fixtures/conformance/error-origin-bad-via-path/) — unresolvable `@via` rejected
- [`fixtures/conformance/origin-parent-relative-refs/`](../../fixtures/conformance/origin-parent-relative-refs/) — `@from`, `@of` and `@via` written `..::Entity.member` (ADR-0059 §2) load to the same model as their `pkg::` twin
- [`fixtures/conformance/error-origin-parent-relative-unresolved/`](../../fixtures/conformance/error-origin-parent-relative-unresolved/) — a `..::` `@from` naming no entity is `ERR_INVALID_ORIGIN`
- [`fixtures/conformance/error-origin-parent-relative-wrong-kind/`](../../fixtures/conformance/error-origin-parent-relative-wrong-kind/) — a `..::` `@via` whose hop names a field, not a relationship or reference, is `ERR_INVALID_ORIGIN`
- [`fixtures/conformance/error-origin-parent-relative-over-drop/`](../../fixtures/conformance/error-origin-parent-relative-over-drop/) — a `..::` path with more parent steps than the referrer's package has segments is `ERR_BAD_ATTR_VALUE` (ADR-0059 §2)
- [`fixtures/conformance/error-origin-via-trailing-dot/`](../../fixtures/conformance/error-origin-via-trailing-dot/) — a `@via` ending in `.`, written `..::` or `pkg::`, is `ERR_INVALID_ORIGIN`, one error per origin
- [`fixtures/conformance/error-origin-bad-aggregate-fn/`](../../fixtures/conformance/error-origin-bad-aggregate-fn/) — unknown `@agg` rejected
- [`fixtures/conformance/error-origin-passthrough-type-mismatch/`](../../fixtures/conformance/error-origin-passthrough-type-mismatch/) — a `passthrough` field whose `field.<subType>` differs from its `@from` source fails with `ERR_PASSTHROUGH_TYPE_MISMATCH`
- [`fixtures/conformance/error-origin-passthrough-array-mismatch/`](../../fixtures/conformance/error-origin-passthrough-array-mismatch/) — a `passthrough` field whose array-ness differs from its `@from` source fails with `ERR_PASSTHROUGH_TYPE_MISMATCH`
Expand Down
2 changes: 1 addition & 1 deletion docs/ports/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ outright.
| Corpus | Rust today |
|---|---|
| `registry-conformance` | byte-identical manifest |
| `conformance` (the metamodel corpus) | **584 of 584**, and the ledger is empty |
| `conformance` (the metamodel corpus) | **589 of 589**, 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.3"
},
"counts": {
"fixtures": 584,
"fixtures": 589,
"corpora": 49,
"baseTypes": 21
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"errors": [
{
"code": "ERR_BAD_ATTR_VALUE",
"source": {
"format": "resolved",
"files": [
"meta.shop.json"
],
"jsonPath": "$['metadata.root'].children[0]['object.projection'].children[3]['field.string'].children[0]['origin.passthrough']",
"referrer": "ProgramSummary::title",
"target": "..::..::..::Program.title"
}
}
],
"warnings": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"metadata.root": {
"package": "acme",
"children": [
{
"object.entity": {
"name": "Program",
"children": [
{
"source.rdb": {
"@table": "programs"
}
},
{
"field.long": {
"name": "id"
}
},
{
"field.string": {
"name": "title"
}
},
{
"identity.primary": {
"name": "pk",
"@fields": [
"id"
]
}
},
{
"relationship.composition": {
"name": "weeks",
"@objectRef": "Week",
"@cardinality": "many"
}
}
]
}
},
{
"object.entity": {
"name": "Week",
"children": [
{
"source.rdb": {
"@table": "weeks"
}
},
{
"field.long": {
"name": "id"
}
},
{
"field.long": {
"name": "programId"
}
},
{
"identity.primary": {
"name": "pk",
"@fields": [
"id"
]
}
},
{
"identity.reference": {
"name": "program",
"@fields": [
"programId"
],
"@references": "Program.id"
}
}
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"metadata.root": {
"package": "acme::shop",
"children": [
{
"object.projection": {
"name": "ProgramSummary",
"children": [
{
"source.rdb": {
"@kind": "view",
"@view": "v_program_summary"
}
},
{
"field.long": {
"name": "id",
"extends": "acme::Program.id"
}
},
{
"identity.primary": {
"name": "pk",
"extends": "acme::Program.pk"
}
},
{
"field.string": {
"name": "title",
"children": [
{
"origin.passthrough": {
"@from": "..::..::..::Program.title"
}
}
]
}
},
{
"field.long": {
"name": "weekCount",
"children": [
{
"origin.aggregate": {
"@agg": "count",
"@of": "..::Week.id",
"@via": "..::Program.weeks"
}
}
]
}
}
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["metaobjects-core-types","metaobjects-db"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"errors": [
{
"code": "ERR_INVALID_ORIGIN",
"source": {
"format": "resolved",
"files": [
"meta.shop.json"
],
"jsonPath": "$['metadata.root'].children[0]['object.projection'].children[3]['field.string'].children[0]['origin.passthrough']",
"referrer": "ProgramSummary::title",
"target": "..::Course.title"
}
}
],
"warnings": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"metadata.root": {
"package": "acme",
"children": [
{
"object.entity": {
"name": "Program",
"children": [
{
"source.rdb": {
"@table": "programs"
}
},
{
"field.long": {
"name": "id"
}
},
{
"field.string": {
"name": "title"
}
},
{
"identity.primary": {
"name": "pk",
"@fields": [
"id"
]
}
},
{
"relationship.composition": {
"name": "weeks",
"@objectRef": "Week",
"@cardinality": "many"
}
}
]
}
},
{
"object.entity": {
"name": "Week",
"children": [
{
"source.rdb": {
"@table": "weeks"
}
},
{
"field.long": {
"name": "id"
}
},
{
"field.long": {
"name": "programId"
}
},
{
"identity.primary": {
"name": "pk",
"@fields": [
"id"
]
}
},
{
"identity.reference": {
"name": "program",
"@fields": [
"programId"
],
"@references": "Program.id"
}
}
]
}
}
]
}
}
Loading
Loading