Skip to content

Commit cf1e522

Browse files
dmealingclaude
andcommitted
docs(cli): cross-port CLI matrix + CLAUDE.md accuracy (SP-E Unit 4)
Adds docs/features/cli.md (the per-port command matrix + the locked architecture: schema = Node meta only; codegen = each build tool; the two meanings of verify). CLAUDE.md updated: C# CLI is `dotnet meta`; Python ships a `metaobjects` console-script; Java maven-plugin gains a codegen-drift `meta:verify` (distinct from the removed live-DB one); Useful-commands points to the matrix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6186583 commit cf1e522

2 files changed

Lines changed: 86 additions & 3 deletions

File tree

CLAUDE.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ _Last refreshed 2026-05-30._
2424
**All five ports ship loader + canonical serializer + conformance + codegen + render + payload-VO + `verify`:**
2525

2626
- **TypeScript**`codegen-ts` (Vite-style plugins; Drizzle, Zod, Fastify) + `runtime-ts` + `migrate-ts` + the universal web client packages (`runtime-web`, `react`, `tanstack`).
27-
- **C#**`MetaObjects` (loader + canonical serializer + conformance) + `MetaObjects.Render` (Mustache + payload-VO + `verify`) + `MetaObjects.Codegen` (EF Core entities + `AppDbContext` + CRUD minimal-API routes). Schema migrations are TS-owned (ADR-0015): the C# migrate engine and the `migrate`/`--from-db` CLI surface were removed; the C# `meta` CLI is `verify`/`gen` only. EF Core runtime data-access stays per-port.
28-
- **Java** — `metadata` + `omdb` + `om` + `dynamic` + `core-spring` + `metadata-ktx` (Kotlin facade) + `codegen-spring` (Spring controllers + DTOs + repositories + filter allowlists + payload records + output parsers) + `codegen-mustache` + `codegen-plantuml` + `render` + `maven-plugin` (`meta:gen`/`meta:editor`). FR-003 (OMDB runtime persistence + binding registry + typed jsonb + Spring-tx + source/origin metamodel) fully shipped, including Plan 4 (engine-debt remediation: atomic mapping cache, JDBC codec registry, `inTransaction` template). **Schema migrations are owned by the TypeScript toolchain** (`@metaobjectsdev/cli migrate`); the Java port's diff-and-converge migration engine and its `meta:migrate` / live-DB-drift `meta:verify` Maven goals were removed, and per ADR-0015 Decision 2 the dev/test runtime auto-create path (`MetaClassDBValidatorService` + the drivers' `createTable`/`createIndex`/`createForeignKey`/`createSequence` DDL) is **also** removed — **OMDB is pure data-access** (CRUD/query/codec/transactions only).
29-
- **Python**`metaobjects` (loader + canonical serializer + conformance + render + verify + codegen) + an `ObjectManager` runtime layer. The `migrate` module was removed (schema is TS-owned, ADR-0015); Python is pure data-access (codegen + ObjectManager runtime). All five conformance corpora green.
27+
- **C#**`MetaObjects` (loader + canonical serializer + conformance) + `MetaObjects.Render` (Mustache + payload-VO + `verify`) + `MetaObjects.Codegen` (EF Core entities + `AppDbContext` + CRUD minimal-API routes). Schema migrations are TS-owned (ADR-0015): the C# migrate engine and the `migrate`/`--from-db` CLI surface were removed; the C# CLI is `gen`/`verify` only, packaged as a .NET tool invoked **`dotnet meta`** (not a bare `meta` — that name belongs to the Node schema CLI). EF Core runtime data-access stays per-port.
28+
- **Java** — `metadata` + `omdb` + `om` + `dynamic` + `core-spring` + `metadata-ktx` (Kotlin facade) + `codegen-spring` (Spring controllers + DTOs + repositories + filter allowlists + payload records + output parsers) + `codegen-mustache` + `codegen-plantuml` + `render` + `maven-plugin` (`meta:gen`/`meta:editor` + a `meta:verify` **codegen-drift** goal — distinct from the removed live-DB `meta:verify`; Kotlin generators run through `meta:gen` via the shared SPI). FR-003 (OMDB runtime persistence + binding registry + typed jsonb + Spring-tx + source/origin metamodel) fully shipped, including Plan 4 (engine-debt remediation: atomic mapping cache, JDBC codec registry, `inTransaction` template). **Schema migrations are owned by the TypeScript toolchain** (`@metaobjectsdev/cli migrate`); the Java port's diff-and-converge migration engine and its `meta:migrate` / live-DB-drift `meta:verify` Maven goals were removed, and per ADR-0015 Decision 2 the dev/test runtime auto-create path (`MetaClassDBValidatorService` + the drivers' `createTable`/`createIndex`/`createForeignKey`/`createSequence` DDL) is **also** removed — **OMDB is pure data-access** (CRUD/query/codec/transactions only).
29+
- **Python**`metaobjects` (loader + canonical serializer + conformance + render + verify + codegen) + an `ObjectManager` runtime layer. The `migrate` module was removed (schema is TS-owned, ADR-0015); Python is pure data-access (codegen + ObjectManager runtime), with a **`metaobjects` console-script** (`gen`/`verify` codegen — no `migrate`). All five conformance corpora green.
3030
- **Kotlin**`codegen-kotlin` (KotlinPoet on JVM): entity + Exposed table + Spring controller + payload + relations + filter allowlist + validator + stored-proc + output-parser generators. `integration-tests-kotlin` runs the persistence-conformance corpus through Exposed against Testcontainers Postgres.
3131

3232
**Cross-port conformance corpora** (every port runs the shared corpus):
@@ -472,6 +472,13 @@ meta migrate # diff metadata vs DB schema; emit migrati
472472
meta migrate --dry-run # preview without writing migration file
473473
```
474474

475+
The above is the **Node `meta`** (schema + TS codegen). Each non-TS port runs
476+
codegen through its own build tool — `dotnet meta gen`/`verify` (C#),
477+
`mvn metaobjects:generate`/`:verify` (Java/Kotlin), `metaobjects gen`/`verify`
478+
(Python). Schema (`migrate`, `verify --db`) is Node-`meta`-only. Full matrix +
479+
rationale: [docs/features/cli.md](docs/features/cli.md) (locked CLI architecture,
480+
ADR-0015).
481+
475482
## Running tests
476483

477484
The Bun workspace root is the **repository root** (`/package.json`), which globs `server/typescript/packages/*` and `client/web/packages/*`. Java/Python/C# live outside the JS workspace (not globbed). Run `bun install` **once at the repo root**. Run `bun test` **scoped**`cd server/typescript && bun test` for the server suite (this also picks up `server/typescript/bunfig.toml`'s test preload), and per-package for `client/web`. **Never run a bare `bun test` at the repo root**: it walks `java/`, `python/`, `csharp/`, and `fixtures/` looking for test files, turning a ~3-second run into minutes.

docs/features/cli.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Command-line tools (per-port CLI matrix)
2+
3+
MetaObjects deliberately does **not** ship one universal binary. Per the CLI
4+
architecture locked in
5+
[`docs/superpowers/specs/2026-05-30-ts-schema-authority-consolidation-design.md`](../superpowers/specs/2026-05-30-ts-schema-authority-consolidation-design.md)
6+
and [ADR-0015](../../spec/decisions/ADR-0015-single-shared-migrate-engine.md), the
7+
command surface splits in two:
8+
9+
- **Schema is language-agnostic** — it operates on the shared canonical metadata +
10+
a DB connection. It lives in **one canonical Node `meta` CLI** (`migrate`,
11+
`verify --db`), used by any project regardless of backend language, shipped as a
12+
standalone binary so non-TS adopters need no Node toolchain for schema ops. This
13+
is the "Flyway/Atlas-style standalone tool" model — not re-implemented per
14+
language.
15+
- **Codegen is inherently language-specific** (`codegen-spring` is Java,
16+
`codegen-ts` is TS, …) — so it runs in **each language's own build tool**. There
17+
is no unified codegen binary, no proxying, and no `meta-ts`/`meta-java` names.
18+
19+
## The matrix
20+
21+
| Capability | Tool | Invocation | Notes |
22+
|---|---|---|---|
23+
| Project scaffold (`init`) | Node `meta` | `meta init` | TS projects |
24+
| **Schema migrate** | **Node `meta`** | `meta migrate` | **any backend** — schema is Node-only (ADR-0015) |
25+
| **Schema drift** (`verify --db`) | **Node `meta`** | `meta verify --db` | **any backend** — live-DB drift, Node-only |
26+
| TS codegen | Node `meta` | `meta gen` | TS projects |
27+
| C# codegen | `dotnet meta` | `dotnet meta gen` / `verify` | a .NET tool (`ToolCommandName=dotnet-meta`); invoked `dotnet meta` so it never shadows the Node `meta` |
28+
| Java/Kotlin codegen | Maven plugin | `mvn metaobjects:generate` (`meta:gen`) | Kotlin generators run through the same goal — see below |
29+
| Java/Kotlin codegen drift | Maven plugin | `mvn metaobjects:verify` (`meta:verify`) | regenerate + fail on drift vs committed output (generator-neutral) |
30+
| Python codegen | console-script | `metaobjects gen` / `verify` | `[project.scripts] metaobjects`**not** `meta` (that's the Node schema CLI) |
31+
32+
## Two meanings of `verify` — keep them distinct
33+
34+
- **Schema `verify --db`** (Node `meta`, any backend): live-DB drift — does the
35+
database match the metadata? Node-only, ADR-0015.
36+
- **Codegen `verify`** (`dotnet meta verify`, `mvn meta:verify`, `metaobjects
37+
verify`): regenerate code from metadata into a temp location and fail if it
38+
differs from the committed generated output — "a teammate changed metadata
39+
without regenerating → caught". This is the enterprise-CI primitive added per
40+
port; it does **not** touch a database.
41+
- (Separately, the FR-004 **template/prompt** drift check — `Renderer.verify`
42+
also surfaces under `verify` in the ports that ship it; it checks `{{...}}`
43+
references against the payload VO. It is a third, orthogonal facet.)
44+
45+
## Schema is Node-only — by design
46+
47+
No port other than the Node `meta` exposes `migrate` or `verify --db`. The C#,
48+
Java, Python, and Kotlin command surfaces are **codegen only** (`gen` + codegen
49+
`verify`). The Java port's former `meta:migrate` / live-DB `meta:verify` Maven
50+
goals and the C#/Python migrate surfaces were removed in the schema-authority
51+
consolidation; the only schema entry point anywhere is the Node `meta`.
52+
53+
## Running Kotlin codegen via Maven
54+
55+
`codegen-kotlin`'s generators extend `MultiFileDirectGeneratorBase` — the same
56+
generator SPI the `meta:gen` Mojo loads — so they run through the existing goal
57+
with no Kotlin-specific Mojo. Configure a Kotlin generator on the Maven plugin:
58+
59+
```xml
60+
<plugin>
61+
<groupId>com.metaobjects</groupId>
62+
<artifactId>metaobjects-maven-plugin</artifactId>
63+
<configuration>
64+
<generators>
65+
<generator>
66+
<classname>com.metaobjects.generator.kotlin.KotlinEntityGenerator</classname>
67+
<args><outputDir>${project.build.directory}/generated-sources/kotlin</outputDir></args>
68+
</generator>
69+
</generators>
70+
</configuration>
71+
</plugin>
72+
```
73+
74+
`mvn metaobjects:generate` emits the Kotlin sources; `mvn metaobjects:verify`
75+
codegen-drift-checks them. See `server/java/codegen-kotlin/README.md` for the full
76+
generator list.

0 commit comments

Comments
 (0)