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` (KotlinPoet on 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; 46 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/` (584 fixtures; 48 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 byte-identical; C# and Rust each carry a `KnownDrift` render ledger, recorded in `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** (TS owns schema migrations). **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
9 changes: 9 additions & 0 deletions changelog.d/metadata-reference-sources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- **Reference sources: name a prompt's reply type that another run generates.** A `sources`
entry may carry `"reference": true` (Maven: `<loader><referenceSources>`). Its files load into
the same tree, so a prompt's `@responseRef` (and any other reference) resolves against them,
and no generator emits a type for a node declared only there. The prompt keeps its parser,
output-format fragment and extractor, naming the reply type the other run generates. Before
this, a reply type owned by another generator run could not be named at all (the load
refused the unresolved `@responseRef`), and merging its files into the prompt's tree generated
every reply type a second time. A `template.*` declared only in a reference source is refused
(`ERR_REFERENCE_SOURCE_TEMPLATE`). Every port, pinned by `fixtures/reference-source-conformance/`.
10 changes: 10 additions & 0 deletions changelog.d/rust-verify-templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- **Rust: `cargo meta verify --templates`, the template drift gate.** It checks every `template.*`
body (and its partials) against the payload value object it renders over
(`ERR_VAR_NOT_ON_PAYLOAD`, `ERR_PARTIAL_UNRESOLVED`, `ERR_OUTPUT_TAG_MISSING`,
`ERR_REQUIRED_SLOT_UNUSED`, `ERR_TEMPLATE_SYNTAX`) and each prompt's reply, reading
`@payloadRef`, `@textRef`, `@requiredTags` and `@responseRef` through `extends`. Bodies live
under `prompts/` (`--prompts <dir>` to move it), and a bare `verify` runs the gate beside the
codegen and rules gates. The `metaobjects-render` crate gains `verify`, held to
`fixtures/verify-conformance/` (all 45 cases). A Jinja body is refused
(`ERR_TEMPLATE_ENGINE_UNSUPPORTED`): the Rust renderer runs Mustache only. The old refusal
of `--templates` is gone.
5 changes: 5 additions & 0 deletions changelog.d/verify-templates-reads-response-ref.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- **The template check reads `@responseRef`.** `verify`'s template gate now reports
`ERR_RESPONSE_UNRESOLVED` (error) for a reply type with no readable field, and
`ERR_RESPONSE_TAG_UNDECLARED` (warning) for an xml prompt's `@requiredTags` tag that names
neither the reply type nor a field in it. TypeScript, Java (and so Kotlin), C#, Python and
Rust, pinned by `fixtures/response-verify-conformance/`.
48 changes: 37 additions & 11 deletions docs/CONFORMANCE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Conformance coverage

The MetaObjects standard ships **46 shared conformance corpora** under
The MetaObjects standard ships **48 shared conformance corpora** under
[`fixtures/`](../fixtures/). Every port runs every corpus that is *applicable to
it* and asserts the same expected behaviour against the same fixtures. **This page
is the inverse index**: fixture → feature doc + per-port pass status, and it is the
Expand Down Expand Up @@ -47,7 +47,9 @@ regenerate with `ls -d fixtures/<corpus>/*/ | wc -l` for directory-shaped corpor
| [`fixtures/template-output-render-conformance/`](../fixtures/template-output-render-conformance/) | 5 | ✓ | ✓ | ✓ | ✓ | ✓ |
| [`fixtures/generator-registry-conformance/`](../fixtures/generator-registry-conformance/) | 1 canonical manifest | ✓ | ✓ | ✓ | ✓ | ✓ |
| [`fixtures/provider-composition-conformance/`](../fixtures/provider-composition-conformance/) | 18 (11 error-shape + 4 compose-load + 3 attr-ownership) | ✓ | ✓ | — (JVM registry via Java) | ✓ | ✓ |
| [`fixtures/source-resolution-conformance/`](../fixtures/source-resolution-conformance/) | 28 cases | ✓ (reference implementation) | ✓ | inherits via Java | ✓ | ✓ |
| [`fixtures/source-resolution-conformance/`](../fixtures/source-resolution-conformance/) | 30 cases | ✓ (reference implementation) | ✓ | inherits via Java | ✓ | ✓ |
| [`fixtures/reference-source-conformance/`](../fixtures/reference-source-conformance/) | 6 cases | ✓ (reference implementation) | ✓ | inherits via Java (plus its own codegen exclusion test) | ✓ | ✓ |
| [`fixtures/response-verify-conformance/`](../fixtures/response-verify-conformance/) | 7 cases | ✓ (reference implementation) | ✓ | inherits via Java | ✓ | ✓ |
| [`fixtures/scope-conformance/`](../fixtures/scope-conformance/) | 10 cases | ✓ (reference implementation) | ✓ | inherits via Java | ✓ | ✓ |
| [`fixtures/dependency-conformance/`](../fixtures/dependency-conformance/) | 47 cases (36 resolution, 7 of them with a ledger arm, + 11 check) + 32 transport cases | ✓ (reference implementation; all four arms) | ✓ (resolution arm, all 36, ledger included; check arm, all 11) | inherits via Java | ✓ (resolution arm, all 36, ledger included; check arm, all 11, as `verify --deps`) | ✓ (resolution arm, all 36 identically, ledger included; check arm, all 11, as `deps check` and `verify --deps`; the transport arm is Node-only) |
| [`fixtures/shared-model-conformance/`](../fixtures/shared-model-conformance/) | 15 cases (9 publish + 6 refusal) | ✓ (reference implementation) | ✓ (all 15; `SharedModelConformanceTest`) | inherits via Java (`KotlinSharedModelGeneratorTest` pins the generator) | ✓ (all 15; `SharedModelConformanceTests`) | ✓ (all 15; `test_shared_model_conformance.py`) |
Expand Down Expand Up @@ -80,13 +82,15 @@ green, with every validation pass the TypeScript loader runs, in the same order,
`rules-check-conformance` (all 16 cases, the `verify` business-rules gate);
`yaml-conformance`, 18 of 19 (the one on `yaml-conformance-expected-failures.json`,
`yaml-ref-root-escape`, waits for the ADR-0059 root-level `::` reference rules, which are
reference resolution, not a validation pass); `source-resolution-conformance` (all 28
cases); `naming-conformance` (all of it); `codegen-skip-conformance` (ADR-0064), on both its
reference resolution, not a validation pass); `source-resolution-conformance` (all 30
cases); `reference-source-conformance` (all 6 cases); `naming-conformance` (all of it); `codegen-skip-conformance` (ADR-0064), on both its
`gen` and its `verify` columns, for every case the port can meet (the three it cannot, two
about templates and one about the three-way merge, are named with their reason in its
runner); `validation-conformance`, every case, through the generated `validate()`;
`decimal-wire` and `duration-wire`, every vector, against the code the generated support
crate carries; `render-conformance`, every case but the three ledgered below (`mustache-ng` has its own name lookup, data model and truthiness), `extract-conformance`, all 58
crate carries; `render-conformance`, every case but the three ledgered below (`mustache-ng` has its own name lookup, data model and truthiness), `verify-conformance`, all 45
cases, and `response-verify-conformance`, all 7 (the template gate, `verify --templates`),
`extract-conformance`, all 58
cases, and `output-prompt-conformance`, all 17 in all three styles with the round trip, in the
`metaobjects-render` crate; the `core` cases of `writer-conformance` (ADR-0063); and
`generator-registry-conformance`, with the eject contract's census, completeness and depth
Expand Down Expand Up @@ -426,7 +430,7 @@ Per-port runners + commands:
| Kotlin | `cd server/java && mvn -pl codegen-kotlin test` (snapshot suite) | `mvn -f server/java/integration-tests-kotlin/pom.xml test` (needs Docker) | `mvn -f server/java/integration-tests-kotlin/pom.xml test -Dtest=ApiContractConformanceTest` (needs Docker) |
| C# | `dotnet test` (per project) | `scripts/integration-test.sh csharp` (needs Docker) | `dotnet test server/csharp/MetaObjects.IntegrationTests/MetaObjects.IntegrationTests.csproj --filter "FullyQualifiedName~ApiContractConformanceTest"` (needs Docker) |
| Python | `pytest` (per package) | `scripts/integration-test.sh python` (needs Docker) | `cd server/python && uv run --extra integration pytest tests/integration/test_api_contract.py` (needs Docker) |
| Rust | `cd server/rust && cargo test` (registry, metamodel, YAML, source-resolution, naming, skip, validation, wire-vector, writer, generator-registry, render, extract and output-prompt corpora; the codegen-compile and scale gates, which run `cargo check` on generated crates and drive the generated client over HTTP against a local stub) | — | — |
| Rust | `cd server/rust && cargo test` (registry, metamodel, YAML, source-resolution, reference-source, naming, skip, validation, wire-vector, writer, generator-registry, render, verify, response-verify, extract and output-prompt corpora, and the `verify --templates` CLI test; the codegen-compile and scale gates, which run `cargo check` on generated crates and drive the generated client over HTTP against a local stub) | — | — |

The `persistence-conformance` corpus is intentionally **on-demand** — none of the
unit-test runners (`bun test`, `dotnet test`, `pytest`, `mvn test`) pull Docker.
Expand Down Expand Up @@ -510,9 +514,9 @@ The verify corpus reuses `verify-conformance/`'s `payload.json` field-tree shape
`ERR_TEMPLATE_SYNTAX` finding's path is the parser's own message, so runners compare it as
empty.

### `fixtures/verify-conformance/` (37)
### `fixtures/verify-conformance/` (45)

All 37 fixtures → [features/migrations-and-drift.md](features/migrations-and-drift.md)
All 45 fixtures → [features/migrations-and-drift.md](features/migrations-and-drift.md)
(template drift section — `Renderer.verify`). A node of a fixture's `payload.json` field tree
may carry `"isArray": true`; with `fields` it is a list of objects, without it a list of
scalars. The six `verify-positional-accessor-*` cases pin where `-last` is available.
Expand Down Expand Up @@ -578,9 +582,9 @@ that reads real views, so it runs full stack on Postgres, SQLite and MySQL
port, and on D1's local runtime in TypeScript. The `decimal/` sub-corpus does the same over
decimal columns.

### `fixtures/source-resolution-conformance/` (28 cases)
### `fixtures/source-resolution-conformance/` (30 cases)

All 28 cases → [features/metadata-sources.md](features/metadata-sources.md) (how a
All 30 cases → [features/metadata-sources.md](features/metadata-sources.md) (how a
declared `sources` set resolves to a file list). Companion to
`scope-conformance/` below — `sources` decides which files are read, `scope`
filters what is emitted from them. The corpus is file-shaped: one committed
Expand All @@ -603,6 +607,28 @@ the same Maven plugin as Java):
`server/python/tests/conformance/test_source_resolution_conformance.py`, and
`server/java/metadata/src/test/java/com/metaobjects/config/SourceResolutionConformanceTest.java`.

### `fixtures/reference-source-conformance/` (6 cases)

All 6 cases → [features/metadata-sources.md](features/metadata-sources.md#reference-sources--loaded-to-resolve-against-never-generated).
A `sources` entry with `"reference": true` loads its files into the same tree, so a
prompt's `@responseRef` resolves against them, and its nodes are excluded from every
generator. The corpus pins the reference-node SET (every declaring file a reference file;
an ordinary declaration or an ordinary spec reaching the same file wins) and the refusal of
a reference-only template (`ERR_REFERENCE_SOURCE_TEMPLATE`). Runners:
`server/typescript/packages/sdk/test/reference-source-conformance.test.ts`, C#
`ReferenceSourceConformanceTests`, Java `ReferenceSourceConformanceTest` (Kotlin through the
same loader), Python `test_reference_source_conformance.py` and Rust
`metaobjects/tests/reference_source_conformance.rs`. That codegen emits no type for a
reference node while a local prompt's parser still emits is proven by a per-port codegen test
(TypeScript, C#, Java, Kotlin and Python; Rust, which emits no prompt code, proves the exclusion alone).

### `fixtures/response-verify-conformance/` (7 cases)

All 7 cases → [features/templates-and-payloads.md](features/templates-and-payloads.md#drift-detection-verify).
What the template gate reports about a prompt's reply: `ERR_RESPONSE_UNRESOLVED` and, for an
xml prompt, `ERR_RESPONSE_TAG_UNDECLARED`. Run by TypeScript, C#, Java (Kotlin through the
same Maven goal), Python and Rust (`server/rust/metaobjects-cli/tests/response_verify_conformance.rs`).

### `fixtures/scope-conformance/` (10 cases)

All 10 cases → [features/metadata-sources.md](features/metadata-sources.md) (the
Expand Down Expand Up @@ -882,7 +908,7 @@ JSON and verify payload feeds it unchanged.
## Orphaned fixtures (tested but not yet documented)

The fixtures in the nine corpora mapped above (metamodel 584 + yaml 19 + verify 45
+ render 26 + persistence 68 + api-contract 179 + source-resolution 28 + scope 10 +
+ render 26 + persistence 68 + api-contract 179 + 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
corpora in the totals table gate tooling contracts (registry manifests, provider
Expand Down
Loading
Loading