From f856de1ca73d27b66dbd40fa2751da5b8272b80a Mon Sep 17 00:00:00 2001 From: Doug Mealing Date: Thu, 19 Nov 2026 22:50:16 -0500 Subject: [PATCH 1/3] docs: write the 1.3.0 rulings down, describe Rust as a preview port, and date the 1.3.0 changelog --- AGENTS.md | 2 +- CHANGELOG.md | 502 +++++++++--------- README.md | 16 +- SECURITY.md | 7 +- .../references/owning-generators.md | 9 +- .../metaobjects-fit-assessment/SKILL.md | 6 +- .../references/capability-sheet.md | 9 +- docs/CONFORMANCE.md | 9 +- docs/README.md | 3 +- docs/compatibility-policy.md | 2 + docs/features/codegen-concepts.md | 4 +- docs/features/language-differences.md | 8 +- docs/features/own-your-codegen.md | 11 +- docs/features/stability-labels.md | 45 ++ docs/llms/llms-full.txt | 2 +- docs/llms/llms.txt | 2 +- docs/ports/java.md | 2 +- docs/ports/kotlin.md | 2 +- .../ADR-0034-codegen-scaffold-and-own.md | 58 +- ...lity-commitment-and-version-unification.md | 23 + ...usiness-rules-operations-and-lifecycles.md | 4 +- .../ADR-0067-layering-and-the-service-seam.md | 9 +- 22 files changed, 435 insertions(+), 300 deletions(-) create mode 100644 docs/features/stability-labels.md diff --git a/AGENTS.md b/AGENTS.md index 2fc2b4a356..23a0ff4d2c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,7 +6,7 @@ MetaObjects is a **cross-language metadata standard** for declaring typed entity The metamodel is the **durable spine**; generated code is the **disposable artifact**. Substrate is local-first: typed metadata lives in your repo, generated code is idiomatic per-language output with **no proprietary runtime**: the generated entity and model code imports nothing from MetaObjects at runtime, and the REST, prompt, client and runtime tiers import ordinary Apache-2.0 packages you can vendor, fork or replace. If `@metaobjectsdev/*` disappears tomorrow, you keep working code. -**Core vs helpers (ADR-0034 Amendment 3, 2026-09-22).** Only the core is a product promise: the metamodel, loader, canonical format and registry; runtime metadata access (the `ObjectManager` and its drivers; the HTTP adapters that mount it on a web framework are helpers, 2026-09-24 ruling); schema migrations (`meta migrate`); the drift gates (`meta verify`); prompt render and the reply parser. Every generator that writes application code into an adopter's repo — routes, controllers, ORM wiring, DTOs, forms, grids, hooks, filter allowlists — is a **reference helper**: it must compile and pass its reference fixtures, and the adopter copies it with `meta eject` and owns the copy. Mechanical test: what the tool guarantees is core; what it writes into your repo is a helper. Every port can eject: `meta eject` (TypeScript), `metaobjects eject` (Python), `mvn metaobjects:eject` (Java/Kotlin), `dotnet meta eject` (C#). Not every generator ships a reference copy: `meta gen --list` marks the ones that do not `package-only` (in TypeScript: `template`, which is exempt for good, and `docs-site`, whose builder stays packaged and whose theme `meta eject docs-site` copies; ADR-0034 Amendment 3 correction, 2026-09-26, narrowed by Amendments 5 and 7, and held to the shared manifest by Amendment 8). When you find a generator defect, fix the reference; do not describe it as a broken core guarantee. +**Core vs helpers (ADR-0034 Amendments 3 and 11).** The core is the contracts and the conformance kits, and only the core is a product promise: the metamodel, loader, canonical format and registry; the store-neutral contracts (the expected schema and the guarded update, which a persistence-conformance scenario is to hold 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 (the `ObjectManager` drivers, the `meta migrate` writer) and mappings — is a **supported helper**, and so is every generator that writes application code into an adopter's repo (routes, controllers, ORM wiring, DTOs, forms, grids, hooks, filter allowlists, and the HTTP adapters that mount the `ObjectManager` on a web framework): it compiles, passes its reference fixtures, gets the same capabilities in every port unless a ruling says otherwise (parity is capability, not identical output), and is fixed in the reference when it is wrong. **Generated code is real code**: run it as shipped, extend it through hooks, or copy it with `meta eject` and own the copy. The freeze on non-TypeScript REST generators is lifted. Mechanical test: what the tool guarantees as a contract is core; what it writes into your repo or a store is a helper. Every port can eject: `meta eject` (TypeScript), `metaobjects eject` (Python), `mvn metaobjects:eject` (Java/Kotlin), `dotnet meta eject` (C#). Not every generator ships a reference copy: `meta gen --list` marks the ones that do not `package-only` (in TypeScript: `template`, which is exempt for good, and `docs-site`, whose builder stays packaged and whose theme `meta eject docs-site` copies; ADR-0034 Amendment 3 correction, 2026-09-26, narrowed by Amendments 5 and 7, and held to the shared manifest by Amendment 8). When you find a generator defect, fix the reference; do not describe it as a broken core guarantee. ## Six pillars diff --git a/CHANGELOG.md b/CHANGELOG.md index b6a7b03e1f..7df0ba6e20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,256 +10,15 @@ here.** ## [Unreleased] -**New metamodel vocabulary, experimental: `api.*`, `operation.*`, `binding.*` and `transition.*` -(ADR-0066).** It is additive: nothing that loaded before stops loading. This vocabulary ships in -1.3.0 with `metamodelVersion` 1.3 if it merges before the 1.3.0 publish; if it lands after, the -next release moves `metamodelVersion`. - -### Added - -- **Business rules: operations, permission names and lifecycles (ADR-0066). Experimental:** the - shape may change in a MINOR, including removals and renames, until generated services run on - it in an adopter estate (`docs/compatibility-policy.md`). The names ADR-0030 - reserved are registered, with a lifecycle vocabulary, in all five ports: - - `api.operational` holds `operation.command` and `operation.query`, with `@inputRef`, - `@outputRef`, `@many` (query), `@objectRef`, `@transitions` and `@errors` (command), - `@permission` and `@public`. An optional `binding.rest` (`@method`, `@path`) overrides the - derived HTTP binding. - - `transition.action` is a child of a `field.enum` on an entity, with `@from`, `@to`, - `@condition` (the validators' grammar), `@permission` and `@public`. An enum with a - transition is a lifecycle: its states, initial state (`@default`), terminal states and each - unclaimed transition's command are derived. `transition.timed` is reserved. A lifecycle - belongs to the entity that declares the field and to the entities that extend it, never to - one whose field merely `extends` that field. A lifecycle on an entity with no source loads - and is inert, so a library's core layer can declare one; the writable-source check applies - once a source is added. - - Permission names include their owner. A declared `@permission` is a dotted identifier path - (`purchasing.approve`; a package prefix may use `::`). When it is absent, an operation asks - about `.` and a transition's derived command about - `..`, so two entities' `cancel` transitions never share a - grant. Operation names are unique across the APIs of a package, except one operation - declared identically in two APIs, such as a `v1` beside a `v2`. - - The loader refuses a malformed operation or lifecycle with eleven new codes, each pinned by a - `fixtures/conformance/error-rules-*` case: `ERR_TRANSITION_UNKNOWN_STATE`, - `ERR_TRANSITION_NOT_ON_ENTITY`, `ERR_LIFECYCLE_NO_INITIAL`, `ERR_LIFECYCLE_REDECLARED`, - `ERR_TRANSITION_NAME_COLLISION`, `ERR_OPERATION_SHAPE`, `ERR_OPERATION_TARGET_UNRESOLVED`, - `ERR_OPERATION_TARGET_MISMATCH`, `ERR_OPERATION_UNKNOWN_TRANSITION`, - `ERR_PERMISSION_PUBLIC_CONFLICT` and `ERR_BINDING_PATH_MISMATCH`. Names are compared without - case, an `@errors` code may not be one the route answers itself, two declared bindings - may not share a method and path, and a `@permission` must be a dotted identifier path. - - `verify` in every port gains a rules gate: unreachable states, an initial state that is - terminal, transitions that can never be made, a transition `@permission` no command reads, - and permission names the model derived. It is pinned by the new - `fixtures/rules-check-conformance/` corpus. - - New settings in `.metaobjects/config.json`: `rules.permissions.names`, - `rules.lifecycle.commands`, `rules.lifecycle.create` and `verify.lifecycle.unreachable`. - Absent, each behaves as before. `rules.lifecycle.create` is read and validated and has no - 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 - 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. - - Nothing is generated from the vocabulary yet: the enforcing service shells are later work - (ADR-0067), and `fixtures/codegen-noop/rules/` holds every generator to byte-identical output. - 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, and amends ADR-0045. -- **Rust port foundation, in preview (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 - canonical serializer. The loader freezes the tree when it finishes, and a frozen tree memoizes - its resolved reads (effective children, attrs and array-ness) for many concurrent readers, as - 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 - 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 - 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), - 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 - 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, 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. Navigation across relationships is not emitted. Nothing is - published. - -- **Rust port's command line, in preview: `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 - missing. `gen` now removes a generated file nothing emits any more (an edited one is refused by - name) and prints what it created, updated and removed and which crates to re-check. `verify - --codegen` renders in memory, compares with disk, writes nothing and exits 1 on drift; locally it - may answer from the stored skip key, and `--full` or a set `CI` always renders. `--db`, - `--templates` and `--deps` exit 2 and say where that check lives. Exit codes are the shared ones - (0, 1, 2). `eject ` 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. - The `entity` generator now also writes `Create` and `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 - in a generated `meta_support` crate, and honors `wire.nullMembers`. The new `client` generator - writes a typed `reqwest` client per served entity from the REST contract: `list`, `page`, `get`, - `create`, `update`, `delete` and many-to-many traversal, with a query type that has one method - per `@filterable` field and operator and an enum of the `@sortable` fields, so a filter or sort - the server would refuse does not compile. The new `commands` generator writes `clap` command - groups over that client as a library (a `Subcommand` and an async `run`, no `main`), with - bodies checked by `validate()` before anything is sent. **`commands` is Rust-only by decision**, - recorded with `client` in the shared generator registry with `rust` as the only port. Generated - crates import nothing from MetaObjects. Gates: the port now runs `validation-conformance` - through the generated `validate()`, the `decimal-wire` and `duration-wire` vectors, the `core` - cases of `writer-conformance`, both columns of the skip corpus, and the generator registry with - the eject contract; a compile gate builds and format-checks every generator's output for two - models and drives the generated client and commands over HTTP against a local stub, from a - committed lockfile; and a scale gate holds twenty copies of the fitness model to linear growth - and a size budget. Not there yet: `fmt`, a template gate, server-side generators, and clients - for projections and reports. Schema migrations and database checks stay with the Node `meta` - tool for every server language (ADR-0015). 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 a `cargo-meta` - binary is built or installed and are picked up on their own once it is. `--project --out ` 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 - 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.** - `examples/dynamic-grid/` serves and renders every entity of a model from the loaded - metadata: one grid component and one form component that take an entity name and read the - rest from `GET /_meta`, and one Fastify mount over `ObjectManager`, on SQLite. The only - generated code is the types and name constants its hand-written business rules use. - Editing the metadata changes the grid, the form and the API with no regeneration. - `docs/features/metadata-driven-runtime.md` measures it against the reference generators - for the same model (1,826 hand-written lines paid once, against 3,629 generated lines - that grow by about 726 an entity), gives the per-row cost of the metadata lookups, and - lists what the approach cannot do. It is an example on the TypeScript port, not a package. - -### Changed - -- **Release policy: vocabulary is versioned by feature, not by kind (ADR-0035 Amendment 5).** Adding - to or augmenting an existing feature (a type, subtype, attribute, enum value or view vocabulary, - additive and loading every existing document with the same meaning) is a PATCH; a whole new - feature is a MINOR; a break stays a MAJOR. `metamodelVersion` will gain a patch component moved by - the same decision (accepted, not yet implemented: it stays `.` until every port - reads three components), and any move of it still publishes all four registries. Policy text only: - no version, vocabulary or `metamodelVersion` changes here. See `docs/RELEASING.md`, "The - vocabulary rule". - -### Fixed - -- **A credential is never filterable or sortable, in every port.** A field that declares a - `view.password` and that a model also marked `@filterable` or `@sortable` was on the generated - filter and sort allowlists, so a client could learn its value by probing (`filter[pinHash][eq]=...`, - a `like` prefix one character at a time, or the order of a `sort`). The allowlists are now built - without a credential (in every port a column a sibling subtype of the same single table marks as one - counts too, whichever subtype is declared first, as it does for hiding the column from responses), - so a request that names it is refused like any other field they do not hold (`400` `invalid_filter_field` - or `invalid_sort`, naming the field). The client filter type, the OpenAPI parameters and the agent UI - page leave it out too. In Java, Kotlin and C#, whose sort allowlist lists every scalar field and never read `@sortable`, a - credential was sortable with no mark at all, so the generated routes change for any model with a - credential: regenerate. Your own code is unaffected. Gated by `filter-sort-refuses-credential` in the `secret-fields/` - sub-corpus of the api-contract conformance corpus, in the generated lane of all five ports, and by - `tph-sibling-credential` in `secret-fields/tph/` for the shared-column case. - -- **A numeric key is read only from canonical decimal text, in the TypeScript, Java and Python - ObjectManagers.** A path parameter or ref string for an integer, long, decimal, double or float - primary key went through the language's own number parser, which reads `0x1`, `1e0`, `0b1`, `+1`, - ` 1 ` and the empty string as numbers (and Java's and Python's also `1_0`, a Unicode digit, `NaN`): - text that is no key named row 1 (or row 0), and two different texts named one row. An integer key - is now an optional `-` and ASCII digits with no leading zero; a decimal key may add `.` and at - least one digit; nothing else is a key. TypeScript refuses it with `InvalidKeyError` (a - `ValidationError`), which the mounts answer `400 {"error":"invalid_id"}` like an id the column - cannot hold; the drizzle-fastify and hono mounts and the deprecated `parseId` read ids by the - same rule, and it also refuses an integer key that is not a safe integer (beyond 2^53) and a decimal - key that is not finite: a `field.long` key above 2^53 used to round silently to another row, where - Java accepts an integer key up to `Long.MAX_VALUE`. Java refuses a ref id with `IllegalArgumentException` and Python a key argument with - `ValueError`, the errors each already raised for an unusable argument. A string or uuid key is - untouched (`0123` stays `0123`). If you pass a key as text to `findById`, `update`, `delete` or - `load`, pass its decimal spelling. The read-only mount of a raw-SQL view, which has no column type to - consult, answers `400 invalid_id` for text that reads as a number without being its canonical spelling - (`01`, `1e0`), because SQLite would convert a quoted `'01'` back to row 1. Not changed: the numeric path parameters of the generated Spring - and FastAPI routes, which those frameworks parse before the ObjectManager sees them. - -- **Fix, TypeScript: `DELETE` on a missing row answers `404`, not `500`, from the - ObjectManager route mount.** `mountCrudRoutes` and `mountDeleteRoute` in - `@metaobjectsdev/runtime-ts/fastify` called `ObjectManager.delete` in its default mode, which - throws for a row that is not there, so the request ended as `500 {"error":"internal"}`. They - now answer `404 {"error":"not_found"}`, as the update route and the generated routes do. -- **Fix, TypeScript: `findMany` with an `offset` and no `limit` works on SQLite and MySQL.** - The Kysely and Drizzle drivers in `@metaobjectsdev/runtime-ts` wrote `OFFSET` with no - `LIMIT`, which is a syntax error on both databases, so the call threw. An offset alone - now carries a limit no result can reach, and skips rows on every dialect. -- **Fix, Java, Kotlin and Python: `Names` has no entry for a derived field with no - column.** The TypeScript and C# names generators already left out a derived (`origin.*`) field - of an entity read from its table; Java, Kotlin and Python still emitted a column constant - naming a column that does not exist. They now match: a projection's or write-through entity's - derived field keeps its entry, an entity's does not. -- **Fix, TypeScript: `meta verify --db` accepts the function calls Postgres accepts.** The - declared `origin.function` signature check compared parameter types by exact name, so an - `integer` argument for a `bigint` or `numeric` parameter, a polymorphic `any*` parameter and a - variadic function were all reported as mismatches. It now allows integer to bigint to numeric - widening and the float widenings onto real and double precision, treats `any*` parameters as - wildcards and does not check a variadic function's trailing arity (its required fixed - parameters still are). A genuine mismatch (a narrowing, - an unrelated type, a wrong return type) still fails. -- **Fix, TypeScript and C#: the widened-extender warning covers every extender whose base - changed.** An extender with no identity of its own keeps its super's identity anchor (rc.21). - The load warned only for a TPH base read through a subtype column; it now warns whenever the - base differs from the pre-rc.21 derivation, naming both entities and the - `identity.primary { extends: ... }` that keeps the old one. -- **Loading a large model no longer slows down quadratically (TypeScript, Python, C#).** Reference resolution looked each name up by scanning every top-level object, so load time grew with the square of the model; each root now keeps a name index, invalidated whenever its top-level nodes change, with the same first-match-wins result. A 20x-size model loads about 5x faster in TypeScript and 1.5x to 2x faster in Python and C#; loaded trees are byte-identical. - -## [1.3.0] — 2026-11-17 +## [1.3.0] — unreleased _npm `1.3.0` (full lockstep across all 14 `@metaobjectsdev/*` publish candidates)._ +**New metamodel vocabulary, experimental: `api.*`, `operation.*`, `binding.*` and `transition.*` +(ADR-0066).** It is additive: nothing that loaded before stops loading. This vocabulary ships in +1.3.0, under `metamodelVersion` 1.3. + **`metamodelVersion` moves to `1.3`.** This release adds vocabulary (`field.duration`, `validator.exactlyOne`, `@constraintName`, `@condition`, `@maxLength` on `field.enum`, `@sequenceStart`, `@sequenceName`, `@flattenedColumnPrefix`, the `pascal` column rule, @@ -456,6 +215,169 @@ Each item below is described in full under Security, Added, Changed or Fixed; th ### Added +- **Business rules: operations, permission names and lifecycles (ADR-0066). Experimental:** the + shape may change in a MINOR, including removals and renames, until generated services run on + it in an adopter estate (`docs/compatibility-policy.md`). The names ADR-0030 + reserved are registered, with a lifecycle vocabulary, in all five ports: + - `api.operational` holds `operation.command` and `operation.query`, with `@inputRef`, + `@outputRef`, `@many` (query), `@objectRef`, `@transitions` and `@errors` (command), + `@permission` and `@public`. An optional `binding.rest` (`@method`, `@path`) overrides the + derived HTTP binding. + - `transition.action` is a child of a `field.enum` on an entity, with `@from`, `@to`, + `@condition` (the validators' grammar), `@permission` and `@public`. An enum with a + transition is a lifecycle: its states, initial state (`@default`), terminal states and each + unclaimed transition's command are derived. `transition.timed` is reserved. A lifecycle + belongs to the entity that declares the field and to the entities that extend it, never to + one whose field merely `extends` that field. A lifecycle on an entity with no source loads + and is inert, so a library's core layer can declare one; the writable-source check applies + once a source is added. + - Permission names include their owner. A declared `@permission` is a dotted identifier path + (`purchasing.approve`; a package prefix may use `::`). When it is absent, an operation asks + about `.` and a transition's derived command about + `..`, so two entities' `cancel` transitions never share a + grant. Operation names are unique across the APIs of a package, except one operation + declared identically in two APIs, such as a `v1` beside a `v2`. + - The loader refuses a malformed operation or lifecycle with eleven new codes, each pinned by a + `fixtures/conformance/error-rules-*` case: `ERR_TRANSITION_UNKNOWN_STATE`, + `ERR_TRANSITION_NOT_ON_ENTITY`, `ERR_LIFECYCLE_NO_INITIAL`, `ERR_LIFECYCLE_REDECLARED`, + `ERR_TRANSITION_NAME_COLLISION`, `ERR_OPERATION_SHAPE`, `ERR_OPERATION_TARGET_UNRESOLVED`, + `ERR_OPERATION_TARGET_MISMATCH`, `ERR_OPERATION_UNKNOWN_TRANSITION`, + `ERR_PERMISSION_PUBLIC_CONFLICT` and `ERR_BINDING_PATH_MISMATCH`. Names are compared without + case, an `@errors` code may not be one the route answers itself, two declared bindings + may not share a method and path, and a `@permission` must be a dotted identifier path. + - `verify` in every port gains a rules gate: unreachable states, an initial state that is + terminal, transitions that can never be made, a transition `@permission` no command reads, + and permission names the model derived. It is pinned by the new + `fixtures/rules-check-conformance/` corpus. + - New settings in `.metaobjects/config.json`: `rules.permissions.names`, + `rules.lifecycle.commands`, `rules.lifecycle.create` and `verify.lifecycle.unreachable`. + Absent, each behaves as before. `rules.lifecycle.create` is read and validated and has no + 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 + 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. + + Nothing is generated from the vocabulary yet: the enforcing service shells are later work + (ADR-0067), and `fixtures/codegen-noop/rules/` holds every generator to byte-identical output. + 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, and amends ADR-0045. +- **Rust port foundation, in preview (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 + canonical serializer. The loader freezes the tree when it finishes, and a frozen tree memoizes + its resolved reads (effective children, attrs and array-ness) for many concurrent readers, as + 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 + 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 + 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), + 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 + 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, 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. Navigation across relationships is not emitted. Nothing is + published. + +- **Rust port's command line, in preview: `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 + missing. `gen` now removes a generated file nothing emits any more (an edited one is refused by + name) and prints what it created, updated and removed and which crates to re-check. `verify + --codegen` renders in memory, compares with disk, writes nothing and exits 1 on drift; locally it + may answer from the stored skip key, and `--full` or a set `CI` always renders. `--db`, + `--templates` and `--deps` exit 2 and say where that check lives. Exit codes are the shared ones + (0, 1, 2). `eject ` 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. + The `entity` generator now also writes `Create` and `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 + in a generated `meta_support` crate, and honors `wire.nullMembers`. The new `client` generator + writes a typed `reqwest` client per served entity from the REST contract: `list`, `page`, `get`, + `create`, `update`, `delete` and many-to-many traversal, with a query type that has one method + per `@filterable` field and operator and an enum of the `@sortable` fields, so a filter or sort + the server would refuse does not compile. The new `commands` generator writes `clap` command + groups over that client as a library (a `Subcommand` and an async `run`, no `main`), with + bodies checked by `validate()` before anything is sent. **`commands` is Rust-only by decision**, + recorded with `client` in the shared generator registry with `rust` as the only port. Generated + crates import nothing from MetaObjects. Gates: the port now runs `validation-conformance` + through the generated `validate()`, the `decimal-wire` and `duration-wire` vectors, the `core` + cases of `writer-conformance`, both columns of the skip corpus, and the generator registry with + the eject contract; a compile gate builds and format-checks every generator's output for two + models and drives the generated client and commands over HTTP against a local stub, from a + committed lockfile; and a scale gate holds twenty copies of the fitness model to linear growth + and a size budget. Not there yet: `fmt`, a template gate, server-side generators, and clients + for projections and reports. Schema migrations and database checks stay with the Node `meta` + tool for every server language (ADR-0015). 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 a `cargo-meta` + binary is built or installed and are picked up on their own once it is. `--project --out ` 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 + 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.** + `examples/dynamic-grid/` serves and renders every entity of a model from the loaded + metadata: one grid component and one form component that take an entity name and read the + rest from `GET /_meta`, and one Fastify mount over `ObjectManager`, on SQLite. The only + generated code is the types and name constants its hand-written business rules use. + Editing the metadata changes the grid, the form and the API with no regeneration. + `docs/features/metadata-driven-runtime.md` measures it against the reference generators + for the same model (1,826 hand-written lines paid once, against 3,629 generated lines + that grow by about 726 an entity), gives the per-row cost of the metadata lookups, and + lists what the approach cannot do. It is an example on the TypeScript port, not a package. + - **A working loop first in the agent context.** The always-on file `meta init` scaffolds (`.metaobjects/AGENTS.md` and `CLAUDE.md`) now opens with the whole loop for the declared stack, in order: configure and run the generators (one step per declared server, with the @@ -1272,6 +1194,23 @@ Each item below is described in full under Security, Added, Changed or Fixed; th ### Documentation +- **The rulings of 2026-11-12 and 2026-11-13 are written down, and the 1.3.0 wording is corrected + before publish.** ADR-0034 Amendment 11: the core is the contracts and the conformance kits; + store-specific code (SQL writers, introspectors, drivers, mappings) is a supported helper; the + REST freeze on non-TypeScript generators is lifted; parity is capability parity; and generated + code is real code, run as shipped, extended through hooks, or owned by ejecting. ADR-0035 + Amendment 6: one version per helper package, a stable one starting at `1.x` and a new one at + `0.x`. ADR-0066 §6 says the persistence scenario that will hold store drivers to the guarded + update does not exist yet, and ADR-0067 §3 says the interface-only attachment was the design's + choice. The old core line is replaced in `README.md`, `AGENTS.md`, `docs/llms/`, + `docs/CONFORMANCE.md` and the codegen skill's `owning-generators.md`, and the "starter" and + "starting point" wording about generated code is gone from the docs. No new promise is + published: the new [Stability labels](docs/features/stability-labels.md) page lists which pieces + are stable, preview or experimental and adds no support window. The fit-assessment skill and + its capability sheet now describe Rust as a sixth port in preview, and `SECURITY.md` no longer + says pre-1.0. The `[Unreleased]` entries moved into this section, and its header says + `unreleased` until the publish dates it. + - **ADR-0015 Amendment 1: EF Core Migrations is a supported second C# path.** `meta migrate` stays the reference engine; the EF context is held to it by the shared CHECK corpus and the identity start rule. @@ -1307,6 +1246,15 @@ Each item below is described in full under Security, Added, Changed or Fixed; th ### Changed +- **Release policy: vocabulary is versioned by feature, not by kind (ADR-0035 Amendment 5).** Adding + to or augmenting an existing feature (a type, subtype, attribute, enum value or view vocabulary, + additive and loading every existing document with the same meaning) is a PATCH; a whole new + feature is a MINOR; a break stays a MAJOR. `metamodelVersion` will gain a patch component moved by + the same decision (accepted, not yet implemented: it stays `.` until every port + reads three components), and any move of it still publishes all four registries. Policy text only: + no version, vocabulary or `metamodelVersion` changes here. See `docs/RELEASING.md`, "The + vocabulary rule". + - **`meta init` and `metaobjects init` write `outputLayout: "package"`.** A new project gets one directory per metadata package (`acme::blog` writes `src/generated/acme/blog/Author.ts`), so two objects with one name in two packages are two files. The engine default stays `flat`, so an @@ -1839,6 +1787,68 @@ Each item below is described in full under Security, Added, Changed or Fixed; th ### Fixed +- **A credential is never filterable or sortable, in every port.** A field that declares a + `view.password` and that a model also marked `@filterable` or `@sortable` was on the generated + filter and sort allowlists, so a client could learn its value by probing (`filter[pinHash][eq]=...`, + a `like` prefix one character at a time, or the order of a `sort`). The allowlists are now built + without a credential (in every port a column a sibling subtype of the same single table marks as one + counts too, whichever subtype is declared first, as it does for hiding the column from responses), + so a request that names it is refused like any other field they do not hold (`400` `invalid_filter_field` + or `invalid_sort`, naming the field). The client filter type, the OpenAPI parameters and the agent UI + page leave it out too. In Java, Kotlin and C#, whose sort allowlist lists every scalar field and never read `@sortable`, a + credential was sortable with no mark at all, so the generated routes change for any model with a + credential: regenerate. Your own code is unaffected. Gated by `filter-sort-refuses-credential` in the `secret-fields/` + sub-corpus of the api-contract conformance corpus, in the generated lane of all five ports, and by + `tph-sibling-credential` in `secret-fields/tph/` for the shared-column case. + +- **A numeric key is read only from canonical decimal text, in the TypeScript, Java and Python + ObjectManagers.** A path parameter or ref string for an integer, long, decimal, double or float + primary key went through the language's own number parser, which reads `0x1`, `1e0`, `0b1`, `+1`, + ` 1 ` and the empty string as numbers (and Java's and Python's also `1_0`, a Unicode digit, `NaN`): + text that is no key named row 1 (or row 0), and two different texts named one row. An integer key + is now an optional `-` and ASCII digits with no leading zero; a decimal key may add `.` and at + least one digit; nothing else is a key. TypeScript refuses it with `InvalidKeyError` (a + `ValidationError`), which the mounts answer `400 {"error":"invalid_id"}` like an id the column + cannot hold; the drizzle-fastify and hono mounts and the deprecated `parseId` read ids by the + same rule, and it also refuses an integer key that is not a safe integer (beyond 2^53) and a decimal + key that is not finite: a `field.long` key above 2^53 used to round silently to another row, where + Java accepts an integer key up to `Long.MAX_VALUE`. Java refuses a ref id with `IllegalArgumentException` and Python a key argument with + `ValueError`, the errors each already raised for an unusable argument. A string or uuid key is + untouched (`0123` stays `0123`). If you pass a key as text to `findById`, `update`, `delete` or + `load`, pass its decimal spelling. The read-only mount of a raw-SQL view, which has no column type to + consult, answers `400 invalid_id` for text that reads as a number without being its canonical spelling + (`01`, `1e0`), because SQLite would convert a quoted `'01'` back to row 1. Not changed: the numeric path parameters of the generated Spring + and FastAPI routes, which those frameworks parse before the ObjectManager sees them. + +- **Fix, TypeScript: `DELETE` on a missing row answers `404`, not `500`, from the + ObjectManager route mount.** `mountCrudRoutes` and `mountDeleteRoute` in + `@metaobjectsdev/runtime-ts/fastify` called `ObjectManager.delete` in its default mode, which + throws for a row that is not there, so the request ended as `500 {"error":"internal"}`. They + now answer `404 {"error":"not_found"}`, as the update route and the generated routes do. +- **Fix, TypeScript: `findMany` with an `offset` and no `limit` works on SQLite and MySQL.** + The Kysely and Drizzle drivers in `@metaobjectsdev/runtime-ts` wrote `OFFSET` with no + `LIMIT`, which is a syntax error on both databases, so the call threw. An offset alone + now carries a limit no result can reach, and skips rows on every dialect. +- **Fix, Java, Kotlin and Python: `Names` has no entry for a derived field with no + column.** The TypeScript and C# names generators already left out a derived (`origin.*`) field + of an entity read from its table; Java, Kotlin and Python still emitted a column constant + naming a column that does not exist. They now match: a projection's or write-through entity's + derived field keeps its entry, an entity's does not. +- **Fix, TypeScript: `meta verify --db` accepts the function calls Postgres accepts.** The + declared `origin.function` signature check compared parameter types by exact name, so an + `integer` argument for a `bigint` or `numeric` parameter, a polymorphic `any*` parameter and a + variadic function were all reported as mismatches. It now allows integer to bigint to numeric + widening and the float widenings onto real and double precision, treats `any*` parameters as + wildcards and does not check a variadic function's trailing arity (its required fixed + parameters still are). A genuine mismatch (a narrowing, + an unrelated type, a wrong return type) still fails. +- **Fix, TypeScript and C#: the widened-extender warning covers every extender whose base + changed.** An extender with no identity of its own keeps its super's identity anchor (rc.21). + The load warned only for a TPH base read through a subtype column; it now warns whenever the + base differs from the pre-rc.21 derivation, naming both entities and the + `identity.primary { extends: ... }` that keeps the old one. +- **Loading a large model no longer slows down quadratically (TypeScript, Python, C#).** Reference resolution looked each name up by scanning every top-level object, so load time grew with the square of the model; each root now keeps a name index, invalidated whenever its top-level nodes change, with the same first-match-wins result. A 20x-size model loads about 5x faster in TypeScript and 1.5x to 2x faster in Python and C#; loaded trees are byte-identical. + - **No CHECK for a derived field.** A validator on a field that carries an `origin` (or a cross-field validator naming one) made `meta migrate` emit a CHECK on a column that does not exist, and `CREATE TABLE` failed. The derived field is skipped; the C# context does the same. diff --git a/README.md b/README.md index f456629280..f7060dfa07 100644 --- a/README.md +++ b/README.md @@ -203,7 +203,7 @@ first-week wedge plan — and `meta init` picks up from there. A "Yes" means the feature is covered by the shared conformance corpora at [`fixtures/`](fixtures/) for that port, or by a port-local test of equivalent scope. For rows that describe generated code, the coverage is of the reference -generators on their fixtures — a quality check on the starting point, not a promise +generators on their fixtures — a quality check on the generators, not a promise about the code in your repo. A "partial" means the loader recognizes the metamodel feature but the codegen / runtime tier doesn't fully exercise it yet. @@ -218,16 +218,16 @@ the consumer-side wiring (React + TanStack, and the ## What is guaranteed, and what is yours MetaObjects has two layers, and only the first is a promise -([ADR-0034 Amendment 3](spec/decisions/ADR-0034-codegen-scaffold-and-own.md#amendment-3-2026-09-22--generators-are-reference-helpers-the-core-is-what-metaobjects-guarantees)): +([ADR-0034 Amendments 3 and 11](spec/decisions/ADR-0034-codegen-scaffold-and-own.md#amendment-11-2026-11-19--the-core-is-contracts-and-conformance-kits-and-generated-code-is-real-code)): | | Core — guaranteed | Helpers — yours | |---|---|---| -| **What** | The metamodel, loader, canonical format and registry; runtime metadata access (the `ObjectManager`, not the HTTP adapters that mount it); schema migrations (`meta migrate`); the drift gates (`meta verify`); prompt render and the reply parser | Every generator that writes code into your repo — the ones you write for the outputs you need, and the reference routes, controllers, ORM wiring, DTOs, forms, grids and hooks you copy | -| **Promise** | Conformance-gated, the same behaviour in every port that ships it, covered by the [compatibility policy](docs/compatibility-policy.md) | Reference starting points that compile and pass their reference fixtures. Run one as shipped, or copy it with `meta eject` and change it freely | +| **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); 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 | -The test is mechanical: what the tool guarantees is core; what it writes into your repo -is a helper. Every port can eject: `meta eject` (TypeScript), `metaobjects eject` (Python), +The test is mechanical: what the tool guarantees as a contract is core; what it writes into +your repo or a store is a helper. Every port can eject: `meta eject` (TypeScript), `metaobjects eject` (Python), `mvn metaobjects:eject` (Java and Kotlin) and `dotnet meta eject` (C#). ## Six pillars @@ -250,9 +250,9 @@ sixth ships two libraries at their own stability labels: 20-line shape plus worked examples to copy. The reference generators (Drizzle/Zod + Fastify for TS, Spring REST + DTO + repository for Java, `data class` + Exposed for Kotlin, EF Core entity class + ASP.NET routes for C#, Pydantic + FastAPI for - Python) are starting points: run one as shipped when it already emits what you want, or + Python) emit real code: run one as shipped when it already emits what you want, or eject the one that is close, change it, and regenerate. - The engine that runs generators is core; their output is yours. + The engine that runs generators is core; the code it writes is yours. 2. **Runtime metadata** — load metadata at runtime, drive behavior dynamically (CRUD, validation, relationships, dynamic admin UIs; typed tool payloads are declared today, with MCP exposure on the roadmap). diff --git a/SECURITY.md b/SECURITY.md index aea5f51388..efde16d391 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -20,6 +20,7 @@ fix and disclosure timeline. ## Supported versions -MetaObjects is pre-1.0 and ships from the `main` line. Security fixes target the latest -released version of each language package (npm, NuGet, Maven Central, PyPI). Please -verify against the latest release before reporting. +MetaObjects is at 1.x and ships from the `main` line. Security fixes target the latest +released version of each language package (npm, NuGet, Maven Central, PyPI); a fix that has to +reach an earlier minor is made on a `release/.` branch. No support window or fix +time is promised beyond that. Please verify against the latest release before reporting. diff --git a/agent-context/skills/metaobjects-codegen/references/owning-generators.md b/agent-context/skills/metaobjects-codegen/references/owning-generators.md index c78c097891..6a3c67de0f 100644 --- a/agent-context/skills/metaobjects-codegen/references/owning-generators.md +++ b/agent-context/skills/metaobjects-codegen/references/owning-generators.md @@ -27,16 +27,17 @@ Then do **not**: - pin an older MetaObjects release, or wait for a newer one, to get past it; - branch, patch, or rebuild a clone of the MetaObjects repository. -The reference generators are starting points you take a copy of. They are +The reference generators emit real code, and you may take a copy of one. They are conformance-gated so the copy starts out correct — not so that each project's output becomes the library's problem. Once you run a generator in your build, what it emits for your model is yours, exactly as if you had written it. **What is legitimately upstream** is only what you cannot own: the **loader and metamodel** (valid metadata rejected, invalid metadata accepted, a wrong resolution), the -**core runtime** your app imports (the metadata-driven `ObjectManager`, prompt render, the -reply parser — not an HTTP adapter you ejected, which is yours), the **codegen engine -itself** (the runner, the three-way merge, `verify`), and **`meta migrate`**. The test is +**core contracts and runtime** your app imports (prompt render, the reply parser, the +store-neutral contracts — not an HTTP adapter you ejected, which is yours), the **codegen engine +itself** (the runner, the three-way merge, `verify`), and the **store-specific helpers you +cannot eject** (the `ObjectManager` drivers and `meta migrate`), which MetaObjects supports and fixes. The test is mechanical: if changing a generator — or a file eject copied beside it — fixes it, it is yours. diff --git a/agent-context/skills/metaobjects-fit-assessment/SKILL.md b/agent-context/skills/metaobjects-fit-assessment/SKILL.md index 19061fca10..b1e7d92685 100644 --- a/agent-context/skills/metaobjects-fit-assessment/SKILL.md +++ b/agent-context/skills/metaobjects-fit-assessment/SKILL.md @@ -186,7 +186,9 @@ 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 ports, no +- **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 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. @@ -330,7 +332,7 @@ invalid output). Each row rules out *scopes*, not MetaObjects wholesale: | Check | Consequence | |---|---| -| Backend language outside TS/Java/Kotlin/C#/Python | no codegen or runtime for that side; a seam to a supported-language consumer can still take a contract, generated for that side only | +| 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 | | 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 | diff --git a/agent-context/skills/metaobjects-fit-assessment/references/capability-sheet.md b/agent-context/skills/metaobjects-fit-assessment/references/capability-sheet.md index fbbee97586..5e9faa8ad5 100644 --- a/agent-context/skills/metaobjects-fit-assessment/references/capability-sheet.md +++ b/agent-context/skills/metaobjects-fit-assessment/references/capability-sheet.md @@ -62,7 +62,10 @@ building block. Every generator is a reference helper an adopter selects, ejects Views, expression/partial indexes and SQLite CHECKs are refused, not dropped (`docs/recipes/prisma.md`); - ship an AsyncAPI generator; -- reach a consumer outside the five ports (Go, Rust, Ruby, PHP, Swift…) directly. +- reach a consumer outside the five published ports (Go, Ruby, PHP, Swift…) directly. **Rust is a + sixth port in preview, unpublished** (`docs/ports/rust.md`): `cargo meta gen` runs the `entity`, + `client` and `commands` generators from a checkout of this repository, and there is no crate to + install, so a Rust estate can try it but cannot yet depend on it. **Each of those is a generator the project writes**, and that is the primary codegen path, not a workaround: a generator is a function from the loaded model to files, a few dozen lines, and @@ -73,8 +76,8 @@ day or two for a first generator), and do not report it as impossible. **OpenAPI and JSON Schema are stock generators, unreleased, targeting 1.2.1.** `openapi` writes one OpenAPI 3.1 document for the generated REST surface, and `contract-schema` writes JSON Schema 2020-12 for each object's read, create and update shapes, plus a strict structured-output subset. A project -on any port runs them through the Node `meta` CLI. They reach the languages outside the five ports -through those languages' own OpenAPI tooling, and oasdiff over two emitted documents checks a change +on any port runs them through the Node `meta` CLI. They reach the languages outside the five published +ports through those languages' own OpenAPI tooling, and oasdiff over two emitted documents checks a change against the last release (`docs/features/contract-emitters.md`). Until 1.2.1 ships, an assessment of a released version counts these as generators the project writes, from the examples in `docs/recipes/write-your-own-generator.md`. diff --git a/docs/CONFORMANCE.md b/docs/CONFORMANCE.md index 303b5c0082..3f40e55b67 100644 --- a/docs/CONFORMANCE.md +++ b/docs/CONFORMANCE.md @@ -101,8 +101,9 @@ fixtures as passing, but a future port-level reconciliation pass would close the ### Core corpora and template quality checks -Since [ADR-0034 Amendment 3](../spec/decisions/ADR-0034-codegen-scaffold-and-own.md#amendment-3-2026-09-22--generators-are-reference-helpers-the-core-is-what-metaobjects-guarantees), -the corpora above do two different jobs. Only the first is a promise to adopters. +Since [ADR-0034 Amendments 3 and 11](../spec/decisions/ADR-0034-codegen-scaffold-and-own.md#amendment-11-2026-11-19--the-core-is-contracts-and-conformance-kits-and-generated-code-is-real-code), +the corpora above do two different jobs. Only the first is a promise to adopters: the core is +the contracts and the conformance kits that hold every port to them. - **Core — the contract.** `conformance/`, `yaml-conformance/`, `registry-conformance/`, `validation-conformance/`, `provider-composition-conformance/`, @@ -122,7 +123,7 @@ the corpora above do two different jobs. Only the first is a promise to adopters `rules-check-conformance/` (the business-rules gate every port's `verify` runs, ADR-0066) and `codegen-skip-conformance/` (ADR-0064: which changes make `gen` render, and what a local `verify --codegen` may answer from the stored key), core for the same reason. A red cell here is a MetaObjects bug. -- **Template quality checks — not a promise.** The generated lane of +- **Generator quality checks — a supported helper's tests, not a core promise.** The generated lane of `api-contract-conformance/`, `generator-registry-conformance/` (stable generator names), `codegen-noop/` (vocabulary with no lowering yet emits nothing), `writer-conformance/` (the code writer the reference generators write through, ADR-0063), `contract-conformance/` (the JSON Schema and OpenAPI output), `cube-model/` (the Cube @@ -130,7 +131,7 @@ the corpora above do two different jobs. Only the first is a promise to adopters `requirement-test-identity-conformance/` (which tests the `requirement-tests` reference generator yields from a ledger and what each is called; the text it writes is not pinned), the codegen-compile gate and the eject contract (below). They check that the - reference generators are correct starting points; an adopter's ejected copy is theirs and is not gated. The hand-rolled + reference generators emit correct code; an adopter's ejected copy is theirs and is not gated. The hand-rolled reference-server lane of `api-contract-conformance/` still pins the wire contract that the runtimes and the client speak, which is core. diff --git a/docs/README.md b/docs/README.md index af0a627cb9..13a3b282d9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -52,7 +52,8 @@ docs/ │ ├── explorer-data.md # explorer.json and its inputs: export --effective, the verify ledger rows, manifest provenance │ ├── explorer-site.md # the model explorer site docsSiteFile() builds from explorer.json │ ├── metadata-driven-runtime.md # one grid, one form and one route mount for every entity, read from the loaded metadata (TypeScript example, measured) -│ └── own-your-codegen.md # scaffold-and-own generator ownership (ADR-0034) +│ ├── own-your-codegen.md # scaffold-and-own generator ownership (ADR-0034) +│ └── stability-labels.md # which pieces are stable, preview or experimental today (a list of facts, no promise) └── ports/ # one file per language/framework port ├── typescript.md ├── typescript-client.md # browser-side TS (React, TanStack, Angular, codegen pairs) diff --git a/docs/compatibility-policy.md b/docs/compatibility-policy.md index 9d29c39b7b..d7d34d82fc 100644 --- a/docs/compatibility-policy.md +++ b/docs/compatibility-policy.md @@ -85,6 +85,8 @@ work*. A release can move one without the other, and most releases move neither. ## Shipped libraries (`libraries: [...]`) +_Which pieces carry which label today is listed in [Stability labels](features/stability-labels.md); that page is a list of facts and adds no promise._ + A [library](features/libraries.md) is declared design MetaObjects ships as metadata — nodes an adopter opts into and then generates from. What its SHAPE promises depends on the `stability` its manifest declares, and `meta gen --list` prints it: diff --git a/docs/features/codegen-concepts.md b/docs/features/codegen-concepts.md index 5103272aad..e75f9c4acf 100644 --- a/docs/features/codegen-concepts.md +++ b/docs/features/codegen-concepts.md @@ -40,7 +40,7 @@ The library also ships a documented **template library** of reference generators already emits what you want, import it and run it as shipped; when one is close to what you need, you copy it into your repo and own it. A single standard template set has never fit across projects — framework conventions, naming, structure, and business patterns are -per-project. Don't fight a black-box generator; own a starting point and edit it. +per-project. Don't fight a black-box generator; eject the one that is close and own the copy. Choosing and adapting a starting template is a **human/Claude judgment call**, not a CLI flag. (See ADR-0034.) @@ -243,7 +243,7 @@ drop the files of objects the run did not name. A generator picks its scope by which helper it composes — the same way it picks object vs model today. Reference templates and the guidance call out the scope each -starting point is for, so "I need a per-package service layer" maps to a clear +generator is for, so "I need a per-package service layer" maps to a clear pattern instead of hand-rolled grouping. ### Declarative template scopes diff --git a/docs/features/language-differences.md b/docs/features/language-differences.md index 8c57458504..37dc742ab7 100644 --- a/docs/features/language-differences.md +++ b/docs/features/language-differences.md @@ -64,9 +64,11 @@ EF Core in C#, Spring in Java, Exposed in Kotlin, Pydantic and FastAPI in Python output is something a project opts into (the `wire` setting), not a default the ports are bent to fit ([ADR-0019 Amendment 2](../../spec/decisions/ADR-0019-runtime-return-type-contract.md)). Second, **generated application code is a reference helper**, not a guarantee -([ADR-0034 Amendment 3](../../spec/decisions/ADR-0034-codegen-scaffold-and-own.md)): a route, -a repository or a DTO is a starting point you can eject and change, so a difference in what -the reference writes is a difference you can remove in your own copy. +([ADR-0034 Amendments 3 and 11](../../spec/decisions/ADR-0034-codegen-scaffold-and-own.md)): a route, +a repository or a DTO is real code you can run as shipped, or eject and change, so a difference in what +the reference writes is a difference you can remove in your own copy. Parity between ports is +capability parity: every port gets every capability unless a ruling says it differs, and the output +stays idiomatic to each language. The rest (the list default of a project without `api.pagination`, Python's field names and data access) are known gaps rather than design, and the roadmap closes several of them. When one closes, its row diff --git a/docs/features/own-your-codegen.md b/docs/features/own-your-codegen.md index 5bbab81a3e..273d1ee3cd 100644 --- a/docs/features/own-your-codegen.md +++ b/docs/features/own-your-codegen.md @@ -5,11 +5,12 @@ the **durable spine**. You own the generated code in your repo — it runs witho MetaObjects runtime dependency, and if `@metaobjectsdev/*` (or the Maven/PyPI/NuGet packages) disappeared, you keep working code. -**Generators are reference helpers, not guarantees** ([ADR-0034 Amendment 3](../../spec/decisions/ADR-0034-codegen-scaffold-and-own.md#amendment-3-2026-09-22--generators-are-reference-helpers-the-core-is-what-metaobjects-guarantees)). -What MetaObjects guarantees is the core — the metamodel and loader, runtime metadata -access, `meta migrate`, `meta verify`, prompt render and the reply parser. Every generator -that writes application code into your repo is a starting point: it compiles and passes -its reference fixtures, and you copy it and own it. A defect in the reference is fixed +**Generators are supported helpers, not core guarantees** ([ADR-0034 Amendments 3 and 11](../../spec/decisions/ADR-0034-codegen-scaffold-and-own.md#amendment-11-2026-11-19--the-core-is-contracts-and-conformance-kits-and-generated-code-is-real-code)). +What MetaObjects guarantees is the core: the contracts and the conformance kits — the metamodel +and loader, the store-neutral contracts, `meta verify`, prompt render and the reply parser. +Store-specific code and every generator that writes application code into your repo are +helpers: they compile and pass their reference fixtures, and what they generate is real code. +Run it as shipped, extend it through hooks, or copy the generator with `meta eject` and own it. A defect in the reference is fixed there; your copy is yours. **Need an output nothing here emits? Write the generator.** That is the primary path, not diff --git a/docs/features/stability-labels.md b/docs/features/stability-labels.md new file mode 100644 index 0000000000..8e9fe2163b --- /dev/null +++ b/docs/features/stability-labels.md @@ -0,0 +1,45 @@ +# Stability labels + +Three words describe how settled a piece of MetaObjects is: **stable**, **preview** and +**experimental**. This page lists which pieces carry which word today. It is a list of +facts, not a promise: it adds no support window and no fix time, and it changes nothing in +the [compatibility policy](../compatibility-policy.md), which stands as written. + +## What the words mean + +| Label | Meaning | +|---|---| +| **stable** | Covered by the compatibility policy. Additive within a MINOR; a break needs a MAJOR (or, for the metadata contract, a `metamodelVersion` major). | +| **preview** | Exempt from that promise. The shape may change in a MINOR, including removals and renames. Promoted on evidence: one external estate running it with the drift gate enforced. | +| **experimental** | New vocabulary that registers, loads and validates, and whose shape may change in a MINOR until generated code runs on it in an adopter estate with the drift gate enforced. A model that declares none of it is unaffected. | + +## What carries which label today + +| Piece | Label | Where it is defined | +|---|---|---| +| Metamodel, loader, canonical format, registry | stable | [Compatibility policy](../compatibility-policy.md) | +| `meta verify` and its drift gates | stable | [Compatibility policy](../compatibility-policy.md) | +| Prompt render and the reply parser | stable | [Compatibility policy](../compatibility-policy.md) | +| Generators and their generated code in TypeScript, Java, Kotlin, C# and Python | supported helpers, compiled and tested against their fixtures; their internals are not a public API | [Own your codegen](own-your-codegen.md), ADR-0034 Amendment 11 | +| Library `ai` | stable | [Libraries](libraries.md) | +| Library `iam` | preview | [Libraries](libraries.md) | +| Rust port | preview, unpublished | [Rust port](../ports/rust.md), ADR-0065 | +| Angular packages | source-only, on their own `0.6` line, not published | ADR-0048 | +| Business-rules vocabulary: `api.*`, `operation.*`, `binding.*`, `transition.*`, `@permission`, `@public`, and the `rules` and `verify.lifecycle` settings | experimental | [Business rules](business-rules.md), ADR-0066 | +| Reserved names (`transition.timed`, the event and streaming sibling of `api.operational`, `index.fulltext`, `index.vector`, `index.spatial`) | reserved: not in the registry | [Compatibility policy](../compatibility-policy.md) | + +## What is not here yet + +- **Helper versions.** In 1.3.0 every published package still moves with its registry's + lockstep line. ADR-0035 Amendment 6 records the ruling that each helper package will carry its + own version, a stable one starting at `1.x` and a new one at `0.x`, and that existing code moves + after 1.3.0. +- **A label per generator.** `meta gen --list` prints a `stability` for each library. It does not + yet print one for each generator, and a generated file carries no stability header. + +## Where a label is written + +- A library's `stability` is in its manifest and is printed by `meta gen --list`. +- The business-rules label is in the compatibility policy, the CHANGELOG entry for 1.3.0, and + [Business rules](business-rules.md). +- A port's preview status is on its page under `docs/ports/`. diff --git a/docs/llms/llms-full.txt b/docs/llms/llms-full.txt index b5d66b6688..41342b8de2 100644 --- a/docs/llms/llms-full.txt +++ b/docs/llms/llms-full.txt @@ -57,7 +57,7 @@ The pillars are views on the same metadata, not separate products, and each carr Reference generators you own, ejectable in every port. They emit per-language code from a single metadata model. -**What is guaranteed, and what is yours** (ADR-0034 Amendment 3). The core is the promise: the metamodel, loader, canonical format and registry; runtime metadata access (the `ObjectManager`, not the HTTP adapters that mount it); schema migrations (`meta migrate`); the drift gates (`meta verify`); prompt render and the reply parser. Every generator that writes application code into the repo is a reference helper — a starting point that compiles and passes its reference fixtures, which the adopter copies with `meta eject` and owns. A defect in the core is a MetaObjects bug; a defect in a generator is fixed in the reference, and the adopter's copy is theirs. The test is mechanical: what the tool guarantees is core; what it writes into your repo is a helper. +**What is guaranteed, and what is yours** (ADR-0034 Amendments 3 and 11). The core is the contracts and the conformance kits, and it is the promise: the metamodel, loader, canonical format and registry; the store-neutral contracts (the expected schema and the guarded update); 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 application code into the repo are supported helpers: they compile and pass their reference fixtures, every port gets the same capabilities unless a ruling says otherwise, and 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 in the core is a MetaObjects bug; a defect in a helper is fixed in the reference, and an adopter's ejected copy is theirs. The test is mechanical: what the tool guarantees as a contract is core; what it writes into your repo or a store is a helper. - TypeScript: Drizzle + Zod + Fastify integration (and React / TanStack on the client side). **Keep your ORM:** a target with `runtime: false` makes the `entity` generator write Zod schemas and inferred types only, with no Drizzle and no `runtime-ts` import. **Prisma:** `orm: "prisma"` also generates `schema.prisma` from the model (Postgres, MySQL, SQLite) with `prismaSchemaFile()`, and `verify --codegen` and `verify --db` fail when Prisma and the model drift (`docs/recipes/prisma.md`) - Java: Spring REST + DTO + repository interfaces (the persistence impl is consumer-supplied) via `codegen-spring`. **Keep your ORM:** `SpringDtoGenerator` and `SpringValueObjectGenerator` write records (jakarta validation) and your JPA entity stays hand-written. Baseline Java 21, Spring Boot 3.x (Boot 2 is not supported) diff --git a/docs/llms/llms.txt b/docs/llms/llms.txt index 8efd170782..c8cc871604 100644 --- a/docs/llms/llms.txt +++ b/docs/llms/llms.txt @@ -12,7 +12,7 @@ It protects what the model declares. Your hand-written logic is still yours. **Write your own generators; expect to.** Documentation is a generator too (`docsFile()`, `apiDocsFile()`; `meta init --with-docs` wires them). The reference generators cover the common cases, but a team should plan to write the ones its application needs: a typed client, a service layer in your house style. A generator you own is what keeps the output from drifting, because it is regenerated on every model change and `verify --codegen` fails the build when committed output is stale. Hand-writing something the model fully describes is the thing to avoid. In TypeScript, `meta generator new ` writes a working one and wires it. See [Write your own generator](https://github.com/metaobjectsdev/metaobjects/blob/main/docs/recipes/write-your-own-generator.md) for every port, and [a typed client for the reference routes](https://github.com/metaobjectsdev/metaobjects/blob/main/docs/recipes/typed-client-for-the-reference-routes.md) for a worked example. -**What is guaranteed, and what is yours** (ADR-0034 Amendment 3). The core is the promise. It is the metamodel, loader, canonical format and registry; runtime metadata access (the `ObjectManager`, not the HTTP adapters that mount it); schema migrations (`meta migrate`); the drift gates (`meta verify`); and prompt render and the reply parser. All of it is conformance-gated and the same in every port that ships it. Every generator that writes application code into the repo (routes, controllers, ORM wiring, DTOs, forms, grids, hooks) is a reference helper: a starting point that compiles and passes its reference fixtures, which the adopter copies with `meta eject` and owns. A defect in the core is a MetaObjects bug; a defect in a generator is fixed in the reference, and the adopter's copy is theirs. Every port can eject: `meta eject` (TypeScript), `metaobjects eject` (Python), `mvn metaobjects:eject` (Java/Kotlin), `dotnet meta eject` (C#). If an ejected copy never changed from the shipped reference, `meta eject --undo` removes it, and `meta gen` says when it finds one. Python, Java/Kotlin and C# have the same switch (`metaobjects eject --undo`, `mvn metaobjects:eject -Dundo=true`, `dotnet meta eject --undo`). There is no `meta doctor`; `meta eject --list` is the report. +**What is guaranteed, and what is yours** (ADR-0034 Amendments 3 and 11). The core is the contracts and the conformance kits, and it is the promise: the metamodel, loader, canonical format and registry; the store-neutral contracts (the expected schema and the guarded update); the drift gates (`meta verify`); and prompt render and the reply parser. All of it is conformance-gated and the same in every port that ships it. Store-specific code (SQL writers, introspectors, drivers such as the `ObjectManager` drivers and the `meta migrate` writer, mappings) and every generator that writes application code into the repo (routes, controllers, ORM wiring, DTOs, forms, grids, hooks) are supported helpers: they compile and pass their reference fixtures, every port gets the same capabilities unless a ruling says otherwise, and 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 in the core is a MetaObjects bug; a defect in a helper is fixed in the reference, and an adopter's ejected copy is theirs. Every port can eject: `meta eject` (TypeScript), `metaobjects eject` (Python), `mvn metaobjects:eject` (Java/Kotlin), `dotnet meta eject` (C#). If an ejected copy never changed from the shipped reference, `meta eject --undo` removes it, and `meta gen` says when it finds one. Python, Java/Kotlin and C# have the same switch (`metaobjects eject --undo`, `mvn metaobjects:eject -Dundo=true`, `dotnet meta eject --undo`). There is no `meta doctor`; `meta eject --list` is the report. The model is the part you keep, and the generated code can be thrown away and regenerated. Your typed metadata lives in your repo as YAML or JSON you own. The generated code carries **no proprietary runtime**: the entity and model tier has no dependencies, and the optional client, prompt-render and runtime tiers are ordinary Apache-2.0 packages you could vendor or fork. If `@metaobjectsdev/*` (npm) or `com.metaobjects:*` (Maven) disappears tomorrow, you keep working code in every language. diff --git a/docs/ports/java.md b/docs/ports/java.md index c67e36673c..ec7540a879 100644 --- a/docs/ports/java.md +++ b/docs/ports/java.md @@ -886,7 +886,7 @@ engine, `com.metaobjects.config.SharedModel`, stays in the package, so the owned **Ejecting hands over the helper runtime too.** The `routes`, `dto` and `repository` output imports helper classes from `com.metaobjects.generator.spring.runtime` (`FilterParser`, `FilterParseResult`, `FilterPredicate`, `PatchValidationException`, `ConstraintErrors`, `RecordComponentNames`). These are helpers, not core. Ejecting one of those generators copies the classes its output imports into `src/main/java//` (default `.runtime`) of the module that compiles the generated code, and the owned generator's output imports that copy. The copies are JDK-only. The owned web tier then builds with no MetaObjects artifact on the application classpath, and you can fix a helper bug in your copy without waiting for a release. A packaged generator that must use the same copy takes `…`. What stays core: the loader and registry, render and extract, OMDB and `metaobjects-om`. `mvn metaobjects:verify` treats the copies as owned code, not stale output. The table, the aggregator rule and a diff recipe for pulling an upstream fix are in [Own your codegen → What eject hands over](../features/own-your-codegen.md#what-eject-hands-over-and-what-stays-core). -The built-in set above is a starting point, not the ceiling. When you need a shape +The built-in set above is not the ceiling. When you need a shape it does not emit, the JVM port gives you **both** authoring paths, and which one to reach for is a real decision — see the tradeoff table in [`codegen-concepts.md` §3](../features/codegen-concepts.md). diff --git a/docs/ports/kotlin.md b/docs/ports/kotlin.md index 6ff94a2ba3..34ba5779db 100644 --- a/docs/ports/kotlin.md +++ b/docs/ports/kotlin.md @@ -312,7 +312,7 @@ copies `KotlinSharedModelGenerator.kt` into a `codegen/` module under your packa ### Declarative template-codegen (`TemplateScopeGenerator`) -The 18 generators above are a starting point, not the ceiling. When you need a shape +The 18 generators above are not the ceiling. When you need a shape none of them emits, Kotlin has **both** authoring paths — and which to reach for is a real decision (tradeoff table: [`codegen-concepts.md` §3](../features/codegen-concepts.md)). diff --git a/spec/decisions/ADR-0034-codegen-scaffold-and-own.md b/spec/decisions/ADR-0034-codegen-scaffold-and-own.md index 7a50e45b70..47f379e306 100644 --- a/spec/decisions/ADR-0034-codegen-scaffold-and-own.md +++ b/spec/decisions/ADR-0034-codegen-scaffold-and-own.md @@ -51,7 +51,7 @@ component library — code you copy into your project and own." logic** (this was the intent, not yet what every generator shipped: see Amendment 8). Tooling stays minimal: `meta init` scaffolds a sensible default generator set + local-import config for a running start; it does **not** interview the - project or select templates. **Adding a new starting point is adding a documented + project or select templates. **Adding a new template is adding a documented file, never a CLI change.** 3. **"Force" by making generators scaffold-only — there is no black-box to fight.** @@ -62,7 +62,7 @@ component library — code you copy into your project and own." 4. **Conformance gates the reference templates, not consumer forks.** The scaffolded reference templates stay byte-gated by the codegen conformance corpus (they must - be correct starting points). A consumer's owned fork is theirs and ungated. The + be correct). A consumer's owned fork is theirs and ungated. The engine + primitives stay strictly versioned and tested. 5. **Authoring is a menu — all options exposed, not one mechanism per port.** Owning @@ -73,7 +73,7 @@ component library — code you copy into your project and own." `MetaObjects.Render`), **Groovy** scripting on the JVM, or **cross-language generation** (a TS/Python generator emitting Java/C#/Kotlin, since the metamodel loader *and* render engine exist in every port). The library ships reference - starting points in each form; the consumer/Claude picks. Native classes are + templates in each form; the consumer/Claude picks. Native classes are port-bound; Mustache and cross-language travel. This dissolves the "compiled ports are awkward to copy" concern — Mustache and cross-language give clean, owned, portable options alongside extend-the-class. @@ -114,7 +114,7 @@ Decision 2 left the copy to "plain file operations" by a human or Claude, with command: `meta eject ` copies ANY reference template, from any package, at any time after `init`, reporting the import line to wire and the packages the copied file needs. The doctrine is unchanged — the adopter owns the file, and `meta gen` runs their -copy — but "adding a starting point is adding a documented file" now also means it is +copy — but "adding a template is adding a documented file" now also means it is reachable by name. ### Amendment 2 (2026-09-13) — codegen is OPT-IN; `init` scaffolds an empty selection @@ -142,7 +142,7 @@ is an LLM in the repo, which is well able to make the call given a truthful cata is badly served by a default that pre-empts it. **Everything else in ADR-0034 stands** — the engine/template split, scaffold-and-own -ownership, no interview, and "adding a starting point is adding a documented file, +ownership, no interview, and "adding a template is adding a documented file, never a CLI change". **Compatibility.** This is a PATCH. No existing project changes by one byte: an adopter @@ -159,12 +159,12 @@ Design: `docs/superpowers/specs/2026-09-12-opt-in-codegen-and-generator-catalog- **Clarifies:** Decision 4 ("conformance gates the reference templates … they must be correct starting points") and the positioning that lists codegen as the first capability. -**Ruling.** MetaObjects has two layers, and only the first is a product promise. +**Ruling.** MetaObjects has two layers, and only the first is a product promise. *(Amendment 11 changes what the first layer contains, lifts the REST freeze below and replaces the parity ruling below with capability parity.)* | Layer | What it is | Promise | |---|---|---| | **Core** | The metamodel, loader, canonical format and registry; runtime metadata access (the `ObjectManager` and its drivers, not the HTTP adapters that mount it); schema migrations (`meta migrate`); the drift gates (`meta verify`); prompt render and the reply parser | Conformance-gated, identical behaviour in every port that ships it, covered by `docs/compatibility-policy.md`. A defect here is a MetaObjects bug. | -| **Helpers** | Every generator that writes application code into the adopter's repo: routes, controllers, ORM wiring, DTOs, forms, grids, hooks, filter allowlists | Reference starting points. They compile and pass the reference fixtures; the adopter copies them with `meta eject` and owns the copy. A defect in the reference is fixed there, and an adopter's copy is theirs to fix. | +| **Helpers** | Every generator that writes application code into the adopter's repo: routes, controllers, ORM wiring, DTOs, forms, grids, hooks, filter allowlists | Reference helpers. They compile and pass the reference fixtures; the adopter runs them as shipped or copies them with `meta eject` and owns the copy. A defect in the reference is fixed there, and an adopter's copy is theirs to fix. | The line is a mechanical test: **what the tool guarantees is core; what it writes into your repo is a helper.** Migrations are written into the repo too, but `meta migrate` @@ -280,8 +280,8 @@ eject command (`docs/features/own-your-codegen.md`, "Per port"). **Ruling (maintainer).** MetaObjects is a solid core — the typed model, loader, registry, `verify`, `migrate`, prompt render and reply extract — and on that core **adopters build their own code generators** for whatever they need: OpenAPI, JSON Schema, Zod, DTOs, -clients, docs, anything. The reference generators are examples and starting points to -eject and modify, not the product. Skills, docs and agent context PUSH people and their +clients, docs, anything. The reference generators emit real code you can run as shipped, and are +examples to eject and modify, not the product. Skills, docs and agent context PUSH people and their coding agents to write a generator whenever they need an output nothing ships, and make that feel easy. @@ -1227,3 +1227,43 @@ maintainer decided the emitter is the next feature (FR-022). stay as worked examples of writing one, and say that a stock generator now exists. **Packaged output.** Two new generators. No existing generator emits different bytes. + +### Amendment 11 (2026-11-19) — the core is contracts and conformance kits, and generated code is real code + +**Rulings (maintainer, 2026-11-12 and 2026-11-13).** Four points of Amendment 3 are replaced, and +one wording rule is added. Nothing here changes the engine, the `Generator` interface, the +scaffold-and-own contract or the compatibility policy. + +1. **The core is the contracts and the conformance kits.** Store-specific code (SQL writers, + introspectors, drivers, mappings) is a **supported helper**, not core. The first layer of + Amendment 3's table now reads: the metamodel, loader, canonical format and registry; the + store-neutral contracts (the expected schema and the guarded update of ADR-0066 §6); the drift + gates (`meta verify`); prompt render and the reply parser; and the conformance kits that hold + every port to them. The `ObjectManager` drivers, the `meta migrate` writer and the HTTP adapters + are supported helpers. A helper still compiles, passes its reference fixtures and is fixed in + the reference when it is wrong; it is not named in the compatibility promise. +2. **The REST freeze is lifted.** The ruling that generated REST templates outside TypeScript + are frozen no longer stands. New REST features go to every port. +3. **Parity is capability parity.** The ruling that cross-port parity is not required of helpers no + longer stands. Every port gets every capability and every refusal of a change unless a ruling or + an ADR deliberately makes it differ. Parity is capability, not identical output: each port + still writes its own language's idiom (ADR-0019 Amendment 2), and a difference that is kept is + recorded in `docs/features/language-differences.md`. +4. **Generated code is real code.** A generator's output is code an adopter ships. They run it as + shipped, extend it through the hooks a generator provides, or copy the generator with + `meta eject` and own the copy. Documents about generated code do not call it a starter, a + starting point or throwaway. (The older word "starting point" for a reference template survives + only where it names a template an adopter copies to write their own generator.) + +**Versions of helpers.** Each helper package carries its own version, and its starting major +reflects its readiness: a stable, proven helper starts at 1.x and a new or unstable one at 0.x +(see ADR-0035 Amendment 6). Helpers graduate to 1.x by readiness. + +**Stability labels, not a promise.** New code goes in helper packages at 0.x. A contract-level +addition (new vocabulary) carries an `experimental` label until it is proven in use. The labels are +facts, listed in `docs/features/stability-labels.md`. MetaObjects publishes no new support window or +promise with them; `docs/compatibility-policy.md` stands as written. + +**What does not change.** Amendment 3's mechanical test, restated: what the tool guarantees as a +contract is core; what it writes into your repo or a store is a helper. The engine, the layout +and the eject contract stay covered by the compatibility policy. diff --git a/spec/decisions/ADR-0035-one-zero-stability-commitment-and-version-unification.md b/spec/decisions/ADR-0035-one-zero-stability-commitment-and-version-unification.md index 080853fc85..b9e088c225 100644 --- a/spec/decisions/ADR-0035-one-zero-stability-commitment-and-version-unification.md +++ b/spec/decisions/ADR-0035-one-zero-stability-commitment-and-version-unification.md @@ -485,6 +485,29 @@ the same release that first writes three. **Until it lands**, the gate and the p - **A feature-level two-component `metamodelVersion` that ignores augmentations.** Rejected: a model that uses an augmentation would need a newer port with no number saying so. +## Amendment 6 (2026-11-19) — one version per helper package, starting by readiness + +**Rulings (maintainer, 2026-11-13).** Amendment 4 made the generator tier convenience and its +changes PATCH. ADR-0034 Amendment 11 now places store-specific code and generators in supported +helpers. This amendment says how a helper is numbered. + +1. **Each helper package carries its own version.** A helper is not on the lockstep line the core + packages share. The convergent-publishing rule and the lockstep set + (`scripts/publish-set.mjs`) are unchanged for the core; a helper joins them only by a separate, + explicit decision, because the intent check refuses a public package that is off the line unless + it is declared source-only. +2. **A helper starts at the major its readiness earns.** A stable, proven helper starts at `1.x`. + A new or unstable one starts at `0.x` and graduates to `1.x` by readiness, on evidence, the way + a `preview` library is promoted. Existing code moves to this model after 1.3.0, not in it. +3. **A contract-level addition carries an `experimental` label until it is proven.** New vocabulary + is the case: it registers, loads and validates, and its shape may change in a MINOR until it has + run in an adopter estate with the drift gate enforced. Labels are listed as facts in + `docs/features/stability-labels.md`. +4. **No support window is published.** The compatibility policy stands as written, and this + amendment adds no support or fix-time commitment. + +This amendment is documentation of a ruling. It moves no package and publishes nothing. + ## Consequences - After 1.0, a breaking change to the CLI surface or the scaffold-and-own contract diff --git a/spec/decisions/ADR-0066-business-rules-operations-and-lifecycles.md b/spec/decisions/ADR-0066-business-rules-operations-and-lifecycles.md index cc13aa84d5..1aa93d49fc 100644 --- a/spec/decisions/ADR-0066-business-rules-operations-and-lifecycles.md +++ b/spec/decisions/ADR-0066-business-rules-operations-and-lifecycles.md @@ -287,7 +287,9 @@ The shells are later work. This is what they are held to: 7. Refuse a lifecycle field on the generic update path (409 `state_managed`). **The guarded update is part of the store-neutral storage contract** (§8). Every store -driver, including one an adopter writes, is held to it by a persistence-conformance scenario. +driver, including one an adopter writes, will be held to it by a persistence-conformance scenario. +That scenario does not exist yet: no file under `fixtures/persistence-conformance/` pins the +guarded update, so until it lands the contract is stated here and implemented, not yet gated. ### 7. Events and invariants in 1.3.0 diff --git a/spec/decisions/ADR-0067-layering-and-the-service-seam.md b/spec/decisions/ADR-0067-layering-and-the-service-seam.md index b1906fb16b..1a48bb2009 100644 --- a/spec/decisions/ADR-0067-layering-and-the-service-seam.md +++ b/spec/decisions/ADR-0067-layering-and-the-service-seam.md @@ -84,9 +84,10 @@ permission, the adopter's implementation stops compiling. In Python the type che start-up check say what is missing. Hand-written code cannot reach the shell's internals, so it cannot bypass the shell's guarantees with an override. -There is no generated base class to extend, and C# does not use partial methods. A partial -class is the same class, so hand-written code would see the shell's private state and could -call around it. +There is no generated base class to extend, and C# does not use partial methods. That was the +design's choice, taken as the safer one; no separate ruling decided it, and it can be reopened +by a later ruling. A partial class is the same class, so hand-written code would see the +shell's private state and could call around it. ### 4. Per language @@ -198,4 +199,4 @@ no existing output churns. Events are kept for derived CRUD as optional before and after hooks per verb (`layers.crudHooks`), inside the operation's transaction (§4). They may refuse or replace the input, but they never choose which operation runs. -- **C# partial methods.** Rejected by the attachment ruling (§3). +- **C# partial methods.** Rejected by the design's choice of an interface-only attachment (§3). From 4b610f2177182245a628e49acc6920ae20a59667 Mon Sep 17 00:00:00 2001 From: Doug Mealing Date: Thu, 19 Nov 2026 23:24:15 -0500 Subject: [PATCH 2/3] test: regenerate the agent-context conformance expected files for the reworded owning-generators reference --- .../metaobjects-codegen/references/owning-generators.md | 9 +++++---- .../metaobjects-codegen/references/owning-generators.md | 9 +++++---- .../metaobjects-codegen/references/owning-generators.md | 9 +++++---- .../metaobjects-codegen/references/owning-generators.md | 9 +++++---- .../metaobjects-codegen/references/owning-generators.md | 9 +++++---- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/fixtures/agent-context-conformance/csharp/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md b/fixtures/agent-context-conformance/csharp/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md index c78c097891..6a3c67de0f 100644 --- a/fixtures/agent-context-conformance/csharp/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md +++ b/fixtures/agent-context-conformance/csharp/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md @@ -27,16 +27,17 @@ Then do **not**: - pin an older MetaObjects release, or wait for a newer one, to get past it; - branch, patch, or rebuild a clone of the MetaObjects repository. -The reference generators are starting points you take a copy of. They are +The reference generators emit real code, and you may take a copy of one. They are conformance-gated so the copy starts out correct — not so that each project's output becomes the library's problem. Once you run a generator in your build, what it emits for your model is yours, exactly as if you had written it. **What is legitimately upstream** is only what you cannot own: the **loader and metamodel** (valid metadata rejected, invalid metadata accepted, a wrong resolution), the -**core runtime** your app imports (the metadata-driven `ObjectManager`, prompt render, the -reply parser — not an HTTP adapter you ejected, which is yours), the **codegen engine -itself** (the runner, the three-way merge, `verify`), and **`meta migrate`**. The test is +**core contracts and runtime** your app imports (prompt render, the reply parser, the +store-neutral contracts — not an HTTP adapter you ejected, which is yours), the **codegen engine +itself** (the runner, the three-way merge, `verify`), and the **store-specific helpers you +cannot eject** (the `ObjectManager` drivers and `meta migrate`), which MetaObjects supports and fixes. The test is mechanical: if changing a generator — or a file eject copied beside it — fixes it, it is yours. diff --git a/fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md b/fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md index c78c097891..6a3c67de0f 100644 --- a/fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md +++ b/fixtures/agent-context-conformance/java-kotlin-react-tanstack/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md @@ -27,16 +27,17 @@ Then do **not**: - pin an older MetaObjects release, or wait for a newer one, to get past it; - branch, patch, or rebuild a clone of the MetaObjects repository. -The reference generators are starting points you take a copy of. They are +The reference generators emit real code, and you may take a copy of one. They are conformance-gated so the copy starts out correct — not so that each project's output becomes the library's problem. Once you run a generator in your build, what it emits for your model is yours, exactly as if you had written it. **What is legitimately upstream** is only what you cannot own: the **loader and metamodel** (valid metadata rejected, invalid metadata accepted, a wrong resolution), the -**core runtime** your app imports (the metadata-driven `ObjectManager`, prompt render, the -reply parser — not an HTTP adapter you ejected, which is yours), the **codegen engine -itself** (the runner, the three-way merge, `verify`), and **`meta migrate`**. The test is +**core contracts and runtime** your app imports (prompt render, the reply parser, the +store-neutral contracts — not an HTTP adapter you ejected, which is yours), the **codegen engine +itself** (the runner, the three-way merge, `verify`), and the **store-specific helpers you +cannot eject** (the `ObjectManager` drivers and `meta migrate`), which MetaObjects supports and fixes. The test is mechanical: if changing a generator — or a file eject copied beside it — fixes it, it is yours. diff --git a/fixtures/agent-context-conformance/java-react/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md b/fixtures/agent-context-conformance/java-react/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md index c78c097891..6a3c67de0f 100644 --- a/fixtures/agent-context-conformance/java-react/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md +++ b/fixtures/agent-context-conformance/java-react/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md @@ -27,16 +27,17 @@ Then do **not**: - pin an older MetaObjects release, or wait for a newer one, to get past it; - branch, patch, or rebuild a clone of the MetaObjects repository. -The reference generators are starting points you take a copy of. They are +The reference generators emit real code, and you may take a copy of one. They are conformance-gated so the copy starts out correct — not so that each project's output becomes the library's problem. Once you run a generator in your build, what it emits for your model is yours, exactly as if you had written it. **What is legitimately upstream** is only what you cannot own: the **loader and metamodel** (valid metadata rejected, invalid metadata accepted, a wrong resolution), the -**core runtime** your app imports (the metadata-driven `ObjectManager`, prompt render, the -reply parser — not an HTTP adapter you ejected, which is yours), the **codegen engine -itself** (the runner, the three-way merge, `verify`), and **`meta migrate`**. The test is +**core contracts and runtime** your app imports (prompt render, the reply parser, the +store-neutral contracts — not an HTTP adapter you ejected, which is yours), the **codegen engine +itself** (the runner, the three-way merge, `verify`), and the **store-specific helpers you +cannot eject** (the `ObjectManager` drivers and `meta migrate`), which MetaObjects supports and fixes. The test is mechanical: if changing a generator — or a file eject copied beside it — fixes it, it is yours. diff --git a/fixtures/agent-context-conformance/python/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md b/fixtures/agent-context-conformance/python/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md index c78c097891..6a3c67de0f 100644 --- a/fixtures/agent-context-conformance/python/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md +++ b/fixtures/agent-context-conformance/python/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md @@ -27,16 +27,17 @@ Then do **not**: - pin an older MetaObjects release, or wait for a newer one, to get past it; - branch, patch, or rebuild a clone of the MetaObjects repository. -The reference generators are starting points you take a copy of. They are +The reference generators emit real code, and you may take a copy of one. They are conformance-gated so the copy starts out correct — not so that each project's output becomes the library's problem. Once you run a generator in your build, what it emits for your model is yours, exactly as if you had written it. **What is legitimately upstream** is only what you cannot own: the **loader and metamodel** (valid metadata rejected, invalid metadata accepted, a wrong resolution), the -**core runtime** your app imports (the metadata-driven `ObjectManager`, prompt render, the -reply parser — not an HTTP adapter you ejected, which is yours), the **codegen engine -itself** (the runner, the three-way merge, `verify`), and **`meta migrate`**. The test is +**core contracts and runtime** your app imports (prompt render, the reply parser, the +store-neutral contracts — not an HTTP adapter you ejected, which is yours), the **codegen engine +itself** (the runner, the three-way merge, `verify`), and the **store-specific helpers you +cannot eject** (the `ObjectManager` drivers and `meta migrate`), which MetaObjects supports and fixes. The test is mechanical: if changing a generator — or a file eject copied beside it — fixes it, it is yours. diff --git a/fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md b/fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md index c78c097891..6a3c67de0f 100644 --- a/fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md +++ b/fixtures/agent-context-conformance/ts-react-tanstack/expected/.claude/skills/metaobjects-codegen/references/owning-generators.md @@ -27,16 +27,17 @@ Then do **not**: - pin an older MetaObjects release, or wait for a newer one, to get past it; - branch, patch, or rebuild a clone of the MetaObjects repository. -The reference generators are starting points you take a copy of. They are +The reference generators emit real code, and you may take a copy of one. They are conformance-gated so the copy starts out correct — not so that each project's output becomes the library's problem. Once you run a generator in your build, what it emits for your model is yours, exactly as if you had written it. **What is legitimately upstream** is only what you cannot own: the **loader and metamodel** (valid metadata rejected, invalid metadata accepted, a wrong resolution), the -**core runtime** your app imports (the metadata-driven `ObjectManager`, prompt render, the -reply parser — not an HTTP adapter you ejected, which is yours), the **codegen engine -itself** (the runner, the three-way merge, `verify`), and **`meta migrate`**. The test is +**core contracts and runtime** your app imports (prompt render, the reply parser, the +store-neutral contracts — not an HTTP adapter you ejected, which is yours), the **codegen engine +itself** (the runner, the three-way merge, `verify`), and the **store-specific helpers you +cannot eject** (the `ObjectManager` drivers and `meta migrate`), which MetaObjects supports and fixes. The test is mechanical: if changing a generator — or a file eject copied beside it — fixes it, it is yours. From f7b9880b73df6f86890d1d1522a659a69a30496f Mon Sep 17 00:00:00 2001 From: Doug Mealing Date: Thu, 19 Nov 2026 23:26:32 -0500 Subject: [PATCH 3/3] no-mistakes(review): Caveat guarded-update gate claim in core lists --- README.md | 2 +- docs/llms/llms-full.txt | 2 +- docs/llms/llms.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f7060dfa07..cfe8a9d98e 100644 --- a/README.md +++ b/README.md @@ -222,7 +222,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); 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 kits: the metamodel, loader, canonical format and registry; the store-neutral contracts (the expected schema, and the guarded update once its persistence-conformance scenario lands, 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 | diff --git a/docs/llms/llms-full.txt b/docs/llms/llms-full.txt index 41342b8de2..f2870454c2 100644 --- a/docs/llms/llms-full.txt +++ b/docs/llms/llms-full.txt @@ -57,7 +57,7 @@ The pillars are views on the same metadata, not separate products, and each carr Reference generators you own, ejectable in every port. They emit per-language code from a single metadata model. -**What is guaranteed, and what is yours** (ADR-0034 Amendments 3 and 11). The core is the contracts and the conformance kits, and it is the promise: the metamodel, loader, canonical format and registry; the store-neutral contracts (the expected schema and the guarded update); 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 application code into the repo are supported helpers: they compile and pass their reference fixtures, every port gets the same capabilities unless a ruling says otherwise, and 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 in the core is a MetaObjects bug; a defect in a helper is fixed in the reference, and an adopter's ejected copy is theirs. The test is mechanical: what the tool guarantees as a contract is core; what it writes into your repo or a store is a helper. +**What is guaranteed, and what is yours** (ADR-0034 Amendments 3 and 11). The core is the contracts and the conformance kits, and it is the promise: the metamodel, loader, canonical format and registry; the store-neutral contracts (the expected schema, and the guarded update once its persistence-conformance scenario lands, 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 application code into the repo are supported helpers: they compile and pass their reference fixtures, every port gets the same capabilities unless a ruling says otherwise, and 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 in the core is a MetaObjects bug; a defect in a helper is fixed in the reference, and an adopter's ejected copy is theirs. The test is mechanical: what the tool guarantees as a contract is core; what it writes into your repo or a store is a helper. - TypeScript: Drizzle + Zod + Fastify integration (and React / TanStack on the client side). **Keep your ORM:** a target with `runtime: false` makes the `entity` generator write Zod schemas and inferred types only, with no Drizzle and no `runtime-ts` import. **Prisma:** `orm: "prisma"` also generates `schema.prisma` from the model (Postgres, MySQL, SQLite) with `prismaSchemaFile()`, and `verify --codegen` and `verify --db` fail when Prisma and the model drift (`docs/recipes/prisma.md`) - Java: Spring REST + DTO + repository interfaces (the persistence impl is consumer-supplied) via `codegen-spring`. **Keep your ORM:** `SpringDtoGenerator` and `SpringValueObjectGenerator` write records (jakarta validation) and your JPA entity stays hand-written. Baseline Java 21, Spring Boot 3.x (Boot 2 is not supported) diff --git a/docs/llms/llms.txt b/docs/llms/llms.txt index c8cc871604..ae83e1ecfa 100644 --- a/docs/llms/llms.txt +++ b/docs/llms/llms.txt @@ -12,7 +12,7 @@ It protects what the model declares. Your hand-written logic is still yours. **Write your own generators; expect to.** Documentation is a generator too (`docsFile()`, `apiDocsFile()`; `meta init --with-docs` wires them). The reference generators cover the common cases, but a team should plan to write the ones its application needs: a typed client, a service layer in your house style. A generator you own is what keeps the output from drifting, because it is regenerated on every model change and `verify --codegen` fails the build when committed output is stale. Hand-writing something the model fully describes is the thing to avoid. In TypeScript, `meta generator new ` writes a working one and wires it. See [Write your own generator](https://github.com/metaobjectsdev/metaobjects/blob/main/docs/recipes/write-your-own-generator.md) for every port, and [a typed client for the reference routes](https://github.com/metaobjectsdev/metaobjects/blob/main/docs/recipes/typed-client-for-the-reference-routes.md) for a worked example. -**What is guaranteed, and what is yours** (ADR-0034 Amendments 3 and 11). The core is the contracts and the conformance kits, and it is the promise: the metamodel, loader, canonical format and registry; the store-neutral contracts (the expected schema and the guarded update); the drift gates (`meta verify`); and prompt render and the reply parser. All of it is conformance-gated and the same in every port that ships it. Store-specific code (SQL writers, introspectors, drivers such as the `ObjectManager` drivers and the `meta migrate` writer, mappings) and every generator that writes application code into the repo (routes, controllers, ORM wiring, DTOs, forms, grids, hooks) are supported helpers: they compile and pass their reference fixtures, every port gets the same capabilities unless a ruling says otherwise, and 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 in the core is a MetaObjects bug; a defect in a helper is fixed in the reference, and an adopter's ejected copy is theirs. Every port can eject: `meta eject` (TypeScript), `metaobjects eject` (Python), `mvn metaobjects:eject` (Java/Kotlin), `dotnet meta eject` (C#). If an ejected copy never changed from the shipped reference, `meta eject --undo` removes it, and `meta gen` says when it finds one. Python, Java/Kotlin and C# have the same switch (`metaobjects eject --undo`, `mvn metaobjects:eject -Dundo=true`, `dotnet meta eject --undo`). There is no `meta doctor`; `meta eject --list` is the report. +**What is guaranteed, and what is yours** (ADR-0034 Amendments 3 and 11). The core is the contracts and the conformance kits, and it is the promise: the metamodel, loader, canonical format and registry; the store-neutral contracts (the expected schema, and the guarded update once its persistence-conformance scenario lands, ADR-0066 §6); the drift gates (`meta verify`); and prompt render and the reply parser. All of it is conformance-gated and the same in every port that ships it. Store-specific code (SQL writers, introspectors, drivers such as the `ObjectManager` drivers and the `meta migrate` writer, mappings) and every generator that writes application code into the repo (routes, controllers, ORM wiring, DTOs, forms, grids, hooks) are supported helpers: they compile and pass their reference fixtures, every port gets the same capabilities unless a ruling says otherwise, and 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 in the core is a MetaObjects bug; a defect in a helper is fixed in the reference, and an adopter's ejected copy is theirs. Every port can eject: `meta eject` (TypeScript), `metaobjects eject` (Python), `mvn metaobjects:eject` (Java/Kotlin), `dotnet meta eject` (C#). If an ejected copy never changed from the shipped reference, `meta eject --undo` removes it, and `meta gen` says when it finds one. Python, Java/Kotlin and C# have the same switch (`metaobjects eject --undo`, `mvn metaobjects:eject -Dundo=true`, `dotnet meta eject --undo`). There is no `meta doctor`; `meta eject --list` is the report. The model is the part you keep, and the generated code can be thrown away and regenerated. Your typed metadata lives in your repo as YAML or JSON you own. The generated code carries **no proprietary runtime**: the entity and model tier has no dependencies, and the optional client, prompt-render and runtime tiers are ordinary Apache-2.0 packages you could vendor or fork. If `@metaobjectsdev/*` (npm) or `com.metaobjects:*` (Maven) disappears tomorrow, you keep working code in every language.