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/` (622 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/` (622 fixtures; 50 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
11 changes: 11 additions & 0 deletions changelog.d/systems-conformance-quillhaven.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- **A systems corpus: six repositories that read the same from every root (TypeScript runner).**
`fixtures/systems-conformance/quillhaven/` is the systems half of one fictional estate: a parcel
carrier, a payments provider, a vendor whose product the carrier deploys, and two partners that
publish no metadata, laid out as six repositories with their own `.metaobjects/config.json`,
dependency snapshots and locks. A runner checks that each published selection is exactly the
snapshot its consumers committed, and that every contract package publishes from its own file
alone; that each repository loads from its own root with only its own dependencies; that every
package is byte-identical whichever root loads it; and 22 cases (one a known gap the runner skips), each one change that raises a
loader code or, for a partner's stub replaced by its own package, leaves the model unchanged.
TypeScript runs it (`cli/test/systems-conformance.test.ts`); the other ports' runners follow.
Corpus only: no vocabulary or behaviour changed.
25 changes: 24 additions & 1 deletion docs/CONFORMANCE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Conformance coverage

The MetaObjects standard ships **49 shared conformance corpora** under
The MetaObjects standard ships **50 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 @@ -53,6 +53,7 @@ regenerate with `ls -d fixtures/<corpus>/*/ | wc -l` for directory-shaped corpor
| [`fixtures/scope-conformance/`](../fixtures/scope-conformance/) | 10 cases | ✓ (reference implementation) | ✓ | inherits via Java | ✓ | ✓ | ✓ (`scope_conformance.rs`) |
| [`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) | ✓ (resolution arm, all 36, ledger included, through the ledger's scan: no requirement gate yet, RS-V2; check arm, all 11, as `verify --deps`) |
| [`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`) | ✓ (all 15; `shared_model_conformance.rs`) |
| [`fixtures/systems-conformance/`](../fixtures/systems-conformance/) (ADR-0070: the Quillhaven systems half, six repositories loaded each from its own root) | 6 repositories, 7 publishes, 22 cases (1 known gap) | ✓ (reference implementation; `cli/test/systems-conformance.test.ts`) | planned (F1-java) | inherits via Java | planned (F1-cs) | planned (F1-py) | planned (F1-rs) |
| [`fixtures/agent-context-conformance/`](../fixtures/agent-context-conformance/) (the static agent files each port's `agent-docs` writes; every port runs all 6 stacks, not only its own) | 6 | ✓ (reference) | ✓ (`metaobjects:agent-docs`) | inherits via Java (the same Maven goal) | ✓ (`dotnet meta agent-docs`) | ✓ | ✓ (`cargo meta agent-docs`) |
| [`fixtures/agent-pages-pointer/`](../fixtures/agent-pages-pointer/) (the always-on agent file names the agent pages the last `gen` wrote, from the committed `.hashes/`) | 3 cases | ✓ (reference) | ✓ | inherits via Java | ✓ | ✓ | ✓ |
| [`fixtures/list-query-conformance/`](../fixtures/list-query-conformance/) (how a list route reads its query string: filter tree, search, sort, page, or the named 400) | 95 cases | ✓ (reference; the source of the expected answers) | planned (R-JV) | planned (R-KT) | ✓ (`ListQueryConformanceTests`) | planned (R-PY) | ✓ (`list_query_conformance.rs`, the parser `meta_http` ships) |
Expand Down Expand Up @@ -103,6 +104,7 @@ the contracts and the conformance corpora this repository runs against every por
`validation-conformance/`, `provider-composition-conformance/`,
`source-resolution-conformance/`, `scope-conformance/`, `dependency-conformance/`,
`shared-model-conformance/` (the artifact and manifest bytes a consumer verifies),
`systems-conformance/` (the systems half of one estate, read the same from every repository),
`object-model-conformance/`, `render-conformance/`, `template-codegen-conformance/` (the
Mustache engine), `template-output-render-conformance/`, `output-prompt-conformance/`,
`extract-conformance/`, `verify-conformance/`, `verify-strict-conformance/`,
Expand Down Expand Up @@ -754,6 +756,27 @@ only `KotlinSharedModelGeneratorTest`. **C# runs all 15**, in `SharedModelConfor
> recorded here rather than in a ledger, because ledgering a fixture the design intends to pass
> is how a port quietly stays behind.

### `fixtures/systems-conformance/` (6 repositories, 7 publishes, 22 cases, 1 a known gap)

→ [features/metadata-dependencies.md](features/metadata-dependencies.md) and
[ADR-0070](../spec/decisions/ADR-0070-systems-estates-and-apis.md). One fictional carrier, Quillhaven,
and the companies around it: six repositories of systems and contracts under `quillhaven/repos/`,
each with its own `.metaobjects/config.json`, committed dependency snapshots and lock. A port runs
four arms. **Publish**: each `publish.json` entry, built by the port's shared-model engine from its
own repository alone, is byte-identical to the snapshot every consumer committed, and to the lock
entry that pins it; the three contract packages (`…::api`) publish from their own file with nothing
beside them. **Reader**: each repository loads from its own root with only its own dependencies, to
`expected/<repo>.canonical.json`. **Packages**: each package, cut from every root that loads it,
is `expected/packages/<package>.json`, byte for byte. **Cases**: `cases.json` applies one change to
one repository and names the code the load raises, or the canonical form it still produces (the
stub of a company that publishes nothing gives way to that company's own package with no reference
changed). A case marked `knownGap` is one the design asks for and main does not do yet; a runner skips it and reports why. The estate half (locations, environments, deployments) is in the delivery pack, TypeScript
only (ADR-0069); whole-model `verify` rules join the cases with the rule hook. Format:
[the corpus README](../fixtures/systems-conformance/README.md).

**TypeScript runs all of it**, in `cli/test/systems-conformance.test.ts`; the other ports' runners
are planned.

### `fixtures/naming-conformance/` (8 cases + 23 collection segments)

`collection-segments.json` (23 cases) pins the REST collection segment from an object's
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 @@ -8,7 +8,7 @@
},
"counts": {
"fixtures": 622,
"corpora": 49,
"corpora": 50,
"baseTypes": 28
},
"snippets": {
Expand Down
118 changes: 118 additions & 0 deletions fixtures/systems-conformance/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# systems-conformance

Pins how the systems vocabulary of ADR-0070 reads across repositories: several companies'
systems and contracts, each repository loaded from its own root with only the dependencies it
declares, and every package reading the same whoever loads it. Every port's runner reads THESE
files; there is no per-port fixture.

One corpus today: [`quillhaven/`](quillhaven/README.md), the systems half of a fictional
parcel carrier's estate. Its estate half (locations, environments, deployments, provisions)
uses the delivery pack's vocabulary and lives with that pack, TypeScript only (ADR-0069).

## Shape

```
quillhaven/
├── README.md the cast, and which scenario is where
├── repos/<repo>/ one directory per repository, as it is on disk
│ ├── metaobjects/meta.*.yaml
│ └── .metaobjects/
│ ├── config.json its dependencies, by path
│ ├── deps.lock.json what `meta deps sync` wrote (absent with no dependencies)
│ └── deps/<name>/<name>.metaobjects.json the committed snapshot of each dependency
├── publish.json what each repository publishes, and from which files
├── artifacts/ a published package no repository depends on yet (used by cases)
├── expected/
│ ├── <repo>.canonical.json each repository loaded from its own root
│ └── packages/<package>.json each package, one file, whoever loaded it
└── cases.json one change to one repository, and what the load must do
```

A package's file name is its name with `::` written as `.` (`quillhaven.parcels.api.json`).

## The canonical form

Both expected forms are the **shared-document form** of the shared-model corpus
(`serializeSharedDocument` in TypeScript, and its twin in every port): a `metadata.root` with no
package, holding top-level nodes sorted by resolution key, each carrying its own `package`, every
reference written as its resolved key. `<repo>.canonical.json` holds every top-level node the
repository loads, its dependencies' included. `packages/<package>.json` holds the nodes of one
package. Sorting is what makes the first independent of the order a port loads its dependencies
and its own files in.

## The arms

A runner runs all four.

1. **Publish.** For each entry of `publish.json`, run the port's shared-model engine
(`input.name` = `name`, `files` resolved under `repos/<repo>/`, `include`, `version`). The
artifact must be byte-identical to `repos/<consumer>/.metaobjects/deps/<name>/<name>.metaobjects.json`
in every repository whose `config.json` names that dependency, and that consumer's lock entry
for it must be exactly: `version`; `metamodelVersion` = the port's own constant; `artifact`;
`integrity` = `sha256-` and the artifact's hex digest; `packages` and `nodes` read off the
artifact, sorted; `resolvedFrom.path` = the consumer's declared `path`. An entry no repository
depends on must equal `artifacts/<name>.metaobjects.json`. Then load each artifact alone, as
the only metadata file of an empty project: it loads, and serializes back to its own bytes.
The three `…::api` entries are the contract packages; each publishes from its own file and
needs nothing beside it, which is how two systems that call each other avoid importing each
other.
2. **Reader.** Load each repository from its own root (its `config.json`, lock and snapshots,
exactly as a project loads). It loads with no error and serializes to
`expected/<repo>.canonical.json`.
3. **Packages.** Group each repository's top-level nodes by package and serialize each group.
Every group equals `expected/packages/<package>.json`, from every root that loads the
package, and every file under `expected/packages/` is produced by at least one root.
4. **Cases.** For each entry of `cases.json`: copy `repos/` to a scratch directory, apply
`changes` in order to `repos/<repo>/`, load that repository from its own root, and assert
`expectError` (the load fails with that code) or `expectCanonical` (it loads, and serializes
to that corpus file, byte for byte). The message text is not the contract; the code is.

The publisher's `path` (`../<repo>/shared`) is never read: the arms load committed snapshots,
as a project does between syncs. The dependency corpus's check arm is not run here.

## Case schema

```jsonc
{ "cases": [ {
"name": "…", // kebab-case, the contract
"about": "…", // OPTIONAL prose
"repo": "quillhaven-parcels", // the repository loaded
"stage": "load", // which tool must raise it: "load" is every port's loader
"changes": [ … ], // usually one; see below
"expectError": "ERR_*", // or
"expectCanonical": "expected/<repo>.canonical.json",
"knownGap": "…" // OPTIONAL: the design asks for this and main does not do it yet;
// a runner skips the case and reports the reason
} ] }
```

A runner fails on a stage it does not know rather than skipping it. Whole-model rules
(`ERR_API_NOT_CARRIED`, `ERR_API_NO_PROVIDER`, the extract chain) will join as `"stage": "verify"`
with the rule hook that raises them.

### Changes

Every change is relative to the repository. A `node` is the list of steps from the document
root (`metadata.children`) down to the node, each step one of:

- `type.subType:name` — the child with that key and `name`;
- `type.subType#n` — the n-th child (from 0) with that key, for the unnamed (a grant, a binding).

| `op` | Fields | Does |
|---|---|---|
| `set` | `file`, `node`, `attr`, `value` | sets the node's attribute (YAML authoring form: no `@`) |
| `unset` | `file`, `node`, `attr` | removes the attribute; it must be present |
| `addChild` | `file`, `node`, `child` | appends `child` (one `{ "type.subType": { … } }` entry) to the node's children |
| `removeNode` | `file`, `node` | removes the node |
| `deleteFile` | `file` | deletes the file |
| `addDependency` | `dependency` (`name`, `path`), `artifact` | appends the dependency to `config.json`, copies the corpus `artifact` to `.metaobjects/deps/<name>/<name>.metaobjects.json`, and adds its lock entry as the publish arm defines it (`version` `1.0.0`, keys sorted) |

A runner parses the YAML file, edits the document, and writes it back to the same path as JSON
text, which every YAML reader accepts.

## Which ports run it

- **TypeScript** — all four arms (`server/typescript/packages/cli/test/systems-conformance.test.ts`).
`UPDATE_SYSTEMS_CONFORMANCE=1` rewrites the snapshots, locks, `artifacts/` and `expected/` from
the engine instead of comparing; review that diff, because it is the contract.
- **C#, Java (Kotlin inherits), Python, Rust** — planned, one runner each over the same files.
Loading
Loading