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
54 changes: 41 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@ here.**
(the conformance ledger is empty and may only shrink).
While the port is in preview, a new fixture that fails in Rust and is not on the ledger prints a
warning and does not fail the lane; a fixture that passed and regresses still fails it, because
the ledger records how many fixtures must pass. Nothing is published and there is no codegen
or `cargo meta` command yet. Every load records how long each phase and each validation pass
took (`LoadResult::timings`; the `validate` module's ordered pass list holds the ported passes in
reference order), and `load_bench` prints the per-phase and per-pass medians, with
`--write-baseline` / `--baseline` to record and compare a run — a baseline is a record to
read, never a threshold, and the committed 20x baseline is a machine-local reference. A
`rust` lane runs `cargo fmt --check`, clippy, the tests and the `load_bench` table (record
only, printed without a baseline delta — a cross-machine delta measures the machine, not the
change) in `scripts/ci-local.sh --only rust`, `pr-ci` and `local-ci`, selected by changes
under `server/rust/`.
the ledger records how many fixtures must pass. Nothing is published. Every load records how
long each phase and each validation pass took (`LoadResult::timings`; the `validate` module's
ordered pass list holds the ported passes in reference order), and `load_bench` prints the
per-phase and per-pass medians, with `--write-baseline` / `--baseline` to record and compare a
run — a baseline is a record to read, never a threshold, and the committed 20x baseline is a
machine-local reference. A `rust` lane runs `cargo fmt --check`, clippy, the tests, and the
`load_bench` and `gen_bench` tables (record only, printed without a baseline delta — a
cross-machine delta measures the machine, not the change) in `scripts/ci-local.sh --only rust`,
`pr-ci` and `local-ci`, selected by changes under `server/rust/`.
- **Rust port reads a real project, in preview.** The loader now reads YAML authoring files
(ADR-0006: bare type keys, scalar-body names, the `[]` suffix, sigil-free attributes, anchors and
aliases, the `ERR_YAML_COERCION` guard, and a line and column on every error from a YAML file),
Expand All @@ -41,17 +40,46 @@ here.**
`iam` and `ai` library sources embedded in the crate, and the naming strategies, pluralizers and
collection-name collision check. It passes `yaml-conformance` 18 of 19, and the
`source-resolution-conformance` and `naming-conformance` corpora in full. Nothing is published.
- **Rust port generates code, in preview: `cargo meta gen` and the `entity` generator.** Two new
workspace crates. `metaobjects-codegen` holds the run engine and the generator; `metaobjects-cli`
builds the binary `cargo-meta`, so cargo's external-subcommand rule makes `cargo meta gen` work
(`cargo-meta gen` too). The run engine follows ADR-0064 and keeps the other ports' manifest
format: it writes a generated file only when its bytes changed, saves
`.metaobjects/.gen-state/.hashes.json` once per run and only when a record changed, and skips the
whole run (nothing rendered, nothing written, not even the manifest) when the model hash tree, the
project config, the engine's built code, each generator's identity and the flags match the stored
key in `.fingerprint-rust.json` and every recorded output is still as the last run left it. The
shared `fixtures/codegen-skip-conformance` corpus runs against it: every case the port can meet
runs, and the ones it cannot (templates, ejected generators, `verify`, a kept hand edit) are named
with the reason. The `entity` generator writes one crate per metadata package: serde structs for
`object.entity` and `object.value` (inherited fields included, optional fields as `Option`, arrays
as `Vec`, a map as `BTreeMap`), enums for `field.enum` (shared enums once, in their declaration's
package) with the member symbols as the wire form, `Box` only where a by-value cycle needs it, and
a path dependency for each cross-package reference. The output is already rustfmt-clean under the
`rustfmt.toml` written beside it, so no formatter runs in the hot path. Tests: a golden test of a
two-package model's text, a test that generates that model and the fitness model and runs `cargo
check`, `rustfmt --check` and a serde round trip on the crates, and the run-engine, skip-corpus
and CLI suites. `gen_bench` prints time per stage (load, plan, skip, render, write) for a first
run, an unchanged run, a one-file change and a forced run on the 20x fitness project, record only,
and the `rust` lane prints it. Where Rust differs from the other ports, on purpose: there is no
three-way merge, so a generated file edited by hand (or an existing file nobody recorded) is
refused and the run exits 1 after finishing the other files, as Python does; the output directory
must be a sub-directory of the project (the project root itself is refused), so every manifest key
is project-relative; a named run (`cargo meta gen Order`) never skips and regenerates every file
of the crates that contain the named objects, plus the transitive closure of the crates those
depend on, rather than merging; and there is no `verify`, `eject`, template or client generator
yet. Relationships, projections and reports are not emitted. Nothing is published.

- **Cross-port stage benchmark and Rust port documentation.** `scripts/bench-load/stages.py` runs
every port (TypeScript, Python, C#, Java, Kotlin, Rust) over the same model, stage by stage: load
and validate, a no-change generation run, a full generation and a one-entity-edit regeneration,
each as the median of N runs with peak memory, into one `report.json` and one Markdown table. It
never gates on a number. The Rust generation stages read "not available yet" until `cargo meta gen`
exists and are picked up on their own once it does. `--project <path> --out <dir>` runs it on a
never gates on a number. The Rust generation stages read "not available yet" until a `cargo-meta`
binary is built or installed and are picked up on their own once it is. `--project <path> --out <dir>` runs it on a
private project, copies the metadata, and refuses an output inside the repository. `load_bench`
gained `--dir` and `--json`, `gen-model.py` gained `--unique-names`, and Java has a warm-load
driver. New page `docs/ports/rust.md` says what the preview Rust port does and does not do, how
to build and test it, and the planned `cargo meta` command; the crates.io name `cargo-meta` is
to build and test it, and the preview scope of `cargo meta`; the crates.io name `cargo-meta` is
held by an unrelated crate, so the CLI crate will publish under another name that installs a
`cargo-meta` binary (a plan, not a promise). Nothing is published.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,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 are TS-owned (ADR-0015) | [`docs/ports/python.md`](docs/ports/python.md) | [`server/python/`](server/python/) |
| Rust | **Preview, unpublished** — loader (JSON + YAML), project and source resolution, naming and all 40 validation passes; 526 / 526 metamodel conformance. No codegen and no `cargo meta` yet (ADR-0065) | [`docs/ports/rust.md`](docs/ports/rust.md) | [`server/rust/`](server/rust/) |
| Rust | **Preview, unpublished** — loader (JSON + YAML), project and source resolution, naming and all 40 validation passes; 526 / 526 metamodel conformance; `cargo meta gen` with the `entity` generator only (ADR-0065) | [`docs/ports/rust.md`](docs/ports/rust.md) | [`server/rust/`](server/rust/) |

## Capability matrix

Expand Down Expand Up @@ -331,7 +331,7 @@ metaobjects/
│ ├── java/ # Java port (incl. codegen-kotlin + metadata-ktx)
│ ├── csharp/ # C# port
│ ├── python/ # Python port
│ └── rust/ # Rust port (preview, ADR-0065 — unpublished; no codegen yet)
│ └── rust/ # Rust port (preview, ADR-0065 — unpublished; entity generator only)
│
└── client/
└── web/ # universal browser packages (React, TanStack, Angular, framework-agnostic)
Expand Down
14 changes: 8 additions & 6 deletions docs/CONFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,19 @@ regenerate with `ls -d fixtures/<corpus>/*/ | wc -l` for directory-shaped corpor
| [`fixtures/contract-conformance/`](../fixtures/contract-conformance/) (FR-022 — the `contract-schema` and `openapi` generators' golden trees and refusals) | 19 cases (14 trees + 5 errors) | ✓ (one neutral engine, ADR-0034 Amendment 10; the generated API lanes also hold real traffic to the documents) | — | — | — | — |
| [`fixtures/explorer-conformance/`](../fixtures/explorer-conformance/) (the `explorer.json` data spine: `meta export --effective` + `meta verify --format json` + the generated-file manifest in, one explorer document out) | 1 case (`shop`) | ✓ (the builder is TypeScript, and reads only port-neutral inputs) | — | — | — | — |

**Rust (preview, ADR-0065) is not a column yet.** The sixth port runs five corpora
**Rust (preview, ADR-0065) is not a column yet.** The sixth port runs six corpora
today: `registry-conformance` (byte-identical manifest); the metamodel corpus, all 526
green, with every validation pass the TypeScript loader runs, in the same order, so
`server/rust/metaobjects/tests/conformance-expected-failures.json` is empty;
`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); and `naming-conformance` (all of it). Those ledgers may only shrink. While the
port is in preview, 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 the port leaves
preview. A regression still fails: the ledger's `minPassing` (526) is the number of
cases); `naming-conformance` (all of it); and `codegen-skip-conformance` (ADR-0064), for the
cases its `gen` can meet (the rest are named with their reason in its runner). The ledgers
above may only shrink; the skip corpus has none, because each case it runs asserts its result
outright. While the port is in preview, 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 the port
leaves preview. A regression still fails: the ledger's `minPassing` (526) is the number of
fixtures known to pass, and the run fails when fewer do. The column joins this table when
the port leaves preview.

Expand Down Expand Up @@ -397,7 +399,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 (preview) | `cd server/rust && cargo test` (registry, metamodel, YAML, source-resolution and naming corpora) | — | — |
| Rust (preview) | `cd server/rust && cargo test` (registry, metamodel, YAML, source-resolution and naming corpora; the codegen suites, which run `cargo check` on generated crates) | — | — |

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
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ docs/
├── kotlin.md
├── csharp.md
├── python.md
└── rust.md # the Rust port, in preview: loader and validation only, no codegen yet
└── rust.md # the Rust port, in preview: loader, validation and the entity generator (cargo meta gen)
```

If this list and `ls docs/features/` ever disagree, trust the directory listing —
Expand Down
1 change: 1 addition & 0 deletions docs/features/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ command surface splits in two:
| Java/Kotlin codegen | Maven plugin | `mvn metaobjects:generate` (`metaobjects:generate`) | Kotlin generators run through the same goal — see below. **No `--template-spec` flag, deliberately** — `<generator>` already loads a consumer class from the project classpath, so the declarative surface is `com.metaobjects.generator.template.TemplateScopeGenerator` wired as an ordinary `<generator>` with `<template>` / `<scope>` / `<outputPattern>` / `<templatesDir>` / `<format>` args (covers BOTH Java and Kotlin); see [declarative template scopes](codegen-concepts.md#declarative-template-scopes). The `generate` and `verify` goals are declared `threadSafe` and support parallel multi-module reactor builds (`mvn -T`) (#233) |
| Java/Kotlin verify | Maven plugin | `mvn metaobjects:verify -Dmeta.verify.mode=codegen\|templates\|deps` (`metaobjects:verify`) | parameter-driven ADR-0021 D2 modes (one goal covers BOTH Java + Kotlin): unset (default — `codegen` and `templates`; the template gate is skipped with a note when `templateRoot` is unset) / `codegen` (regen + fail on drift vs committed output, generator-neutral) / `templates` (`{{field}}`↔payload drift via the render `Verify` engine) / `deps` (opt-in dependency drift, the `path` transport only). `db` rejected ("schema verify is the migrate engine, ADR-0015") |
| Python codegen | console-script | `metaobjects gen` / `verify --codegen` / `verify --templates` | `[project.scripts] metaobjects` — **not** `meta` (that's the Node schema CLI); ships the ADR-0021 D2 subverbs (`--db` rejected, exit 2). **The generator list is `metaobjects.config.yaml`** (ADR-0034 Amendment 9, [below](#declarative-config-metaobjectsconfigyaml--python-codegen)): `gen` and `verify --codegen` run each target's `generators` (and its `templateSpec`, the declarative Mustache template-codegen surface shared with C#) into its `outDir`, and with no config they exit 2 and write nothing. `--generators` only narrows the list to declared entries. `metaobjects docs` was removed in 1.1.0: it prints the line that points at [the migration section](migrations/docs-are-generators.md#python) and exits 2 |
| Rust codegen (preview, ADR-0065) | `cargo-meta` (`metaobjects-cli`, unpublished) | `cargo meta gen [--project <dir>] [--out <dir>] [--generators entity] [--force] [--strict] [--timings] [ENTITY...]` | Ships `gen` only, with the `entity` generator (one crate per metadata package). There is no `init`, `verify`, `eject`, `fmt` or template generator yet. `gen` skips a run whose key matches (ADR-0064) and refuses to overwrite a hand-edited generated file (exit 1). `cargo meta --help` lists the options |

## `verify` is one verb with explicit subverbs (ADR-0021 D2)

Expand Down
Loading
Loading