From 11a41f90cfe99cefc4cbcd5535bec7b037db60ef Mon Sep 17 00:00:00 2001 From: Doug Mealing Date: Fri, 20 Nov 2026 22:34:45 -0500 Subject: [PATCH 1/6] docs(adr): re-cut ADR-0067 so a layer is a generator an app chooses, and add the actor and init rules --- CHANGELOG.md | 6 +- docs/features/business-rules.md | 5 +- ...erated-api-surface-owns-write-semantics.md | 16 +- ...usiness-rules-operations-and-lifecycles.md | 14 +- .../ADR-0067-layering-and-the-service-seam.md | 236 ++++++++++++------ 5 files changed, 189 insertions(+), 88 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a817abd8e0..db97cda069 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -347,9 +347,11 @@ Each item below is described in full under Security, Added, Changed or Fixed; th 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. + (ADR-0067: service generators an app chooses like any other, not a named set), 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. + ADR-0067 records the layering and service-seam design (a layer is a generator an app chooses; the + actor is a type the app defines), and amends ADR-0045. - **Rust port foundation, in preview (ADR-0065).** `server/rust/` is a Cargo workspace with a 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 diff --git a/docs/features/business-rules.md b/docs/features/business-rules.md index 111a2b4c64..834bdc2133 100644 --- a/docs/features/business-rules.md +++ b/docs/features/business-rules.md @@ -14,8 +14,9 @@ The Rust preview port loads the vocabulary and runs the same loader rules; its ` codegen drift gate only, so the checks under "What `verify` reports" do not run there ([Rust port](../ports/rust.md)). A requirement can claim an operation or a transition. Nothing is generated from the vocabulary -yet: the service shells that enforce these rules at run time are later work (ADR-0067). Until -they land, a model with this vocabulary generates byte-identical code to the same model +yet: the service shells that enforce these rules at run time are later work (ADR-0067): service +generators an app adds to its generator list, as it adds any generator. A lifecycle in a project +that wires none is advised by `verify`, with the flat routes enforcing nothing. Until they land, a model with this vocabulary generates byte-identical code to the same model without it. The design is [ADR-0066](../../spec/decisions/ADR-0066-business-rules-operations-and-lifecycles.md). **Experimental.** This vocabulary, its loader rules, its `verify` checks and its settings may diff --git a/spec/decisions/ADR-0045-generated-api-surface-owns-write-semantics.md b/spec/decisions/ADR-0045-generated-api-surface-owns-write-semantics.md index 21b41d4ff5..fdbfe6aa45 100644 --- a/spec/decisions/ADR-0045-generated-api-surface-owns-write-semantics.md +++ b/spec/decisions/ADR-0045-generated-api-surface-owns-write-semantics.md @@ -43,9 +43,9 @@ The gap survived because **no `@autoSet` scenario existed in `api-contract-confo ## Amendment 1 (2026-11-13): a generated service shell may hold the guarantee -ADR-0067 adds a `layered` generator set whose service layer enforces declared business rules -(ADR-0066). The transport of that set calls the service and holds no rules, so the decision -sentence above no longer describes it. It is replaced with: +ADR-0067 adds service generators, which an app chooses as it chooses any generator, and whose +service layer enforces declared business rules (ADR-0066). The transport of such a project calls +the service and holds no rules, so the decision sentence above no longer describes it. It is replaced with: **The outermost generated write-path artifact an adopter deploys must guarantee every metamodel-declared write semantic, either itself or by calling a generated service shell that @@ -54,13 +54,13 @@ operation body is called by the shell, inside the guarantee, and is not such a s The rest of the decision stands: -- The API surface stamps (item 1) in every set that has no service layer, which is the - `classic` set. +- The API surface stamps (item 1) in every project that wires no service generator, which is + today's flat generators. - Persistence-layer stamping stays (item 2). - Conformance gates the wire tier (item 3). The first rejected alternative ("rewire the Kotlin controller to delegate to the generated repository") was rejected because routing every controller through a lower layer "would churn -all generated output". The `layered` set does not do that. It is opt-in per package, and a -project that does not choose it keeps today's output byte for byte. So the objection does not -apply to it. It still applies to rewiring the `classic` set, which this amendment does not do. +all generated output". The service generators do not do that. They are separate generators an app adds, and a +project that does not add them keeps today's output byte for byte. So the objection does not +apply to them. It still applies to rewiring today's flat generators, which this amendment does not do. 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 1aa93d49fc..a63e1851c2 100644 --- a/spec/decisions/ADR-0066-business-rules-operations-and-lifecycles.md +++ b/spec/decisions/ADR-0066-business-rules-operations-and-lifecycles.md @@ -85,9 +85,13 @@ Attributes on operations: - every operation; - every transition that derives a command; -- in a layered service, every derived CRUD verb, when a setting turns that on. +- in a generated service, every derived CRUD verb, when an option of the service generator turns + that on. Its name is `..`, and a transition that shares a verb's name on + an entity is refused when the model loads. (Designed here; it lands with the service generator, + and nothing in 1.3.0 reads it.) -The enforcing shell calls the project's policy with the point's permission name, the actor, +The enforcing shell calls the project's policy with the point's permission name, the actor (a type +the app defines, ADR-0067 §7), the loaded row and the input, before anything is written. A type would only restate the operation. The model adds two facts, the name and `@public`. Who holds a permission is data, and what the policy decides is code. *The model names where a decision is needed, never what @@ -271,7 +275,9 @@ will be the first to act on it, and the documentation says so until they do. ### 6. What the enforcing shell will guarantee, for every transition -The shells are later work. This is what they are held to: +The shells are later work: service generators that an app adds (ADR-0067). A project that declares +a lifecycle and wires no service generator is told so by `verify`, as an advisory; today's flat +routes enforce nothing. This is what the shells are held to: 1. Load the row: 404 when it is absent. 2. Call the permission point: 403 `forbidden` when the policy refuses. @@ -289,7 +295,7 @@ The shells are later work. This is what they are held to: **The guarded update is part of the store-neutral storage contract** (§8). Every store 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. +guarded update, so until it lands the contract is stated here, not yet implemented or 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 1a48bb2009..ae68dc2b9d 100644 --- a/spec/decisions/ADR-0067-layering-and-the-service-seam.md +++ b/spec/decisions/ADR-0067-layering-and-the-service-seam.md @@ -2,9 +2,9 @@ ## Status -**Accepted** (2026-11-13). This ADR decides the layers a generator set emits, where the -business rules of ADR-0066 are enforced, and how hand-written code attaches. Two answers were -ruled with it: +**Accepted** (2026-11-13), **amended 2026-11-20** (see "Amendment 1" at the end). This ADR decides +the layers, each a generator an app chooses, where the business rules of ADR-0066 are enforced, and +how hand-written code attaches. Two answers were ruled with it: - In every language, hand-written code attaches by implementing a generated interface and being passed in. @@ -13,10 +13,10 @@ ruled with it: It amends ADR-0045 (§6). It depends on the line between core and helpers: ADR-0034 Amendment 3, as ADR-0066 §8 restates it. The core is the contracts and the conformance kits, -and every set below is a helper. +and every generator below is a helper. -Nothing in this ADR is generated yet. The layered set, its service shells and the per-package -set selection are later work. ADR-0066's vocabulary is inert until they land. +Nothing in this ADR is generated yet. The layer generators, the service shells and the +per-package choice of generators are later work. ADR-0066's vocabulary is inert until they land. **Experimental.** The vocabulary this design generates from is experimental (ADR-0066 Status, `docs/compatibility-policy.md`): it may change in a MINOR, including removals and renames, until @@ -41,14 +41,16 @@ call persistence directly. Two things break that shape: ### 1. The layers -A generator set emits some or all of these layers. Each layer is a separate generator that -can be imported, ejected or replaced on its own. +Each layer is a generator. An app lists the ones it wants in its port's own generator +configuration (§5); MetaObjects ships them as part of its default generators, written +idiomatically for each language. A layer can be imported, ejected or replaced on its own. There +are no layer settings: choosing a layer means choosing a generator. | Layer | What it holds | Regenerated | Who owns what | |---|---|---|---| -| 0. Names | Constants for every entity, field, table, column, enum member, state, transition, permission and error | Always | Generated. This layer is the tether: hand code that uses it stops compiling when the model renames something. Every set shares it. | -| 1. Contract types | Create, update and read shapes with their validation; operation inputs and outputs; the wire error shapes | Always | Generated. Every set in a language shares it, so two sets interoperate. | -| 2. Persistence mapping | The chosen ORM's mapping | Always | Generated, replaceable | +| 0. Names | Constants for every entity, field, table, column, enum member, state, transition, permission and error | Always | Generated. This layer is the tether: hand code that uses it stops compiling when the model renames something. Every generator that reads names or shapes uses these. | +| 1. Contract types | Create, update and read shapes with their validation; operation inputs and outputs; the wire error shapes | Always | Generated. Every generator in a language shares it, so a transport from one generator calls a service from another. | +| 2. Persistence mapping | The chosen ORM's mapping, where the language has one | Always | Generated, replaceable | | 3. Data access | Typed queries per entity, including the guarded update | Always | Generated, replaceable. Omitted where the ORM is already this layer. | | 4. Service | One module per metadata package. Its surface is the package's operations: derived CRUD, derived transition commands and declared operations. Each operation is a shell that enforces the declared rules. | Shells always; bodies never | Shells generated. Bodies, policy and event handling are hand-written against generated interfaces. | | 5. Transport | Routes or controllers | Always | Generated; run as is, extend through hooks, or own a copy. Parses the request, calls the service, maps errors to the wire contract. Holds no rules. | @@ -62,15 +64,13 @@ because a project wants a different shape, not because the generated one is a dr There is one file per operation inside a package's service folder. The service module of a metadata package holds the operations of every `api.operational` in that package, plus the -derived ones. +derived ones. The grouping is fixed at one module per package: a project that wants another +grouping subclasses the generator or ejects it. An `api.operational` node is a wire contract, and it may be versioned (`v1` and `v2` side by side). The service is code. So there is one router per `api.operational` node, and every router calls the same service. -The setting `layers.service.unit` lets a project group the service per entity or per API -instead. - ### 3. How hand-written code attaches: an interface, passed in, in every language The pattern has three steps, in every language: @@ -91,64 +91,95 @@ shell's private state and could call around it. ### 4. Per language -| | TypeScript | C# | Java | Kotlin | Python | -|---|---|---|---|---|---| -| Names (0) | `const`s and literal unions | `static class` of `const string` | `final class` of `static final String`; enums for states | `object` of `const val`; enum class for states | module constants; `StrEnum` for states | -| Contract types (1) | Zod schemas, inferred types | `record`s with DataAnnotations | `record`s with Bean Validation | `data class`es with validation | Pydantic v2 models | -| Mapping (2) | Drizzle tables | EF Core entities and `AppDbContext` | JPA entities | Exposed `Table` objects | SQLAlchemy 2.0 models | -| Data access (3) | query functions taking `db` | none: the context is the data layer | Spring Data JPA repositories, with a generated `@Modifying @Query` per transition | Exposed repository functions | functions taking a `Session` | -| Service (4) | a function per operation; `createXService(deps)` | `sealed class XService`, constructor-injected `IXPolicy`, `IXBodies`, `IXEvents`; `services.AddX()` | `@Service` class implementing a generated `XOperations`; constructor injection of `XPolicy` and `XBodies`; `@Transactional` per operation | `class XService(db, policy, bodies, events)`; each operation in `transaction {}`; returns a sealed `OpResult` | a module per package, a function per operation taking an `OpContext`; bodies and policy as `Protocol`s | -| Transport (5) | Fastify routes | minimal-API route groups | Spring MVC controllers | Spring controllers | FastAPI router with `Depends` | +| | TypeScript | C# | Java | Kotlin | Python | Rust | +|---|---|---|---|---|---|---| +| Names (0) | `const`s and literal unions | `static class` of `const string` | `final class` of `static final String`; enums for states | `object` of `const val`; enum class for states | module constants; `StrEnum` for states | `pub const` items; enums for states | +| Contract types (1) | Zod schemas, inferred types | `record`s with DataAnnotations | `record`s with Bean Validation | `data class`es with validation | Pydantic v2 models | serde structs with `validate()` | +| Mapping (2) | Drizzle tables | EF Core entities and `AppDbContext` | none generated | Exposed `Table` objects | none generated | none: row types derive sqlx `FromRow` | +| Data access (3) | query functions taking `db` | none: the context is the data layer | a generated repository implementation on `ObjectManagerDB`, with the guarded update as a method | Exposed repository functions | a generated repository over the abstract `ObjectManager`, implemented by `ObjectManagerDb` | generated repository functions on sqlx, with the guarded update | +| Service (4) | a function per operation; `createXService(deps)` | `sealed class XService`, constructor-injected `IXPolicy`, `IXBodies`, `IXEvents`; `services.AddX()` | `@Service` class implementing a generated `XOperations`; constructor injection of `XPolicy` and `XBodies`; `@Transactional` per operation | `class XService(db, policy, bodies, events)`; each operation in `transaction {}`; returns a sealed `OpResult` | a module per package, a function per operation taking an `OpContext`; bodies and policy as `Protocol`s | `struct XService` over generated traits `XPolicy`, `XBodies`, `XEvents`; each operation takes the transaction and returns `Result` | +| Transport (5) | Fastify routes | minimal-API route groups | Spring MVC controllers | Spring controllers | FastAPI router with `Depends` | an axum router | + +**Rust gets layered generators like every other port** (ruled 2026-11-20); it is not exempt. The +Rust column above is the shape its generators are written to. + +**Java's data access stays on `ObjectManagerDB` (no JPA).** The repository implementation is +promoted from the test-only one. **Python's data access is the `ObjectManager` split:** an +abstract `ObjectManager` and a concrete `ObjectManagerDb`, with a clean break for +`ObjectManager(root, driver)` and no compatibility shim, plus a transaction API the service shell +uses. A session driver for SQLAlchemy ships; a SQLAlchemy generator set is deferred (see +Alternatives). These calls are recorded here: - **Transactions and hooks.** Every write operation of the service runs in one transaction: derived create, update and delete, derived transition commands, and declared commands. The - shell opens it, or under `layers.transactions: "caller"` requires one passed in, for a job - that runs several operations atomically. Inside it, in this order: + shell opens it, or uses one passed in as an optional parameter, for a job that runs several + operations atomically. Inside it, in this order: 1. The shell loads the target row, with a row lock where the dialect has one. The policy check and the state check use that row. - 2. The before hook runs (derived CRUD, when `layers.crudHooks` is `beforeAfter`). It may - return a replacement input or refuse. + 2. The before hook runs (derived CRUD). It may return a replacement input or refuse. 3. The shell validates and stamps the final input (ADR-0045). 4. The write runs, or the body, then the guarded update for a transition. 5. The after hook runs. 6. The write-event hook runs. - Every hook receives the transaction the write used. If a hook or body throws or refuses, the - whole transaction rolls back: the row, any cascade a hook wrote, and the event handler's own - rows (an audit row, an outbox row). A refusal is answered `409 {"error": ""}`, and a - code reserved by the shell or the API contract is refused (ADR-0066 O5). Queries open no - write transaction and call no hooks. + The hook interfaces and the event hook are always generated, with do-nothing defaults. There is + no switch for them. Every hook receives the transaction the write used. If a hook or body + throws or refuses, the whole transaction rolls back: the row, any cascade a hook wrote, and + the event handler's own rows (an audit row, an outbox row). A refusal is answered + `409 {"error": ""}`, and a code reserved by the shell or the API contract is refused + (ADR-0066 O5). Queries open no write transaction and call no hooks. - **Stores without interactive transactions.** A store whose driver cannot hold a transaction - across application code declares it in the storage kit (`interactiveTransactions: false`). - Cloudflare D1 is one. On such a store the shell generator refuses hooks and events with - `ERR_STORE_NO_INTERACTIVE_TX`, naming the package and `layers.events: "off"`. + across application code (Cloudflare D1 is one) is declared with an option on the TypeScript + service generator. Under it the generator refuses hooks and events with + `ERR_STORE_NO_INTERACTIVE_TX`, naming the package and the option. There is no storage kit. - The settings `layers.transactions`, `layers.crudHooks` and `layers.events`, the storage kit's - `interactiveTransactions` and the code `ERR_STORE_NO_INTERACTIVE_TX` are designed here and - land with the service shells; nothing in 1.3.0 reads or reports them. + The option and the code `ERR_STORE_NO_INTERACTIVE_TX` are designed here and land with the + TypeScript service generator; nothing in 1.3.0 reads or reports them yet. - **Kotlin** returns a sealed result for declared business errors, and the transport maps it. - The setting `layers.errors` switches to exceptions. + The result type is fixed as designed: a project that wants exceptions ejects the generator. - **Java's** generated `@Service` class is not `final`, so Spring's transaction proxy works. It is still not meant to be extended, and its generated header says so. - -### 5. Several generator sets in one language - -A **set** is a named list of generators, each assigned to a layer. Today's flat generators -become the `classic` set, and the new one is `layered`. More sets can be added, by this project -or by adopters. - -1. **Layers 0 and 1 are shared** by every set in a language. That is what lets a transport from - one set call a service from another. -2. **The service interface is the seam.** A transport talks to layer 4 only through the +- **ADR-0066's four settings stay** (`rules.permissions.names`, `rules.lifecycle.commands`, + `rules.lifecycle.create` and `verify.lifecycle.unreachable`). They decide what the model derives, + which every port must agree on, so they are not generator options. The service generators read + `rules.lifecycle.commands` and `rules.lifecycle.create`; until they land, `rules.lifecycle.create` + is read and validated and has no effect (ADR-0066 §5). What reads each key: `rules.permissions.names` + and `verify.lifecycle.unreachable` are read by the `verify` rules gate today, and the service + generators will read `rules.lifecycle.commands` (the derived commands) and `rules.lifecycle.create`. + +### 5. Choosing layers + +An app picks the generators it wants, in the generator configuration its port already has: + +| Port | Where the list lives | Per-package choice | +|---|---|---| +| TypeScript | `generators` in `metaobjects.config.ts` | the generator's `filter` function | +| C# | `codegen/Generators.cs` | the generator's `Include` lambda | +| Java and Kotlin | `` in the pom | `` | +| Python | `targets..generators` in `metaobjects.config.yaml` | a package and entity selection per generator, added with the service generators | +| Rust | the generator list `cargo meta init` writes | the same package selection | + +1. **MetaObjects recommends one list per port** for the layers it ships (the names, contract + types, data access, service and transport generators of §1). The list is documentation and + what an opt-in `init` writes (§7). It is not a mode: an app adds, removes, configures or + replaces an entry the way it already does. +2. **The layer generators are separate from today's flat ones.** The flat generators keep their + output, so a project that changes nothing sees no diff, and `fixtures/codegen-noop/rules/` + keeps guarding them. Both kinds can run in one project on different packages, using each port's + per-package choice above. +3. **Names and contract types are shared** by every generator in a language. That is what lets a + transport from one generator call a service from another. +4. **The service interface is the seam.** A transport talks to layer 4 only through the generated operations interface, or `createXService` in TypeScript. -3. **One owner per output path.** The engine already refuses two generators writing one file, - and each set writes under its own folder per package. -4. **A set is chosen per package**, in the codegen config, for example - `sets: { "billing": "layered", "*": "classic" }`. A project that names no set keeps `classic`, - exactly as it runs today. -5. **A set is a list, not a framework.** Ejecting a set ejects its generators. Replacing a +5. **One owner per output path.** The engine already refuses two generators writing one file, + and each generator writes under its own folder per package. +6. **Each layer carries a label** in the shared generator manifest + (`fixtures/generator-registry-conformance/registry.json`: `model`, `persistence`, `api`, + `client`, `docs` or `capability`, and a new `service`), and `gen --list` groups by it. That is the whole catalogue; + no named set of generators exists. +7. **A list is a list, not a framework.** Ejecting a generator ejects that generator. Replacing a layer means replacing one entry. ### 6. Where the business-rules shell sits, and the amendment to ADR-0045 @@ -157,12 +188,14 @@ The shell sits in layer 4, and only there: - The transport parses the request and maps errors; it holds no rules. - Data access provides the guarded update but decides nothing. -- The shell is the only caller of data access in the `layered` set. So a job, a queue consumer - or an agent tool that calls the service gets the same checks as an HTTP request. +- The shell is the only caller of data access where the service generator is used. So a job, a + queue consumer or an agent tool that calls the service gets the same checks as an HTTP request. -The `classic` set has no service layer. A project on `classic` that declares lifecycles gets -the minimum enforcement in the generated routes: the guarded update and the `state_managed` -refusal. `verify` advises that the full shell needs `layered`. +Today's flat generators have no service layer. A project that declares a lifecycle and wires no +service generator is advised by `verify` that the lifecycle is not enforced; the flat routes +enforce nothing. (This replaces the first version of this section, which promised the +guarded update and the `state_managed` refusal in the flat routes. That would have changed the +output of five routes generators for projects that asked for nothing.) **ADR-0045 is amended.** Its decision sentence becomes: *"The outermost generated write-path artifact an adopter deploys must guarantee every metamodel-declared write semantic, either @@ -171,15 +204,55 @@ between the guarantee and the wire. A hand-written operation body is called by t inside the guarantee, and is not such a seam."* ADR-0045 rejected rewiring controllers through a lower layer, because it "would churn all -generated output". That reason does not apply here: the layered set is opt-in per package, so -no existing output churns. +generated output". That reason does not apply here: the service generators are separate +generators an app adds, so no existing output churns. + +### 7. The actor + +"The actor" is the caller a rule is checked for. ADR-0066 passes it to the policy and to the +event hook. It is a type the app defines: + +- Generated code never looks inside it. It is a generic parameter on the service, and the shell + only passes it on, to the policy and to the event hook. +- The transport gets it from a resolver the app supplies at the composition root, the same way + the policy is supplied. A job or a test builds an actor directly and passes it. +- It is passed **explicitly**, never through ambient context, because a job or a Kotlin coroutine + has none. +- For an operation marked `@public` the shell skips the policy, and the actor may be absent. + +The resolver reads as each framework reads: Fastify `getActor(request)`; Hono `getActor(c)`; +ASP.NET a `Func`; Spring a generated `ActorResolver` interface the app +implements as a bean; FastAPI `Depends(get_actor)`, overridden the way `get_repository` is +today. Rust: an axum extractor for the app's actor type. No generated +transport passes "who is calling" into generated code today, so this is new in every port. + +The framework's own principal (`ClaimsPrincipal`, Spring `Authentication`) was rejected: it makes +the service layer depend on the web framework, and a job would have to fake a web principal. A +MetaObjects-defined actor shape (an id and roles) was rejected: it would make the tool own a +permission model, and the model names where a decision is needed, never what the decision is +(ADR-0066 §1). + +### 8. What `init` writes + +`meta init`, `dotnet meta init` and `metaobjects init` keep writing an **empty** generator list +(ADR-0034 Amendment 2), with a comment naming the usual generators. One opt-in flag, on the +pattern of the existing `--with-docs`, wires the recommended list of §5 instead. Rust's +`init` writes the project's list the same way. Java and Kotlin have no +`init`: the documentation carries the recommended pom `` block. + +After the service generators have run in the adopter estates with the drift gate enforced, the +scaffold's comment and the quickstart recommend the service list. The captain's ruling of +2026-11-12 that new projects get the new behaviour is met by what the scaffold recommends, not by +reversing "empty by design". ## Consequences -- Each port gains a layered set, as later work, one change per language. TypeScript goes first. -- The shared generator manifest gains a `sets` field, and the codegen config gains per-package - set selection. -- `classic` is unchanged for every project that does not opt in. +- Each port gains the layer generators, as later work, one change per language. TypeScript goes + first, and its shared API tests become the contract the other ports pass. Rust gets them too. +- A port whose generator list the app could not change (Rust's, until its own `init` writes one) + gains a project-level list, and Python gains per-generator package selection. No port gains a `layers`, + `sets` or `preset` key. +- Today's flat generators are unchanged for every project that does not add a service generator. - ADR-0045's guarantee is unchanged. A semantic is still never left to a consumer-supplied seam; this ADR adds the generated service as a place where the guarantee may live. @@ -191,12 +264,31 @@ no existing output churns. HTTP would bypass every rule. - **A generated hexagonal core, or a runtime rules engine.** The first is heavier than the problem. The second is a proprietary runtime, which is out of scope. -- **One service per `api.operational` node.** Rejected as the default, because versioned - surfaces would duplicate the shells for the same business operation. It is kept as a choice - through `layers.service.unit`. +- **One service per `api.operational` node.** Rejected, because versioned surfaces would + duplicate the shells for the same business operation. A project that wants one service per + entity or per API subclasses the generator or ejects it. +- **Named generator sets and layer settings (`classic`, `layered`, `layers.*`).** Rejected by the + ruling of 2026-11-20: a layer is a generator, and an app chooses generators the way it already + does. A set adds a second place to say the same thing. - **Hooks as events (`onBeforeCreate` style) instead of bodies.** An event can observe but cannot decide which transition applies, so the decision would leak into an untyped place. - 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. + Events are kept for derived CRUD as before and after hooks per verb, always generated with + do-nothing defaults, 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 design's choice of an interface-only attachment (§3). +- **JPA for Java.** Rejected: Java's data access stays on `ObjectManagerDB`. +- **A SQLAlchemy generator set for Python** (models, and functions over a `Session`). Deferred, + not rejected: it is an estimated 13 to 22 sessions, and the ruled split of `ObjectManager` + already gives Python data access. A small session driver that joins an `ObjectManager` to a + `Session`'s transaction ships now. + +## Amendment 1 (2026-11-20): a layer is a generator + +It was ruled that layers are only code generators. This amendment replaces the original +§5, "Several generator sets in one language", which named `classic` and `layered` sets, a `sets` +field in the generator manifest and per-package set selection; it removes the `layers.*` +settings the original §2 and §4 named (`layers.service.unit`, `layers.transactions`, +`layers.crudHooks`, `layers.events`, `layers.errors`) and the storage kit; it replaces the +Java and Python data-access cells of §4 (JPA, SQLAlchemy), adds the Rust column, replaces §6's +"minimum enforcement" in the flat routes with an advisory from `verify` (the flat routes enforce nothing), and adds §7 and §8. The +four `rules.*` and `verify.*` settings of ADR-0066 stay. From cb57fc787d598fb655180c7bba4ee2ff3f11e13a Mon Sep 17 00:00:00 2001 From: Doug Mealing Date: Fri, 20 Nov 2026 22:34:46 -0500 Subject: [PATCH 2/6] fix(ci): send the CI token to api.github.com in the site bijection check --- .github/workflows/local-ci.yml | 4 ++++ .github/workflows/pr-ci.yml | 3 +++ scripts/site-bijection.test.ts | 16 +++++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/local-ci.yml b/.github/workflows/local-ci.yml index 2f7b43ca51..21553778ce 100644 --- a/.github/workflows/local-ci.yml +++ b/.github/workflows/local-ci.yml @@ -98,6 +98,10 @@ jobs: fetch-depth: 0 # leak-scan diffs against origin/main persist-credentials: false - run: scripts/ci-local.sh --only gates --strict-toolchains + env: + # site-bijection lists the site repo through api.github.com; the token lifts it out of + # the anonymous rate limit. + GITHUB_TOKEN: ${{ github.token }} # TS FAST lane — build+typecheck, conformance, completeness (the pure-code # correctness signal). No docker/integration, so no sidecar. diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index b2cd16ac75..b6422a3246 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -84,6 +84,9 @@ jobs: - name: Gates env: MO_CI_LEAK_BASE: origin/${{ github.base_ref }} + # site-bijection lists the site repo through api.github.com; the token lifts it out of + # the anonymous rate limit. + GITHUB_TOKEN: ${{ github.token }} run: scripts/ci-local.sh --only gates --strict-toolchains ts: diff --git a/scripts/site-bijection.test.ts b/scripts/site-bijection.test.ts index 5a101753b7..cee9294162 100644 --- a/scripts/site-bijection.test.ts +++ b/scripts/site-bijection.test.ts @@ -19,6 +19,20 @@ const OWNER = "metaobjectsdev"; const SITE_REPO = "metaobjectsdev.github.io"; const TIMEOUT = 20_000; +/** + * Headers for api.github.com. Unauthenticated calls share one 60-per-hour budget per source + * address, and a hosted runner's address is shared with other jobs, so the call answers 403 + * (rate limit) at random. CI exports its token as GITHUB_TOKEN or GH_TOKEN, and sending it + * raises the budget. With neither set (a local run) the call stays anonymous. An unreachable + * tree still fails closed below. + */ +function githubHeaders(): Record { + const headers: Record = { accept: "application/vnd.github+json" }; + const token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN; + if (token) headers.authorization = `Bearer ${token}`; + return headers; +} + /** * Every `www/**\/*.html` on the live site's default branch. * @@ -31,7 +45,7 @@ const TIMEOUT = 20_000; async function livePages(): Promise { const r = await fetch( `https://api.github.com/repos/${OWNER}/${SITE_REPO}/git/trees/main?recursive=1`, - { headers: { accept: "application/vnd.github+json" }, signal: AbortSignal.timeout(TIMEOUT) }); + { headers: githubHeaders(), signal: AbortSignal.timeout(TIMEOUT) }); // Fail closed. An unreachable tree must never read as "no pages, therefore no orphans". if (!r.ok) throw new Error(`could not list ${SITE_REPO} tree (HTTP ${r.status})`); const body = (await r.json()) as { truncated?: boolean; tree?: { path?: string }[] }; From 867662a92f122a5b52408d4c39d6cf78f3b21c63 Mon Sep 17 00:00:00 2001 From: Doug Mealing Date: Fri, 20 Nov 2026 22:34:46 -0500 Subject: [PATCH 3/6] chore(hooks): remove the vestigial allowed-address exemption from the leak scans --- .githooks/identity-scan.sh | 4 ++-- .githooks/leak-patterns.sh | 6 ------ .githooks/leak-scan.sh | 3 +-- .githooks/pre-commit | 3 +-- AGENTS.md | 2 +- scripts/leak-scan.test.ts | 4 ++-- 6 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.githooks/identity-scan.sh b/.githooks/identity-scan.sh index dd2b685089..9dd260ecb0 100755 --- a/.githooks/identity-scan.sh +++ b/.githooks/identity-scan.sh @@ -23,9 +23,9 @@ DENY_FILE="$(git config --get hooks.denyListPath 2>/dev/null || true)" PATTERNS=$(grep -vE '^[[:space:]]*(#|$)' "$DENY_FILE" | paste -sd'|' -) [ -n "$PATTERNS" ] || exit 0 -# 0 when the identity text matches the denylist after the maintainer's allowed address is removed. +# 0 when the identity text matches the denylist. matches() { - printf '%s\n' "$1" | tr '[:upper:]' '[:lower:]' | sed -E "s/$LEAK_ALLOW//g" | grep -qEi "$PATTERNS" + printf '%s\n' "$1" | tr '[:upper:]' '[:lower:]' | grep -qEi "$PATTERNS" } mode="${1:-}" diff --git a/.githooks/leak-patterns.sh b/.githooks/leak-patterns.sh index aefb333e07..36c510ed31 100644 --- a/.githooks/leak-patterns.sh +++ b/.githooks/leak-patterns.sh @@ -9,11 +9,5 @@ # Generic, non-sensitive structural patterns (safe to commit): LEAK_PATTERNS='/home/[A-Za-z0-9._-]+/|/Users/[A-Za-z0-9._-]+/|~/Development' -# Legitimate matches to ignore. The maintainer's email. Content scans drop it from added lines; -# identity-scan.sh strips it before matching the author/committer identity, so the maintainer's -# own commits pass a denylist that names the maintainer. (The npm manifests no longer carry it, -# since 1.3.0 — author "MetaObjects contributors" — so that was its original reason.) -LEAK_ALLOW='doug@dougmealing\.com' - # Diff filter: Added, Copied, Modified and Renamed (a `git mv` plus an edit is a rename). LEAK_DIFF_FILTER='ACMR' diff --git a/.githooks/leak-scan.sh b/.githooks/leak-scan.sh index a858e9bc13..65277da18b 100755 --- a/.githooks/leak-scan.sh +++ b/.githooks/leak-scan.sh @@ -20,7 +20,6 @@ ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo .)" # shellcheck source=leak-patterns.sh . "$ROOT/.githooks/leak-patterns.sh" PATTERNS="$LEAK_PATTERNS" -ALLOW="$LEAK_ALLOW" DENY_FILE="$(git config --get hooks.denyListPath 2>/dev/null || true)" [ -z "$DENY_FILE" ] && DENY_FILE="$ROOT/.githooks/deny-list.local" @@ -39,7 +38,7 @@ fi hits=$(printf '%s\n' "$DIFF" | awk ' /^\+\+\+ / { f=$2; sub(/^b\//,"",f); next } /^\+/ && !/^\+\+\+/ { if (f !~ /^\.githooks\//) print f "\t" substr($0,2) } -' | grep -Ei "$PATTERNS" | grep -vEi "$ALLOW" || true) +' | grep -Ei "$PATTERNS" || true) if [ -n "$hits" ]; then echo "" >&2 diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 10eba5a718..b56b26f146 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -23,7 +23,6 @@ ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo .)" # shellcheck source=leak-patterns.sh . "$ROOT/.githooks/leak-patterns.sh" PATTERNS="$LEAK_PATTERNS" -ALLOW="$LEAK_ALLOW" # Merge in private-name patterns from a denylist. Source priority: # 1) git config hooks.denyListPath -> point at your private denylist file (kept in a private repo) @@ -40,7 +39,7 @@ fi hits=$(git diff --cached --diff-filter="$LEAK_DIFF_FILTER" -U0 --no-color 2>/dev/null | awk ' /^\+\+\+ / { f=$2; sub(/^b\//,"",f); next } /^\+/ && !/^\+\+\+/ { if (f !~ /^\.githooks\//) print f "\t" substr($0,2) } -' | grep -Ei "$PATTERNS" | grep -vEi "$ALLOW") +' | grep -Ei "$PATTERNS" || true) # The author/committer identity git would record must not match the denylist either. if [ -x "$ROOT/.githooks/identity-scan.sh" ]; then diff --git a/AGENTS.md b/AGENTS.md index d6ab41cfc2..56e4e3a9ff 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -102,7 +102,7 @@ git config core.hooksPath .githooks git config hooks.denyListPath /path/to/your/private/denylist.txt ``` -It blocks commits whose added lines match (`git commit --no-verify` bypasses, discouraged); the maintainer's email is the one allowed exception (it was the npm author field — no manifest has carried it since 1.3.0, whose author is "MetaObjects contributors"). Guard a new private name by editing that private denylist (single source of truth) — never add real names to this public repo or the committed hook. +It blocks commits whose added lines match (`git commit --no-verify` bypasses, discouraged). No address is exempt. Guard a new private name by editing that private denylist (single source of truth) — never add real names to this public repo or the committed hook. **Pre-push typecheck gate** (`.githooks/pre-push`, same `core.hooksPath`): `bun test` transpiles per-file and does NOT typecheck, so type-broken code can ship green on the diff --git a/scripts/leak-scan.test.ts b/scripts/leak-scan.test.ts index 7aa0bfbbab..dc109292a1 100644 --- a/scripts/leak-scan.test.ts +++ b/scripts/leak-scan.test.ts @@ -220,7 +220,7 @@ describe("identity scan (author and committer vs the private denylist)", () => { }); }); - test("the maintainer's allowed address is not treated as a match", () => { + test("no address is exempt: an identity the denylist names is refused", () => { const dir = identityFixture(); writeFileSync(join(tmp, "deny.txt"), "dougmealing\n"); const r = run(dir, ["staged"], { @@ -228,6 +228,6 @@ describe("identity scan (author and committer vs the private denylist)", () => { GIT_AUTHOR_EMAIL: "doug@dougmealing.com", ...good, }); - expect(r.status).toBe(0); + expect(r.status).toBe(1); }); }); From c1125cb334c0620f1d8b1603348cdf0e53ab570d Mon Sep 17 00:00:00 2001 From: Doug Mealing Date: Fri, 20 Nov 2026 22:34:46 -0500 Subject: [PATCH 4/6] docs(prerelease): re-cut the estate run sheet to rc.1 through rc.5 --- tools/prerelease/estate-run.md | 86 +++++++++++++++++++++++++--------- 1 file changed, 65 insertions(+), 21 deletions(-) diff --git a/tools/prerelease/estate-run.md b/tools/prerelease/estate-run.md index fafbe068c8..07b624eb8e 100644 --- a/tools/prerelease/estate-run.md +++ b/tools/prerelease/estate-run.md @@ -47,7 +47,17 @@ are in the `case` block of `estate-run.sh`; `--install-cmd`, `--gen-cmd`, `--ver ## What each candidate adds -**rc.1, "as built".** Every diff must be explained by an item in the CHANGELOG upgrade list +Nothing is published to a public registry at any candidate. Each candidate carries: + +| Candidate | What it carries | +|---|---| +| rc.1, "as built" | Main as it stands, a truthful upgrade list, the small fixes and the wording fixes that ship into adopters' repos | +| rc.2, new output, TypeScript and Python | Formatters out of generation; every TypeScript and Python generator on the writer; page size 50 everywhere; libSQL and the first prunes out of the default install; the REST-standard scenarios; reporting and requirements in packs; the `meta schema` command | +| rc.3, new output, C#, Java and Kotlin; TypeScript service code | The JVM and .NET ports converted; Rust's layout check; the TypeScript service generators; the Python `ObjectManager` split; the REST standard in Python | +| rc.4, service code in five ports | Service generators in C#, Java, Kotlin and Python; the REST standard in C#, Java and Kotlin; the docs generators in four ports; Rust's names, contract types and data access | +| rc.5, close-out | Rust's service code, transport and docs generators; one round of vocabulary changes from the estate reports; the authoring-surface snapshots; anything that slipped | + +**rc.1.** Every diff must be explained by an item in the CHANGELOG upgrade list ("Upgrading from 1.2.0"). A diff that is not there is a CHANGELOG defect or a bug, and it is fixed before rc.2. Watch for: @@ -57,29 +67,45 @@ fixed before rc.2. Watch for: - `RESTART WITH` in the first C# EF migration; - classes missing on JVM estates whose pom carries ``; - owned generator copies that no longer load; -- a template that now raises on a misspelt variable. - -**rc.2, new output, TypeScript and Python estates.** - -- Expect every generated file to change once, in layout only. Check it by formatting the old and - the new tree with the estate's own formatter and comparing: what remains must be empty or listed. -- Count hand-edited generated files. On TypeScript the three-way merge conflicts more than usual, - because the base layout changed under every edit. Move edits into hooks or owned generators - first where that is possible, and report the count. -- Owned generator copies from 1.2 must still load and generate. -- Commit the new hash manifest (`.metaobjects/.gen-state/.hashes/`). The end-of-run restore wipes it, - so run with `--keep-linked`, commit the manifest in the estate, then `prerelease-link.sh unlink`. -- C#, Java and Kotlin estates run the base run only and must see **no** diff against rc.1. - -**rc.3, new output, C#, Java and Kotlin; TypeScript service code.** +- a template that now raises on a misspelt variable; +- the model must load identically with the rules and view-expression vocabulary in packs. + +**rc.2.** + +- **TypeScript and C# estates: find every list call that passes no limit.** It returned every row + and now returns 50. Check grids, exports, background jobs and tests. Each one pages, passes a + limit, or the project sets `api.pagination`. This is the change most likely to produce a wrong + screen without an error. +- TypeScript and Python estates: expect every generated file to change once, in layout only. Check + it by formatting the old and the new tree with the estate's own formatter and comparing: what + remains must be empty or listed. +- TypeScript estates: count hand-edited generated files. The three-way merge conflicts more than + usual, because the base layout changed under every edit. Move edits into hooks or owned + generators first where that is possible, and report the count. +- TypeScript estates: owned generator copies from 1.2 must still load and generate. An estate that + migrates SQLite through the CLI adds the libSQL driver. An estate that generates trace helpers + regenerates and drops the `@metaobjectsdev/ai-runtime` dependency. An estate that uses the Cube + export adds the Cube package (when that change lands). +- Commit the new hash manifest (`.metaobjects/.gen-state/.hashes/`). The end-of-run restore wipes + it, so run with `--keep-linked`, commit the manifest in the estate, then + `prerelease-link.sh unlink`. +- C#, Java and Kotlin estates otherwise run the base run only and must see no other diff against rc.1. +- The model must load identically with reporting and requirements in packs. + +**rc.3.** - C#, Java and Kotlin estates: the same one-time layout diff. There was no formatter before, so the check is compile plus tests plus the API comparison. -- TypeScript and Python estates: the base run only, no diff against rc.2. -- One or two TypeScript estates pilot the service code on one package (the rc.4 steps below), - before four ports copy the design. +- Python estates: `ObjectManager(root, driver)` no longer constructs. Use `ObjectManagerDb`. A + hand-written `Repository` takes a predicate tree instead of a flat list. +- JVM estates: a misspelt generator `` now fails the build instead of being ignored. A pom + that lists the `mustache` generator moves to the `template` generator. +- C# estates: an unknown top-level config key now fails. +- TypeScript and Python estates: the base run only, no other diff against rc.2. +- **One or two TypeScript estates pilot the service code on one package** (the rc.4 steps below). + Four ports are about to copy this design, and an estate will find what the shared tests cannot. -**rc.4, service code everywhere.** On every estate: +**rc.4.** On every estate: 1. Pick one package that has a real status field. Declare its lifecycle (states and transitions), one real operation, and its permission points. @@ -89,9 +115,27 @@ fixed before rc.2. Watch for: Supply the actor resolver. 4. Call the service from one caller that is not HTTP (a job or a test) and confirm it gets the same refusals. -5. Report what the vocabulary could not express. The vocabulary is experimental, and this is the +5. Set each of the four `rules.*` keys away from its default once and confirm the generated code + or `verify` changes as documented. +6. Report what the vocabulary could not express. The vocabulary is experimental, and this is the last point where it can change cheaply. +Also at rc.4: + +- Java estates: a hand-written repository implementation takes a predicate tree. +- C#, Java and Kotlin estates: clients may now send `search` and or/and filters; check client + error handling against the named error bodies (`invalid_json`, `invalid_id`). +- Non-TypeScript estates: regenerate the agent files with the port's own command, with no Node + installed on the path, and add the requirements page generator. +- One non-TypeScript estate that already uses its own migration tool follows that port's native + recipe and confirms `meta verify --db` passes. + +**rc.5.** The base run, plus rc.4 steps 1 to 4 again on whatever the vocabulary round changed. + +**Rust.** There is no Rust estate. The stand-in is an example app in this repository that follows +the rc.4 steps, built against the candidate commit as a git dependency +(`docs/features/prerelease.md`, "Rust"). A Rust project the maintainer prefers replaces it. + ## The report Attach the script's report to the estate's tracking note, plus: the manual step 5 result, the From 74b236ee86837490dd0d7ade31f2439d79cab947 Mon Sep 17 00:00:00 2001 From: Doug Mealing Date: Sat, 21 Nov 2026 02:18:29 -0500 Subject: [PATCH 5/6] no-mistakes(review): Reword verify lifecycle advisory as not yet emitted --- docs/features/business-rules.md | 5 +++-- .../ADR-0066-business-rules-operations-and-lifecycles.md | 2 +- spec/decisions/ADR-0067-layering-and-the-service-seam.md | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/features/business-rules.md b/docs/features/business-rules.md index 834bdc2133..013a9c348d 100644 --- a/docs/features/business-rules.md +++ b/docs/features/business-rules.md @@ -16,8 +16,9 @@ codegen drift gate only, so the checks under "What `verify` reports" do not run A requirement can claim an operation or a transition. Nothing is generated from the vocabulary yet: the service shells that enforce these rules at run time are later work (ADR-0067): service generators an app adds to its generator list, as it adds any generator. A lifecycle in a project -that wires none is advised by `verify`, with the flat routes enforcing nothing. Until they land, a model with this vocabulary generates byte-identical code to the same model -without it. The design is [ADR-0066](../../spec/decisions/ADR-0066-business-rules-operations-and-lifecycles.md). +that wires none will be advised by `verify` once that check lands; today the flat routes enforce +nothing and `verify` says nothing about it. Until the shells land, a model with this vocabulary +generates byte-identical code to the same model without it. The design is [ADR-0066](../../spec/decisions/ADR-0066-business-rules-operations-and-lifecycles.md). **Experimental.** This vocabulary, its loader rules, its `verify` checks and its settings may change in a MINOR, including removals and renames, until generated services run on it in an 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 a63e1851c2..c420af8fa4 100644 --- a/spec/decisions/ADR-0066-business-rules-operations-and-lifecycles.md +++ b/spec/decisions/ADR-0066-business-rules-operations-and-lifecycles.md @@ -276,7 +276,7 @@ will be the first to act on it, and the documentation says so until they do. ### 6. What the enforcing shell will guarantee, for every transition The shells are later work: service generators that an app adds (ADR-0067). A project that declares -a lifecycle and wires no service generator is told so by `verify`, as an advisory; today's flat +a lifecycle and wires no service generator will be told so by `verify`, as an advisory, once that check lands; today's flat routes enforce nothing. This is what the shells are held to: 1. Load the row: 404 when it is absent. 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 ae68dc2b9d..bf2ad88d20 100644 --- a/spec/decisions/ADR-0067-layering-and-the-service-seam.md +++ b/spec/decisions/ADR-0067-layering-and-the-service-seam.md @@ -192,8 +192,8 @@ The shell sits in layer 4, and only there: queue consumer or an agent tool that calls the service gets the same checks as an HTTP request. Today's flat generators have no service layer. A project that declares a lifecycle and wires no -service generator is advised by `verify` that the lifecycle is not enforced; the flat routes -enforce nothing. (This replaces the first version of this section, which promised the +service generator will be advised by `verify` that the lifecycle is not enforced, once that check +lands (it is not yet emitted); the flat routes enforce nothing. (This replaces the first version of this section, which promised the guarded update and the `state_managed` refusal in the flat routes. That would have changed the output of five routes generators for projects that asked for nothing.) @@ -290,5 +290,5 @@ field in the generator manifest and per-package set selection; it removes the `l settings the original §2 and §4 named (`layers.service.unit`, `layers.transactions`, `layers.crudHooks`, `layers.events`, `layers.errors`) and the storage kit; it replaces the Java and Python data-access cells of §4 (JPA, SQLAlchemy), adds the Rust column, replaces §6's -"minimum enforcement" in the flat routes with an advisory from `verify` (the flat routes enforce nothing), and adds §7 and §8. The +"minimum enforcement" in the flat routes with a planned advisory from `verify` (the flat routes enforce nothing), and adds §7 and §8. The four `rules.*` and `verify.*` settings of ADR-0066 stay. From 049660bf465e2d087e91f4953ae45b64a8318ae6 Mon Sep 17 00:00:00 2001 From: Doug Mealing Date: Sat, 21 Nov 2026 02:30:25 -0500 Subject: [PATCH 6/6] no-mistakes(document): Fix ADR index line for ADR-0067 re-cut --- spec/decisions/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/decisions/README.md b/spec/decisions/README.md index 3bedaf6e51..f4766d8e88 100644 --- a/spec/decisions/README.md +++ b/spec/decisions/README.md @@ -63,7 +63,7 @@ Write one when a decision is **cross-cutting** (affects more than one language p - [ADR-0064 — `gen` skips rendering when the loaded model and its generators are unchanged](ADR-0064-skip-codegen-when-nothing-changed.md) — *Accepted* (every port keys a run on the loaded model and its generator inputs, and a matching key with every generated file unchanged renders and writes nothing; the manifest is written once per run; a local `verify --codegen` may answer from the key; Amendment 1: the manifest is one file per model package) - [ADR-0065 — Rust is the sixth port](ADR-0065-rust-is-the-sixth-port.md) — *Accepted* (a Rust port under `server/rust/`, in preview and unpublished, on its own 0.x line when it publishes; the command is `cargo meta`; no `migrate`, Jinja refused, generated code as one crate per MetaObjects package; gated by `registry-conformance` and the metamodel corpus with a shrink-only ledger. **Amendment 1**: `cargo meta init` / `gen` / `verify --codegen` / `eject`, an owned generator as a crate the project builds, the generated crate shape, and the `client` and `commands` generators, the second Rust-only by decision) - [ADR-0066 — Business rules: operations, permission points and lifecycles](ADR-0066-business-rules-operations-and-lifecycles.md) — *Accepted* (registers `api.*`, `operation.*`, `binding.*` and `transition.*` in all five ports, experimental, with eleven loader errors and a rules gate in every `verify`; the lifecycle, its states and a transition's command are derived; `transition.timed` reserved; the enforcing shells are later work) -- [ADR-0067 — Generated code is layered, and hand-written code attaches at the service seam](ADR-0067-layering-and-the-service-seam.md) — *Accepted* (layers 0 to 6; a service module per metadata package whose surface is its operations; hand-written bodies, policy and event handling implement generated interfaces and are passed in, in every language; generator sets chosen per package; amends ADR-0045) +- [ADR-0067 — Generated code is layered, and hand-written code attaches at the service seam](ADR-0067-layering-and-the-service-seam.md) — *Accepted* (layers 0 to 6; a service module per metadata package whose surface is its operations; hand-written bodies, policy and event handling implement generated interfaces and are passed in, in every language; a layer is a generator an app chooses, per package, with no named sets; the actor is an app-defined type; amends ADR-0045) > **Index gap — ADR-0031 through ADR-0051 are on disk but not listed above.** The index stopped > being maintained after ADR-0030; the files are authoritative, this list is not. Read