Skip to content

feat(rust): ADR-0067 layer stack, prompt tier and crates.io release path - #655

Merged
dmealing merged 19 commits into
mainfrom
fm/mo-130-lane-rust-6
Nov 25, 2026
Merged

dmealing merged 19 commits into
mainfrom
fm/mo-130-lane-rust-6

Conversation

@dmealing

@dmealing dmealing commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

What Changed

  • New Rust generators through the ADR-0067 stack: rules-names and contract-types (layers 0–1, business-rules vocabulary as closed enums and per-operation input/output types), repository (layer 3 — a <package>_store crate per package on sqlx for Postgres and SQLite, with the nine filter operators, sort/paging, and the guarded-update transition_<field>), service (layer 4 — transactional writes running the ADR-0066 check order in sequence, app-owned Policy/Bodies/Hooks/Events traits), and the opt-in service-routes (layer 5 — an axum Router over the service with derived CRUD, traversal, transition-command and declared-operation routes, the REST list query and named 400s, added by cargo meta init --transport). Also in this stack: the prompt tier (render-helper, output-parser, output-prompt writing <package>_prompts/_parsers/_formats crates), report/projection reads through a view's cast columns (FR-044, shape derivation byte-matched to report-shapes.json), and many-to-many traversal through the store (FR-018, incl. directed and @symmetric self-joins). The walks the layer generators share live in metaobjects_codegen::layers, so an ejected generator calls the same walk the shipped one does.
  • Generators own their layout (ADR-0063): config generators entries may be {"name": ..., "options": {...}} (unknown options refused with ERR_UNKNOWN_GENERATOR_OPTION, including under --generators narrowing); every shipped generator exposes a *Parts trait (eleven in all) so an owned generator overrides one piece and keeps the rest; a syn-based layout ratchet (tests/layout_ratchet.rs, shrink-only allowlist) and eight new Rust writer-conformance cases pin the dialect — the one output change is assign moving an array right-hand side to the next line where rustfmt puts it.
  • Conformance and release: Rust runners bring up the shared persistence corpus (all 56 scenarios on a throwaway Postgres, guarded-update and roundtrip among them; ledger holds only three many-to-many scenarios), the list-query corpus (95 cases), and the api-contract corpus's generated lane over HTTP (77 scenarios: core, write-through, secret-fields, list-query, rules and its settings variants). The Rust crates join the release path as the fifth registry (ADR-0065 Amendment 3): scripts/lib/rust-release.mjs publishes the four crates to crates.io after npm behind the same confirm, with a --crates=publish|skip override and a preflight that checks the token and version before any bump — nothing is published. examples/rust-service/ is a complete tasks service built by the new generators and checked by the rust lane; docs (docs/ports/rust.md, feature pages, CONFORMANCE, RELEASING), ADR-0063/0065, the conformance READMEs and the changelog entries are updated to match.
Validation

Risk Assessment

⚠️ Medium: The fixes I checked are sound: route paths now compare by placeholder shape, and the CLI test suite is restored. But the diff is about 35k lines across 199 files and I read only a small part of it, so it is not certified as a whole.

Testing

The configured test command scripts/ci-local.sh --affected --strict-toolchains had already run and passed at the target commit, supplying broad regression; this turn changed no source or test files, so it was not re-run. On top of that I drove three live scenarios: (1) the generated axum tasks API from examples/rust-service, built and served on a local port, answered every documented behavior over curl — create, the REST list query, lifecycle transitions with 403/409/400 named refusals, the state_managed rule, and the public reopen; (2) the restored cargo-meta CLI ran init, gen --list, gen, verify and then refused a hand-edited generated file in verify and gen on a disposable project, and the committed example estate regenerated byte-identical; (3) the review-fixed route-collision guard refused a declared GET /countries/{code} over the derived /countries/{id} with ERR_NAME_COLLISION through the real binary, while the focused service_routes_keys suite (4 passed) proved a same-shaped POST route still compiles and serves beside the derived GET in a real axum router. No screenshot was needed: all surfaces are CLI/HTTP, and the evidence is captured transcripts. Scratch fixtures were deleted, the app server was stopped, and the worktree is clean.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Generated axum tasks API (examples/rust-service) serves the documented flows over HTTP on a local port: create 201, REST-standard list query with filter/sort/withCount, transition start/finish with pe… ✅ pass live a local evidence transcript — curl transcript against tasks_app built from examples/rust-service listening on a local port
cargo-meta CLI lifecycle on a disposable project: init without --transport lists 10 of 11 generators (service-routes stays opt-in), gen --list shows the counts, gen writes the crates, verify reports i… ✅ pass live a local evidence transcript and a local evidence transcript
Route-collision guard (review fix d2f3775): gen refuses a declared GET /countries/{code} that collides with the derived /countries/{id} with ERR_NAME_COLLISION naming get_country and by_code, while… ✅ pass live a local evidence transcript (first block: exit 1, ERR_NAME_COLLISION) plus cargo test -p metaobjects-codegen --test servi…
Evidence: Generated axum tasks API driven over HTTP with curl (create, list query, transitions, 403/409/400 refusals, public reopen)
=== POST /api/tasks (create, x-user: ada) ===
HTTP/1.1 201 Created
content-type: application/json
content-length: 62
date: Wed, 25 Nov 2026 14:16:58 GMT

{"id":1,"notes":null,"status":"todo","title":"Write the docs"}
=== POST /api/tasks (create second) ===
{"id":2,"notes":null,"status":"todo","title":"Ship it"}
=== GET /api/tasks?filter[title][like]=Ship%25&sort=title:desc&withCount=true ===
{"rows":[{"id":2,"notes":null,"status":"todo","title":"Ship it"}],"total":1}
=== POST /api/tasks/1/start (x-user: ada) ===
HTTP/1.1 200 OK
content-type: application/json
content-length: 63
date: Wed, 25 Nov 2026 14:16:58 GMT

{"id":1,"notes":null,"status":"doing","title":"Write the docs"}
=== POST /api/tasks/1/finish (x-user: ada, no lead role) ===
HTTP/1.1 403 Forbidden
content-type: application/json
content-length: 21
date: Wed, 25 Nov 2026 14:16:58 GMT

{"error":"forbidden"}
=== POST /api/tasks/1/finish (x-user: grace, x-role: lead) ===
HTTP/1.1 200 OK
content-type: application/json
content-length: 62
date: Wed, 25 Nov 2026 14:16:58 GMT

{"id":1,"notes":null,"status":"done","title":"Write the docs"}
=== POST /api/tasks/2/start then start again (409 expected) ===
{"id":2,"notes":null,"status":"doing","title":"Ship it"}HTTP/1.1 409 Conflict
content-type: application/json
content-length: 30
date: Wed, 25 Nov 2026 14:16:58 GMT

{"error":"invalid_transition"}
=== PATCH /api/tasks/1 naming status (409 expected) ===
HTTP/1.1 200 OK
content-type: application/json
content-length: 62
date: Wed, 25 Nov 2026 14:16:58 GMT

{"id":1,"notes":null,"status":"done","title":"Write the docs"}
=== GET /api/tasks?filter[notes][eq]=x (400 expected) ===
HTTP/1.1 400 Bad Request
content-type: application/json
content-length: 77
date: Wed, 25 Nov 2026 14:16:58 GMT

{"allowed":["title","status"],"error":"invalid_filter_field","field":"notes"}
=== POST unknown field (400 expected) ===
{"error":"unknown_fields","fields":["owner"]}
=== DELETE /api/tasks/2 (x-user: grace lead) ===
HTTP/1.1 204 No Content
date: Wed, 25 Nov 2026 14:16:58 GMT


=== PATCH /api/tasks/1 naming a DIFFERENT state (done -> todo, 409 state_managed expected) ===
HTTP/1.1 409 Conflict
content-type: application/json
content-length: 25
date: Wed, 25 Nov 2026 14:17:12 GMT

{"error":"state_managed"}
=== POST /api/tasks/1/reopen with NO caller header (public transition, 200 expected) ===
HTTP/1.1 200 OK
content-type: application/json
content-length: 62
date: Wed, 25 Nov 2026 14:17:12 GMT

{"id":1,"notes":null,"status":"todo","title":"Write the docs"}
Evidence: cargo-meta CLI on a fresh project: init (transport opt-in absent), gen --list counts, gen 41 files, verify green, example estate regenerates unchanged
$ cargo meta init --project /mnt/scratch/mo-rust-s2/proj
wrote .metaobjects/config.json
wrote .metaobjects/.gitignore
wrote metaobjects/meta.app.yaml
wrote metaobjects.config.json
next: declare your objects in metaobjects/ (JSON or YAML), then run `cargo meta gen`.
Choose the generators `gen` runs by editing metaobjects.config.json.
Commit .metaobjects/.gen-state/.hashes/ with the generated crates.
Schema migrations are the Node `meta` command's (`meta migrate`), for every server language.
exit=0

# metaobjects.config.json written by init WITHOUT --transport: 10 generators, service-routes absent
{
  "generators": [
    "entity", "rules-names", "contract-types", "repository", "service",
    "client", "commands", "render-helper", "output-parser", "output-prompt"
  ]
}

$ cargo meta gen --project /mnt/scratch/mo-rust-s2/proj --list
metaobjects.config.json runs: entity, rules-names, contract-types, repository, service, client, commands, render-helper, output-parser, output-prompt
entity - model crates, one per metadata package: serde structs, enums, value objects, create and patch inputs, validate() (layer: model) [configured]
rules-names - rules crates, one per package with a lifecycle or an operation: states, transitions, derived commands, operations, permissions and business errors as enums (ADR-0067 layer 0; needs entity) (layer: model) [configured]
contract-types - contract crates, one per package with a declared operation: each operation's input, output, business errors and error body, the read shape of a projection it returns, and the shared wire error crate (ADR-0067 layer 1; needs entity) [configured]
repository - store crates, one per package with stored entities: each entity's table and its list, count, get, create, update, delete and guarded lifecycle update over sqlx, on Postgres and SQLite, and the shared data-access crate (needs entity) (layer: persistence) [configured]
service - service crates, one per package with stored entities: each operation in one transaction, with the policy, body, hook and event traits it calls, the lifecycle checks and the declared operations (ADR-0067 layer 4; needs entity, rules-names, contract-types and repository) (layer: service) [configured]
service-routes - transport crates, one per package with a service: an axum router whose each route reads its request, calls one service operation and sends what it answered, under the shared REST contract (ADR-0067 layer 5; needs service and the four it builds on) (layer: api) [not configured]
client - client crates, one per package with served entities: a typed HTTP client and list query per entity (needs entity) (layer: client) [configured]
commands - command crates, one per package with served entities: clap commands over the client (needs entity and client; Rust only) (layer: client) [configured]
render-helper - prompt crates, one per package with templates: a typed render function per template.output and template.prompt, drift-checked against its payload at build time (needs entity) (layer: capability) [configured]
output-parser - parser crates, one per package with responding prompts: a strict parse and a tolerant extract of each template.prompt's reply into its @responseRef type (needs entity) (layer: capability) [configured]
output-prompt - format crates, one per package with responding prompts: the output-format fragment that tells a model how to shape its answer (layer: capability) [configured]
exit=0

# after writing the example's Task model (one lifecycle, three transitions) into metaobjects/meta.app.yaml:
$ cargo meta gen
gen: 41 files (41 created, 0 updated, 0 unchanged) in 3.7 ms; did not skip: no stored key
  created generated/meta_support/Cargo.toml
  ... (support, tasks, tasks_rules, tasks_store, meta_store, meta_client, tasks_client, meta_service, tasks_service, meta_cli, tasks_cli crates) ...
changed crates: meta_cli, meta_client, meta_service, meta_store, meta_support, tasks, tasks_cli, tasks_client, tasks_rules, tasks_service, tasks_store
exit=0

$ cargo meta verify
cargo meta verify: in sync (the model and every recorded file are unchanged since the last gen; pass --full to render and compare).
cargo meta verify — rules: 0 operation(s), 1 lifecycle(s) with 3 transition(s).
exit=0

# in examples/rust-service (the stand-in estate, generated/ committed):
$ cargo meta gen
gen: 35 files (0 created, 0 updated, 35 unchanged) in 3.1 ms; did not skip: no stored key
exit=0        # and `git status` stayed clean: the committed generated/ is what gen writes today
Evidence: Adversarial drives: ERR_NAME_COLLISION on GET /countries/{code} vs derived /countries/{id} (exit 1), verify/gen hand-edit refusal (exit 1)
$ cargo meta gen --project /mnt/scratch/mo-rust-s3/collide   # Country keyed by code + GET /countries/{code} declared
cargo meta gen failed:
ERR_NAME_COLLISION: the routes get_country and by_code are both GET /countries/{id}: give one a different path
exit=1

$ cargo meta verify --codegen   # after hand-editing generated/tasks/src/task.rs (fixture mo-rust-s2)
error: generated code is out of sync with metadata.
  drifted: generated/tasks/src/task.rs
regenerate (cargo meta gen) and commit the result.
exit=1

$ cargo meta gen   # same hand-edited project
cargo meta gen failed:
refused to overwrite 1 file(s) that differ from what the last run wrote (edited by hand, or not recorded in .metaobjects/.gen-state/.hashes/): generated/tasks/src/task.rs. Restore them, or delete them to generate them afresh.
exit=1
Evidence: Focused route-keys suite: 4 passed, including the placeholder-name collision refusal and the probe that builds and serves the mixed-method route pair in a real axum router
running 4 tests
test a_declared_route_that_differs_from_a_derived_one_by_a_placeholder_name_is_refused ... ok
test a_declared_route_over_a_derived_one_is_refused ... ok
test text_and_int_keys_build_through_the_transport ... ok
test a_declared_route_that_shares_a_derived_paths_shape_under_another_method_serves_with_it ... ok

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.51s
  • Outcome: ⚠️ 1 info across 1 run (10m4s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

⏭️ **Rebase** - skipped
  • ⚠️ docs/CONFORMANCE.md - merge conflict rebasing onto origin/main
  • ⚠️ docs/ports/rust.md - merge conflict rebasing onto origin/main
  • ⚠️ scripts/release.mjs - merge conflict rebasing onto origin/main
  • ⚠️ server/rust/metaobjects-cli/Cargo.toml - merge conflict rebasing onto origin/main
  • ⚠️ server/rust/metaobjects-cli/src/lib.rs - merge conflict rebasing onto origin/main
  • ⚠️ server/rust/metaobjects-cli/tests/cli.rs - merge conflict rebasing onto origin/main
  • ⚠️ server/rust/metaobjects-render/src/lib.rs - merge conflict rebasing onto origin/main
  • ⚠️ server/rust/metaobjects-render/src/verify.rs - merge conflict rebasing onto origin/main
  • ⚠️ server/rust/metaobjects-render/tests/verify_conformance.rs - merge conflict rebasing onto origin/main
✅ **Review** - 3 findings, all fixed
  • ✅ server/rust/metaobjects-codegen/src/service_routes.rs - the route-collision check compared paths as raw strings, so GET /countries/{code} over the derived /countries/{id} passed it and axum would panic building the router. Fixed in d2f3775: paths that differ only in placeholder names are one route, and gen refuses the pair with ERR_NAME_COLLISION.
  • ✅ server/rust/metaobjects-cli/tests/cli.rs - an earlier merge of main had left the cargo meta end-to-end suite as an empty file. Fixed in bdbdb93: main's suite restored with this branch's changes re-applied, plus the service-routes opt-in in the list counts.
  • ✅ docs/CONFORMANCE.md:39 and docs/features/cli.md - stale port coverage text (list-query/rules named TypeScript and C# only; the Rust CLI called unpublished). Fixed in bdbdb93: the row names Rust for list-query/ and rules/, and the CLI line matches docs/RELEASING.md.
⚠️ **Test** - 1 info
  • ℹ️ examples/rust-service/README.md summarizes "a PATCH naming status 409 state_managed", but the generated service only refuses a patch that names a DIFFERENT state; naming the state the row is already in is a documented no-op and answers 200 (verified live: PATCH {"status":"done"} on a done task returned 200, PATCH {"status":"todo"} on the same row returned 409 state_managed, matching the generated rule "naming the state the row is in is no move" in generated/tasks_service/src/task.rs and the app test which patches to a different state). README shorthand only; code and tests agree.
  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Generated axum tasks API (examples/rust-service) serves the documented flows over HTTP on a local port: create 201, REST-standard list query with filter/sort/withCount, transition start/finish with pe… ✅ pass live a local evidence transcript — curl transcript against tasks_app built from examples/rust-service listening on a local port
cargo-meta CLI lifecycle on a disposable project: init without --transport lists 10 of 11 generators (service-routes stays opt-in), gen --list shows the counts, gen writes the crates, verify reports i… ✅ pass live a local evidence transcript and a local evidence transcript
Route-collision guard (review fix d2f3775): gen refuses a declared GET /countries/{code} that collides with the derived /countries/{id} with ERR_NAME_COLLISION naming get_country and by_code, while… ✅ pass live a local evidence transcript (first block: exit 1, ERR_NAME_COLLISION) plus cargo test -p metaobjects-codegen --test servi…
  • scripts/ci-local.sh --affected --strict-toolchains
  • Baseline broad regression: scripts/ci-local.sh --affected --strict-toolchains (already ran and passed at target commit bdbdb93d35; no source or test files changed in this turn, so not re-run)
  • Scenario 1: built examples/rust-service (cargo build --release -p tasks_app, exit 0), ran the binary on a local port with in-memory SQLite, drove it with curl over TCP: POST create (201), REST list query filter/sort/withCount, POST /1/start (200 doing), finish without lead (403 forbidden), finish as lead (200 done), double start (409 invalid_transition), PATCH naming a different state (409 state_managed), PATCH naming the current state (200 no-op), reopen with no caller (200), invalid filter field (400 invalid_filter_field), unknown create field (400 unknown_fields), DELETE (204)
  • Scenario 2: server/rust/target/release/cargo-meta meta init --project (10 of 11 generators, service-routes absent), meta gen --list (service-routes [not configured]), meta gen on a Task model (41 files), meta verify (in sync, 1 lifecycle 3 transitions), hand-edited generated/tasks/src/task.rs then meta verify --codegen (exit 1 naming the drifted file) and meta gen (exit 1, refused to overwrite)
  • Scenario 2b: cargo meta gen in examples/rust-service reported 35 files unchanged and git status stayed clean, proving the committed generated/ output is what gen writes today
  • Scenario 3 adversarial: cargo meta gen on a fixture with Country keyed by code plus declared GET /countries/{code} (exit 1, ERR_NAME_COLLISION naming get_country and by_code, path normalized to /countries/{id})
  • Scenario 3b: cargo test -p metaobjects-codegen --test service_routes_keys (4 passed), including a_declared_route_that_differs_from_a_derived_one_by_a_placeholder_name_is_refused and a_declared_route_that_shares_a_derived_paths_shape_under_another_method_serves_with_it, which generates the PUBLISH model, compiles the generated workspace and serves POST /countries/{code} beside derived GET /countries/{id} through a real axum router
⚠️ **Document** - 2 infos
  • ℹ️ fixtures/api-contract-conformance/jsonb/README.md:150 - The api-contract sub-corpus READMEs (jsonb/ line 150, projection/ line 96, report/ line 161, tph/ line 107) still say lane coverage runs 'on all five ports'. Rust does not run these sub-corpora (its api_contract.rs LEDGER lists them), so the statements are not false — they describe the five ports wired to each sub-corpus — but a reader comparing with the updated CONFORMANCE.md matrix row sees six ports. Left untouched per the one-owner policy: docs/CONFORMANCE.md's matrix row (updated by this change) owns per-port corpus standing, and these sections flip naturally when each port's work lands. Follow-up option: add a one-line Rust carve-out to each lane-coverage section when the sub-corpus is built.
  • ℹ️ docs/features/extending-with-providers.md:148 - Several 'all five ports' claims predate this change and were already incomplete for Rust at the base commit (Rust providers, field.map BTreeMap codegen in docs/features/field-types.md line 78, and the cross-field validation cases in docs/features/entities.md line 391 all existed and passed at d9ddffa). This change did not alter those facts, so they are out of scope here and were left alone. A repo-wide 'five ports' sweep would touch many files and is better as its own pass, ideally alongside the next Rust capability landing.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Gate: one no-mistakes run (rebase step skipped: the branch merges cleanly with main; review fixed three findings: a placeholder-name route collision, a test suite an earlier merge had emptied, stale Rust doc lines).

…s own their layout

Three plan rows on the Rust lane, folded into one branch.

- render-helper, output-parser and output-prompt generators over the
  metaobjects-render crate: a prompts, parsers and formats crate per
  package, held to the render, template-output and extract corpora;
  verify --templates checks prompt bodies; eject copies all three.
- A6: the Rust crates join scripts/release.mjs as the fifth registry
  (crates.io after npm, dependency order, changed-since-tag selection,
  token and free-version preflight); a release-tag gate in ci-local.
- W-RS-1 (ADR-0063): a syn-based layout ratchet whose allowlist only
  shrinks; nine rust writer-conformance cases, each a rustfmt fixed
  point under the generated crates' rustfmt.toml; generator options in
  metaobjects.config.json through Generator::configure, refused with
  ERR_UNKNOWN_GENERATOR_OPTION; a *Parts trait per shipped generator,
  one default method per output piece. Output is byte-identical except
  that assign now moves an array right-hand side to the next line where
  rustfmt does.
…s 0 and 1)

rules-names writes a <package>_rules crate for a package with a lifecycle or a
declared operation: lifecycle states and transitions (on the model's own enum),
derived commands, operations, permissions and business errors as closed enums.
contract-types writes a <package>_contract crate per package with a declared
operation: input, output, business-error enum and error body per operation, the
read shape of a returned projection, and the shared meta_contract wire error
crate. Both are silent without the rules vocabulary, so default runs are
unchanged; rules_inert holds them to adding files only.
…d update (ADR-0067 layer 3)

A <package>_store crate per package with a stored entity, over the shared
meta_store crate: list (nine filter operators, sort, paging), count, get,
create, update, delete, and per lifecycle the guarded update
transition_<field>(id, from, to). Postgres and SQLite. Tested on SQLite in
memory against the persistence corpus rows; the rules-inert test holds the
data-access layer to appending the guarded update only.
…tore on Postgres

A throwaway Postgres (docker run --rm, tmpfs, durability off) per test run,
a fresh database per scenario, the committed schema and seeds, and each
query through the generated store functions, normalized per
normalization.md. 25 of 55 scenarios pass; many-to-many, projections and
reports are on a shrink-only ledger.

Fixes it found in meta_store: a string field stored in its own SQL type
(@dbColumnType uuid/jsonb) is cast on write and read; a negative duration
binds as microseconds; temporals truncate to milliseconds.
…rated store

A served read (a concrete projection or report whose read source is a view) gets a read-only
struct in its model crate, from the report shape for a report, and a read-only store module.
A view's numbers are read through a cast to their field's type. The persistence runner runs the
24 report and 3 projection scenarios; only the three many-to-many ones stay on its ledger.
… store

A many-to-many relationship of a keyed entity gets <relation>_of, the related rows read through
the junction in one statement: hetero, directed self-join, and symmetric self-join, which keeps
a row relating a record to itself. The junction and its keys come from the core's
derive_m2m_fields, the derivation the loader's pairing rule now runs too. The persistence runner
runs all 55 scenarios on Postgres and its ledger is empty.
main added rules-names and contract-types for C#; this branch added them for Rust under the
same keys, so the shared registry held each key twice and the later one won. One entry each
now names both ports, with the Rust shape in its concept.
…e-gate sandbox

scripts/lib/rust-release.mjs carried JSDoc but matched no include in
tsconfig.scripts.json, so the scripts typecheck gate refused it; it is now
included and fully typed. The eject-release-gate test copies the release
scripts into a sandbox, and release.mjs imports rust-release.mjs, so the
sandbox list names it too.
…h the generated store

meta_store::transition takes a transition's @condition (a Condition over
the CHECK subset: the six comparisons, null tests, and/or/not, coalesce)
and ANDs it into the one guarded UPDATE; a literal compared with a field
takes that field's stored form. The Rust persistence runner drives
op: guardedUpdate, so all 56 Postgres scenarios run with an empty ledger.
…r 4)

The `service` generator writes a `<package>_service` crate per package with a
stored entity: `<Pkg>Service`, generic over the pool and the actor type, with
the derived list (page 50, or `api.pagination`), get, traversal, create,
update and delete, a command per derived transition and a shell per declared
operation. Each write runs in one sqlx transaction, or in a caller's through
its `_in` twin, with ADR-0066 §6's checks in order, `state_managed`, the
initial-state create rule and `@autoSet` stamping (ADR-0045 Amendment 1).
The app supplies `<Pkg>Policy`, `<Pkg>Bodies`, `<Pkg>Hooks` (before/after over
the `<Pkg>Before`/`<Pkg>After` enums) and `<Pkg>Events`; the shared
`meta_service` crate holds the error codes and the guarded move.

The stored-entity and rules-names walks move into the engine module
`metaobjects_codegen::layers`, so ejected generators call the same walk. The
writer gains `where_block`. tests/service.rs runs the rules corpus scenarios
through the service on SQLite and checks @autoset on the tph model;
rules_inert pins what the service changes; the scale budget rises for the new
crate. The HTTP transport is the next row (L-RS-4).
Conflicts: the Rust template gate was built on both sides. Main's
CLI gate (templates.rs, with the @responseRef reply check) is kept;
the branch's duplicate check_templates CLI path is dropped. Main's
verify.rs is kept with the branch's const PayloadField constructors
(Cow) that generated render helpers need, so the Rust override
fixtures expected-drift.rust.json go. Plan::build takes main's
reference set. CHANGELOG bullets move to changelog.d fragments.
…utes)

The Rust port's sixth ADR-0067 layer: an opt-in `service-routes` generator
writes a `<package>_http` crate per package and a shared `meta_http` crate,
whose `router(service, actor)` mounts the generated service with the
derived CRUD, traversal, transition and declared-operation routes, the
REST-standard list query and the named refusals.

- `cargo meta init --transport` lists it; a plain init and a project with
  no generator list leave it out, and `gen --list` marks it opt-in.
- Credential fields are never returned; an entity with a read view beside
  its table is read back through the view (the store's `Table.read`).
- A field with no `@sortable` is sortable when it is filterable, as in TS.
- The shared service walk moves to `layers::service`, which an owned copy
  may name.
- Tests: the api-contract generated lane over HTTP (core, write-through,
  secret-fields, list-query, rules and its settings, 77 scenarios; the
  rest ledgered), all 95 list-query cases, and `examples/rust-service/`,
  a tasks service the rust lane verifies and tests.
- Docs: the Rust port page, ADR-0065 Amendment 7, a Rust column in
  CONFORMANCE.md, the corpus READMEs and a changelog fragment.
- A text key is borrowed and an int key read into its own type (int_key
  is generic, out of range is invalid_id); text_key is gone.
- A declared route over a derived one is ERR_NAME_COLLISION at gen, not
  an axum panic at startup.
- Handler locals are on_<name>, so no operation name shadows the router.
- --generators naming an opt-in generator with no list is refused.
- The service and transport crate names are claimed like the store's;
  the suffixes live once, in plan.
- A report column carrying a credential's type stays a credential.
- gen_bench writes the prompt body the fitness model references.
@dmealing
dmealing merged commit 3cbca8a into main Nov 25, 2026
11 checks passed
@dmealing
dmealing deleted the fm/mo-130-lane-rust-6 branch November 25, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant