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
10 changes: 6 additions & 4 deletions AGENTS.md

Large diffs are not rendered by default.

1,504 changes: 966 additions & 538 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ means adding/updating a conformance fixture** so every port verifies it — see
from a registered provider plus a `registry-conformance` fixture. If a generator can
*derive* something from existing metadata, derive it — don't add an attribute. See
[`spec/decisions/ADR-0023-strict-metadata-provenance.md`](spec/decisions/ADR-0023-strict-metadata-provenance.md).
- **Apply the loader rule:** the loader refuses what is invalid for the model; a limit of one generator is that generator's error. A new loader refusal needs a model that
is ambiguous or contradictory on its own; a limit of one generator belongs in that generator.
See [GOVERNANCE.md](GOVERNANCE.md#the-loader-rule) for the rule and the ledger of the four known
cases.
- **Preserve the cross-language wire format and vocabulary exactly** — see
[CLAUDE.md](CLAUDE.md) → *Cross-language porting*.

Expand Down
20 changes: 20 additions & 0 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,26 @@ the rulings this rests on, changing the kinds, the one-way dependency or the nam
model-format and compatibility change, and so needs a core maintainer. Building a pack inside
those rules does not.

### The loader rule

**The loader refuses what is invalid for the model; a limit of one generator is that generator's error.** The loader refuses a model only when the model itself is ambiguous or
contradictory: two declared names that resolve equal, two bindings on one method and path, a
reference to something that does not exist. A clash with a name only a reference generator derives,
or a subtype one generator cannot emit, is that generator's error, raised when it runs. A model
that loads must stay usable by every other generator and by an adopter's own. Relaxing a loader
refusal is never a break. Adding one is a model-format change and needs a core maintainer.
The rule is a step of [ADR-0037](spec/decisions/ADR-0037-metamodel-vocabulary-expansion-decision-framework.md).
The refusals that predate it, and where each goes:

| Refusal | Where it lives | Status |
|---|---|---|
| A transition or operation named like a derived CRUD verb (`ERR_TRANSITION_NAME_COLLISION`) | Every port's loader (rules validation), pinned by the `error-rules-*` conformance fixtures | Unreleased in 1.3.0. Moves into the service generator's own error (the TypeScript `service`, `service-routes` and `service-routes-hono` generators exist in this release); the move touches five loaders and those fixtures. |
| `@errors` codes that collide with a reserved code | Every port's loader (rules validation), same fixtures | Unreleased in 1.3.0. Moves with the one above. |
| `ERR_FILTERABLE_UNSUPPORTED_SUBTYPE` | Loader validation passes | Released. Stays; moves to the REST generator when that code is next touched. Relaxing a refusal is never a break. |
| `ERR_SORTABLE_UNSUPPORTED_SUBTYPE` | Loader validation passes | Released. Same as the filter refusal. |

Any other refusal that predates the rule stays as it is until someone touches it, and joins this table then.

### Releases

The core maintainers decide when a release happens, what version it carries, and what goes in
Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ gated by `meta verify --codegen`, which is what keeps output from drifting. See
[write your own generator](docs/recipes/write-your-own-generator.md).

Java, Kotlin, C# and Python start the same way from their own package: see
[`docs/ports/`](docs/ports/). **Their schema migrations and database checks still run in the
Node `meta` tool** (`npx meta migrate`, `npx meta verify --db`), so those teams need Node where
migrations are written or applied. Where the ports behave differently (list defaults, error
[`docs/ports/`](docs/ports/). **Their schema migrations run in the language's own tool**
(Flyway, Liquibase, Alembic, EF Core Migrations), handed the schema `meta schema` prints; the Node
`meta migrate` is the reference helper, one option. Only an adopter who takes the helper, or
checks a live database with `meta verify --db`, needs Node. Where the ports behave differently (list defaults, error
bodies, field names, data access) is listed in
[What differs by language](docs/features/language-differences.md).

The metamodel is the **durable spine**; generated code is the **disposable
artifact**. Substrate is local-first: typed metadata lives in your repo as YAML or
The metamodel is the **durable spine**; generated code is **regenerated
output**. The reference generators help a team get started and are never the required way. What they generate is real code: run it, extend it, or replace the generator. Substrate is local-first: typed metadata lives in your repo as YAML or
JSON you own. The entity/model tier of the output is dependency-free, and the optional
client, prompt-render, and runtime tiers are ordinary Apache-2.0 packages you could
vendor or fork. If the package ecosystem disappears tomorrow, you keep working code.
Expand Down Expand Up @@ -222,7 +223,7 @@ MetaObjects has two layers, and only the first is a promise

| | Core — guaranteed | Helpers — yours |
|---|---|---|
| **What** | The contracts and the conformance kits: the metamodel, loader, canonical format and registry; the store-neutral contracts (the expected schema, and the guarded update, which a persistence-conformance scenario holds every store driver to, ADR-0066 §6); the drift gates (`meta verify`); prompt render and the reply parser | Store-specific code (SQL writers, introspectors, drivers such as the `ObjectManager` drivers and the `meta migrate` writer, mappings) and every generator that writes code into your repo — the ones you write for the outputs you need, and the routes, controllers, ORM wiring, DTOs, forms, grids and hooks MetaObjects ships |
| **What** | The contracts, and the conformance corpora this repository runs every port against: the metamodel, loader, canonical format and registry; the store-neutral contracts (the expected schema, and the guarded update, which a persistence-conformance scenario holds every store driver to, ADR-0066 §6); the drift gates (`meta verify`); prompt render and the reply parser | Store-specific code (SQL writers, introspectors, drivers such as the `ObjectManager` drivers and the `meta migrate` writer, mappings) and every generator that writes code into your repo — the ones you write for the outputs you need, and the routes, controllers, ORM wiring, DTOs, forms, grids and hooks MetaObjects ships |
| **Promise** | Conformance-gated, the same behaviour in every port that ships it, covered by the [compatibility policy](docs/compatibility-policy.md) | Supported helpers that compile and pass their reference fixtures, with the same capabilities in every port unless a ruling says otherwise. The code they generate is real code: run it as shipped, extend it through hooks, or copy it with `meta eject` and own it |
| **A defect is** | A MetaObjects bug, fixed in a release | A bug in the reference, fixed there; your copy is yours |

Expand Down Expand Up @@ -352,9 +353,10 @@ metaobjects/
| C# | `dotnet tool install --global MetaObjects.Cli` → [`docs/ports/csharp.md`](docs/ports/csharp.md) |
| Python | `pip install metaobjects` → [`docs/ports/python.md`](docs/ports/python.md) |

Every language also needs the Node `meta` CLI for the schema: `npm i -D @metaobjectsdev/cli`,
then `npx meta init --config-only` in a Maven-, .NET- or pip-rooted project, and
`npx meta migrate` / `npx meta verify --db` from there. The per-language differences are in
A team that takes the reference migration helper or the live-database check needs the Node
`meta` CLI for it: `npm i -D @metaobjectsdev/cli`, then `npx meta init --config-only` in a
Maven-, .NET- or pip-rooted project, and `npx meta migrate` / `npx meta verify --db` from
there. Teams on their own migration tool need no Node. The per-language differences are in
[What differs by language](docs/features/language-differences.md).

## Cross-language conformance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ run the Node `meta deps check` for those). A project that publishes a model wire
`shared-model` generator; `verify --codegen` drift-gates its output.

Kotlin generators run through the **same Maven plugin goal** as Java generators —
both are SPI-discovered by the `metaobjects-maven-plugin`. Schema migration + live-DB
drift run through the **Node `meta` CLI** regardless of server language — see the
both are SPI-discovered by the `metaobjects-maven-plugin`. Schema migration is your own tool or the Node `meta migrate`
reference helper; live-DB drift is the Node `meta verify --db` whichever tool built the schema — see the
migration reference.

The active generator list is declared in `pom.xml` under the plugin `<configuration>`
Expand Down Expand Up @@ -169,5 +169,5 @@ cross-port versioning — **do not flag it** (only intra-port skew matters).
richer list surface (`?search=`, `filter[or][N]` / `filter[and][N]` combinators, leading-wildcard
gating; ADR-0068) passes in TypeScript and C#, and is pending in Kotlin until the Kotlin port's 1.3.0
REST-standard work lands — do NOT flag its absence in Kotlin until then.
- **No JVM migrate goal.** Schema migration is Node-`meta`-owned for every port
(ADR-0015). The Maven plugin has no migrate goal; `meta migrate` is correct.
- **No JVM migrate goal.** Schema migration is your own tool or the Node `meta migrate`
reference helper (ADR-0015 Amendment 2). The Maven plugin has no migrate goal; `meta migrate` is correct.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ The full hunt for each axis of Phase 1b (Partial / Deep path). Each axis runs in
(Node `meta` only) for DB drift. Flag a gate that is WIRED BUT INCOMPLETE for the
artifacts present, and recommend the specific missing coverage.
- [ ] **F2. Over-generation — unnecessary generated files (codegen WASTE).**
Generated code is disposable, but that is NOT license to generate what nothing
Generated code is regenerated output, but that is NOT license to generate what nothing
consumes. Every generated file is a merge/review/maintenance surface and inflates
the leverage ratio falsely. Hunt OVER-generation (the inverse of A/B's
under-generation):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ dependency against `.metaobjects/deps.lock.json` and fails with `ERR_DEPENDENCY_
run the Node `meta deps check` for those). A project that publishes a model wires the
`shared-model` generator; `verify --codegen` drift-gates its output.

Schema migration + live-DB drift run through the **Node `meta` CLI** regardless of
server language — see the migration reference. `mvn metaobjects:verify -Dmeta.verify.mode=db`
Schema migration is your own tool or the Node `meta migrate` reference helper; live-DB drift is the Node `meta verify --db`
whichever tool built the schema — see the migration reference. `mvn metaobjects:verify -Dmeta.verify.mode=db`
is rejected (exit 2).

The generator list and the `<sourceDir>` are both declared in `pom.xml` under the
Expand Down Expand Up @@ -165,5 +165,5 @@ versioning — **do not flag it** (only intra-port skew matters).
emits `<Entity>Repository.java` as a stub `interface`; the consumer hand-writes the
implementation against OMDB (or any persistence layer). Hand-written repository
implementations that match the generated interface exactly are expected.
- **No Java migrate goal.** Schema migration is Node-`meta`-owned for every port
(ADR-0015). The Maven plugin has no migrate goal; `meta migrate` is correct.
- **No Java migrate goal.** Schema migration is your own tool or the Node `meta migrate`
reference helper (ADR-0015 Amendment 2). The Maven plugin has no migrate goal; `meta migrate` is correct.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are disposable.
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

Expand Down
Loading
Loading