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 .claude/rules/cross-language-porting.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ New vocabulary goes in its own provider pack, never in `metaobjects-core-types`

Preserve the following contracts exactly across all language ports:

**Metamodel subtype vocabularies (must be identical across languages):** the `registry-conformance` gate (`fixtures/registry-conformance/`) is the structural enforcer of this rule — each port emits its registry as a canonical manifest byte-matched to `expected-registry.json`. **All five shipped ports (TS / C# / Java / Kotlin / Python) plus Rust in preview (ADR-0065, byte-identical) are live + green** (SP-G Java/Kotlin reconciliation complete; the JVM runners compose from the defined metamodel provider set so codegen-base/om classpath SPI does not pollute the measured vocabulary). See `fixtures/registry-conformance/README.md`.
**Metamodel subtype vocabularies (must be identical across languages):** the `registry-conformance` gate (`fixtures/registry-conformance/`) is the structural enforcer of this rule — each port emits its registry as a canonical manifest byte-matched to `expected-registry.json`. **All five shipped ports (TS / C# / Java / Kotlin / Python) plus Rust (ADR-0065, byte-identical) are live + green** (SP-G Java/Kotlin reconciliation complete; the JVM runners compose from the defined metamodel provider set so codegen-base/om classpath SPI does not pollute the measured vocabulary). See `fixtures/registry-conformance/README.md`.
- Filter operators: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `like`, `isNull`
- Object subtypes: `entity` (owns data: own identity, writable sources, lifecycle), `value` (pure shape: NO identity, NO source, ever; constructed — by caller/embedding — never populated; may `extends` entity fields for shape; a value-hosted field may carry `origin.passthrough` but never an assembly origin), `projection` (derived read-only representation: fields `extends`-bound / origin-derived / self-declared-under-external-assembly, all read-only at subtype level; identity optional and MUST extend an entity identity; sources restricted to read-only `@kind`s; the declared field set IS the exposure — inclusive list, fail-closed). A field carrying `origin.*` is derived ⇒ read-only wherever it lives (incl. on entities). An entity's primary source must be a writable `@kind` (read-only kinds only in read role). See [ADR-0028](spec/decisions/ADR-0028-object-taxonomy-projection-value-purity.md). (FR-024 Phase E — `object.projection`/`value` are registered in `expected-registry.json` and the projection/value validation passes [identity pass-through, value-purity, projection-licensing, `@via` inference/cardinality, extends/origin agreement, derived-field providability] are enforced cross-port in all 5 ports. The **B4b** entity-primary-source-readonly cutover [the "writable `@kind`" clause above — `ERR_ENTITY_PRIMARY_SOURCE_READONLY`] + the projection codegen fan-out (read-only DTOs for view-kind projections; FR-015 proc-callables for proc-kind projections in TypeScript, C# and Kotlin ONLY — Java and Python ship no callable generator at all, so the cross-port claim does NOT cover that clause; api-docs label `object.projection` units as `projection` and document their generated `<Name>Dto`) are now shipped cross-port; the declared-API surface, the last third of FR-024, is registered since 1.3.0 by ADR-0066 — see the API bullet below.) **`report` (FR-044 Plan 1)** is a root object subtype registered in all five ports, with the `dimension.attribute` / `dimension.time` / `measure.aggregate` / `measure.ratio` / `segment.filter` children on `object.entity` and the relative-date filter value — loader-validated (`ERR_INVALID_DIMENSION` / `ERR_INVALID_MEASURE` / `ERR_INVALID_REPORT` / `ERR_REPORT_FOREIGN_MEASURE`, plus `ERR_BAD_ATTR_FILTER` for relative dates off a reporting host) and, since FR-044 Plan 2, **lowered only when it declares a read-only `source.rdb` of `@kind: view`**: `meta migrate` creates that view (TypeScript only, ADR-0015), every port reads it (persistence corpus, `report-shapes.json`), C# generates its typed row and Kotlin its Exposed table object, and, since FR-044 Plan 3, every port's generators **serve it as a keyless read-only projection** (GET list with filter/sort/paging on every derived field that has a filter band, `POST` 405, no `/{id}`; row type + filter allowlist + route/controller per port, gated by the api-contract `report/` sub-corpus in the generated lane). The client UI tier (hooks, grids, forms) and a report with no view source at all stay inert, gated by the 43 `reporting` conformance fixtures and the `codegen-noop` corpus. A served report is the predicate `servedReport` (TS) / `ReportRows.IsViewBacked` (C#) / `RestSurfaceGate.isServedReport` (Java, Kotlin) / `is_served_report` (Python): concrete, read source `@kind: view`. See [docs/features/reporting.md](docs/features/reporting.md).
- Source subtypes: `rdb` (paradigm; ADR-0007). The pre-v2 `dbTable`/`dbView` subtypes are RETIRED — `source.rdb` + `@kind: table|view|materializedView|storedProc|tableFunction` is the form, with read-only-ness derived from `@kind`. Multi-source via `@role` (exactly one `primary` per object). Source physical name = `@table` (NOT `@name`); field physical name = `@column` (renamed from `@dbColumn`). Referential actions on relationships: `@onDelete` / `@onUpdate`.
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ metaobjects/
├── fixtures/conformance/ # cross-language test fixtures
│
├── server/ # runs on a server
│ ├── typescript/ java/ python/ csharp/ rust/ (preview, ADR-0065)
│ ├── typescript/ java/ python/ csharp/ rust/ (ADR-0065)
│
└── client/ # runs on an end-user device
├── web/ # browser (TS-only — the browser is TS-native)
Expand Down
27 changes: 18 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ here.**
a report.** For a database whose unique index on the target is hand-made and not declared in the
metadata. The default, `"refuse"`, is the 1.3.0 behavior; the refusal's hint now names the setting. See
[Migrations and drift](docs/features/migrations-and-drift.md).
- **Rust (ADR-0065 Amendment 3).** A project now chooses its generators in `metaobjects.config.json`
(`{ "generators": [...] }`, written by `cargo meta init`) and no longer needs to eject to drop one;
`cargo meta gen --list` shows each as configured or not. `cargo meta eject` no longer writes the
path of the machine the tool was built on into `codegen/Cargo.toml`: the owned crate names the exact
crates.io release by default, and `--engine <directory | git-url[#rev]>` names a checkout or a git
revision. The three crates lose `publish = false`, carry their packaging metadata, and the `rust` lane
runs `cargo publish --dry-run`. Nothing is published. `cargo meta verify` now runs the business-rules
gate (ADR-0066) too: the same five findings, severities and message text as the other ports, under the
four `rules.*` and `verify.lifecycle.unreachable` settings, held to `fixtures/rules-check-conformance/`.

## [1.3.0] — unreleased

Expand Down Expand Up @@ -398,7 +407,7 @@ Each item below is described in full under Security, Added, Changed or Fixed; th
effect yet: the service shells that act on it are later work.
- A requirement's `@implementedBy` may name an operation (`Purchasing.decide`) or a
transition (`PurchaseRequest.status.submit`).
- The Rust preview port (ADR-0065) registers the same vocabulary and runs the same loader
- The Rust port (ADR-0065) registers the same vocabulary and runs the same loader
rules with the same messages, so it still passes `registry-conformance` byte for byte and
the whole metamodel corpus (574 of 574, ledger empty). It reads and validates the new
settings. It has no `verify`, so the rules gate does not run there.
Expand All @@ -409,7 +418,7 @@ Each item below is described in full under Security, Added, Changed or Fixed; th
A model that declares none of it sees no change. See `docs/features/business-rules.md`.
ADR-0067 records the layering and service-seam design (a layer is a generator an app chooses; the
actor is a type the app defines), and amends ADR-0045.
- **Rust port foundation, in preview (ADR-0065).** `server/rust/` is a Cargo workspace with a
- **Rust port foundation (ADR-0065).** `server/rust/` is a Cargo workspace with a
pinned toolchain and one crate, `metaobjects`: the node model, the type registry and the
built-in providers (strict, sealed after bootstrap, the same `ERR_*` codes), and a JSON loader
that reads packages, children, subtypes, attributes, `extends` and references, with the
Expand All @@ -418,7 +427,7 @@ Each item below is described in full under Security, Added, Changed or Fixed; th
the other ports do. It passes `registry-conformance` byte for byte and all 526 of the
metamodel fixtures, and runs every validation pass the TypeScript loader runs, in the same order
(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
Until ADR-0065 turns the warning off, 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. Every load records how
long each phase and each validation pass took (`LoadResult::timings`; the `validate` module's
Expand All @@ -429,15 +438,15 @@ Each item below is described in full under Security, Added, Changed or Fixed; th
`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
- **Rust port reads a real project.** 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),
and the crate resolves a project the way the other ports do: the `.metaobjects/config.json`
reader, the four source kinds, directory discovery (symlinks followed, `_pending` skipped), the
`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
- **Rust port generates code: `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
Expand Down Expand Up @@ -466,7 +475,7 @@ Each item below is described in full under Security, Added, Changed or Fixed; th
depend on, rather than merging. Navigation across relationships is not emitted. Nothing is
published.

- **Rust port's command line, in preview: `cargo meta init`, `verify --codegen` and `eject`, and
- **Rust port's command line: `cargo meta init`, `verify --codegen` and `eject`, and
the `client` and `commands` generators (ADR-0065 Amendment 1).** A Rust developer can now run the
whole codegen loop on a JSON or YAML model. `init` scaffolds `.metaobjects/config.json`, the
ignore rules that keep `.hashes.json` committed and a first metadata file, writing only what is
Expand All @@ -478,7 +487,7 @@ Each item below is described in full under Security, Added, Changed or Fixed; th
(0, 1, 2). `eject <generator>` writes a `codegen/` crate the project owns (the copied generator
and the generator list); `gen` and `verify` then build and run it, `gen --list` shows how each
copy compares with the shipped source, and `eject --undo` takes back copies still identical.
There is no plugin contract: the engine's Rust API has no stability promise in preview.
There is no plugin contract: the engine's Rust API has no stability promise.
The `entity` generator now also writes `<Name>Create` and `<Name>Patch` for every entity and a
`validate()` on value objects and both bodies (lengths, bounds, item counts, patterns, text
forms, nested value objects and the rules across members), exact decimals and signed durations
Expand Down Expand Up @@ -508,8 +517,8 @@ Each item below is described in full under Security, Added, Changed or Fixed; th
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 preview scope of `cargo meta`; the crates.io name `cargo-meta` is
driver. New page `docs/ports/rust.md` says what the Rust port does and does not do, how
to build and test it, and the 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.
- **Example and write-up: metadata-driven grids, forms and routes in TypeScript.**
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ first-week wedge plan — and `meta init` picks up from there.
- Already have a codebase? → Have your coding agent run the
[fit assessment](#try-it-on-your-repo--nothing-to-install) — read-only, no
install; it finds the drift already in your git history.
- New here? Pick your language → [`docs/ports/`](docs/ports/) (TS / Java / Kotlin / C# / Python; Rust is in [preview](docs/ports/rust.md)).
- New here? Pick your language → [`docs/ports/`](docs/ports/) (TS / Java / Kotlin / C# / Python; Rust is the sixth, see [its page](docs/ports/rust.md)).
- Want the metamodel feature reference? → [`docs/features/`](docs/features/).
- Want the documentation index? → [`docs/README.md`](docs/README.md).
- Want the design rationale? → [`spec/`](spec/) + [`docs/superpowers/specs/`](docs/superpowers/specs/).
Expand All @@ -171,7 +171,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 41 validation passes; 578 / 578 metamodel conformance; `cargo meta init` / `gen` / `verify --codegen` / `eject` with the `entity`, `client` and `commands` generators (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; 578 / 578 metamodel conformance; `cargo meta init` / `gen` / `verify` / `eject` with the `entity`, `client` and `commands` generators (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 Expand Up @@ -334,7 +334,7 @@ metaobjects/
│ ├── java/ # Java port (incl. codegen-kotlin + metadata-ktx)
│ ├── csharp/ # C# port
│ ├── python/ # Python port
│ └── rust/ # Rust port (preview, ADR-0065 — unpublished; cargo meta + entity/client/commands generators)
│ └── rust/ # Rust port (ADR-0065 — crates not yet published; cargo meta + entity/client/commands generators)
│
└── client/
└── web/ # universal browser packages (React, TanStack, Angular, framework-agnostic)
Expand Down
6 changes: 3 additions & 3 deletions agent-context/skills/metaobjects-fit-assessment/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ Omitting a real option is a scored defect, just like inventing one.
**M8 — The verdict-deciding fact is not always in the code.** Size you can count; trajectory
you cannot.
- **Structural disqualifiers ARE in the repo**: language outside the five published ports (Rust
is a sixth port in preview and unpublished: it generates code today with `cargo meta gen`, but
there is no crate to depend on, so treat it as a trial, not a fit), no
is a sixth port, a full 1.3.0 language: it generates code today with `cargo meta gen`, but
its crates are not on crates.io yet, so the estate works from a checkout), no
entity-shaped data at all, a DBA-gated schema. Cite them. They rule out scopes, not the whole
spectrum: a Go estate has no port, but a TypeScript web client on the other side of it may
still have a seam worth a contract.
Expand Down Expand Up @@ -332,7 +332,7 @@ invalid output). Each row rules out *scopes*, not MetaObjects wholesale:

| Check | Consequence |
|---|---|
| Backend language outside TS/Java/Kotlin/C#/Python | no published codegen or runtime for that side; a seam to a supported-language consumer can still take a contract, generated for that side only. **Rust is the exception in preview:** `cargo meta gen` runs the `entity`, `client` and `commands` generators from a checkout, with nothing published to depend on (`docs/ports/rust.md`), so say it is a trial, not a supported port |
| Backend language outside TS/Java/Kotlin/C#/Python | no published codegen or runtime for that side; a seam to a supported-language consumer can still take a contract, generated for that side only. **Rust is the exception:** a full 1.3.0 port whose `cargo meta gen` runs the `entity`, `client` and `commands` generators, with its crates ready to publish but not yet on crates.io (`docs/ports/rust.md`), so say it works from a checkout until the first release |
| No relational store (MongoDB, Cassandra, Neo4j, a remote API) | schema pillar N/A; model the stored records as sourceless entities (`identity.primary`, no `source.*`) — types, create/PATCH schemas, filter allowlists, `verify` and prompts IN; data access is a generator the adopter owns (`docs/recipes/document-graph-and-wide-column-stores.md`) |
| DB not Postgres/SQLite/D1 (MySQL, ClickHouse, SQL Server, …) | `meta migrate` / `verify --db` OUT for that database — say so; types and data access unaffected. MySQL is a supported codegen + runtime dialect (`dialect: "mysql"`; `docs/recipes/mysql.md`) |
| ORM no reference generator targets (TypeORM, Sequelize, SQLAlchemy ORM, Django ORM, Hibernate-only entities on the Java lane; Prisma on TypeScript IS targeted: `orm: "prisma"` generates `schema.prisma`, so FULL keeps Prisma) | FULL means replacing the data layer — price it as such; CONTRACT SPINE and PARTIAL leave it untouched |
Expand Down
Loading
Loading