Skip to content

feat!: finish the 1.3.0 codegen move — writer-only TypeScript, non-Long JVM/Python keys, every port on the xpkg corpus - #678

Merged
dmealing merged 12 commits into
mainfrom
fm/mo-130-codegen-finish
Nov 29, 2026
Merged

dmealing merged 12 commits into
mainfrom
fm/mo-130-codegen-finish

Conversation

@dmealing

@dmealing dmealing commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Finishes the 1.3.0 codegen move: TypeScript generation now runs only through the code writer (ADR-0063), and the old codegen is gone. The PR also fixes non-Long primary keys on the JVM and in Python, runs the cross-package value-object corpus in every port, and removes the last C# shims.

Refs #547
Refs #549

Removed

  • TypeScript printer and shims:

    • the vendored ts-poet printer (poet.ts) and every tagged-template importer;
    • the format.ts shim (formatTs, a no-op);
    • the deprecated Generator markers (emitsEntityModule, emitsQueries, emitsNames, emitsReportExport, emitsUiTier, emitsHonoRoutes, mountsRoutes, emitsApiDocs, emitsModelDocs, provides.modelDocs);
    • the name-based tier guessing and the legacy-routes fallback.
  • Docs generators:

    • the classic docs site;
    • the docs Markdown generator (docs-file.ts and its builders);
    • the human requirements-markdown page.

    requirements.toon and agent/requirements.md render exactly as before. A config that still lists a removed docs generator now fails meta gen with an error that names it and its replacement.

  • Owned 1.2 shims:

    • the poet re-exports;
    • the CLI's ts-poet import rewrite in ejected copies;
    • the Biome pass in the owned-copy compare.

    Owned 1.2 copies that import poet names no longer compile. docs/features/migrations/owned-generators-1.2-to-1.3.md covers the upgrade.

  • Dependencies: Biome, ts-poet and yaml (the last from docs-site). The install-size budget comes down by about 11.5 MB.

  • C#: the ValueObjectNames.Names shim and the string forms of XmlDocBuilder.

Converted to the writers

  • TypeScript: the requirement-test scaffolds and client-directive.ts now use TsWriter. Code that spliced one fragment into another uses the writer's fragments: frag, joinFrags, importName, importType, Frag, TsImport.
  • api-docs renderers: TypeScript, Python and Kotlin. The Kotlin one now uses KotlinWriter.

D fixes

  • D1–D3, non-Long primary keys (UUID, String, Int):
    • Java, Kotlin and Python generate and serve these keys.
    • A new api-contract key-types/ sub-corpus (12 scenarios) proves it in the generated lane on every port, Rust included.
    • The docs and the KNOWN_GAPS entries are updated.
  • D4:
  • D5: xpkg-value-object-refs runs in every port except Rust, which has no generator for it. docs/CONFORMANCE.md is updated.

Output changes that are not layout

Every other diff in the generated output and the showcase is layout from the writers.

  • TypeScript routes: a CRUD mount on a primary key not named id now passes idColumn: "<key>", and runtime-ts addresses that column. Before this, every item route on such an entity answered 500.
  • C# routes:
    • Item routes over a uuid key spell global::System.Guid.
    • M:N traversal routes over uuid junction keys do the same; they used to fall back to long.
  • Kotlin create:
    • A create on an entity with an assigned key writes that key.
    • On a TPH subtype, a create body that omits the assigned key now answers 400 invalid_type instead of 500.
  • Java: a generated name that clashes with another import is now written fully qualified, so the code compiles.
  • Metamodel docs:
    • The index carries one new sentence about language-specific vocabulary.
    • Each type page has a new "Language-specific to" line.
    • site-reference/ is rebuilt to match.
  • meta eject --list: a statement re-wrapped across lines now reads DIFFERS. The Biome pass used to hide it.
  • meta gen warning: a generator copy that keeps a shipped name but declares no provides still runs, and meta gen now warns, naming the declaration the shipped generator makes. A CLI test checks the name-to-provides table against the shipped generators.
  • meta init --with-docs: wires the generator-based docs instead of the removed classic site.
  • contract-types: the layout of the emitted file changed. Its content did not.

Tests

The full scripts/ci-local.sh ran once on every lane. After the fixes, the lanes those fixes touched ran again: ts, csharp, java (with Kotlin), rust and gates.

Port Result
TypeScript build and typecheck pass; conformance and integration 2207 pass, 12 skip; unit suites green
Python 5467 passed; integration 498 passed, 15 skipped
Java reactor green; integration-tests 438 run, 0 failures, 2 skipped
Kotlin conformance green; codegen-kotlin green, including the new TPH test; integration-tests-kotlin 474 run, 0 failures, 7 skipped
C# conformance green; MetaObjects.Codegen.Tests 2047 passed, 1 skipped
Rust all test runs pass; cargo publish --dry-run passes
Other lanes mutation, packs, cube and showcase green; all gates green

mypy: the Python package reports 202 errors on this branch and on main alike. This PR adds no new errors. #547 lists only 3 known errors, so that baseline is out of date.

Releases: #547's "done when" also asks for the ports to be released. Publishing is not part of this PR.

Validation: not run through no-mistakes.

🤖 Generated with Claude Code

…and xpkg corpora

The Python loader now ports the TypeScript origin.function, dotted-path
origin.computed, correlated origin.first filter, grain passthrough and
derived-cycle checks, so error-origin-function-free-sql and
projection-view-vocabulary-rc21 pass and the expected-failures ledger is
empty. A bare @from on a projection resolves in the file's default package.

The generated key-types api-contract lane and the xpkg-value-object-refs
codegen corpus now run in Python; the docs no longer claim single-int keys.
fixtures/api-contract-conformance/key-types/ drives generated CRUD for a
client-assigned uuid, natural string and int primary key. It runs in the
C#, Rust and TypeScript generated lanes. C# found that a Guid key's
routes did not compile (no using System); the key type is now spelled
global::System.Guid.

Removes the obsolete C# ValueObjectNames.Names shim and the string forms
of XmlDocBuilder (AppendTo, Indent, Prepend); output is unchanged.
… page

The docs, the agent-context skills and their shipped copies no longer
describe docsFile(), the classic site, the legacy generator markers,
formatTs or the Biome owned-copy comparison as current. A new upgrade
page covers owned 1.2 generator copies, which no longer load.
mountCrudRoutes (Fastify and Hono) read the key from the id column, so an
entity keyed on a natural code or an int rank answered every item route
with a 500. The mounts take idColumn, and the generated routes pass it
when the key field has another name (the key-types corpus found it).

Also adds the changelog fragments for the removals and fixes so far.
…oet and the 1.2 shims

TypeScript codegen is writer-only. Removed:
- docsFile() / "docs" and its builders, templates and corpora; meta gen
  names the removal and points at docsSiteFile() and agentDocsFile();
  meta init --with-docs wires docsSiteFile() and apiDocsFile()
- the classic docs site (docsSiteFile({ site: "classic" }) now throws)
- the vendored ts-poet printer (poet.ts) and its exports; every template,
  client-directive and the requirement-test scaffolds write through
  TsWriter, and api-doc-render.ts through the code writer
- the nine legacy Generator markers, provides.modelDocs and the name
  fallbacks; the runner refuses a generator still setting a marker
- formatTs, the ts-poet import rewrite and the Biome owned-copy compare

Generated CRUD routes pass idColumn for a key not named id. The metamodel
index page now names the explorer. Owned 1.2 generator copies must be
re-ejected; contract-types output changes layout only.
…e install budget

The CLI install is 12 MB smaller (34.6 MB from 46.6 MB) now that the
owned-copy compare runs no formatter and nothing imports ts-poet.
…cific

Closes #549's two rows. A type can carry ports, the type-level twin of
the attr marker, for vocabulary that is language-specific by nature and
never pending: the generic view.* controls are ports [typescript] (the
TS client tier serves every backend) and @object is ports [java, kotlin].
The rc.21 view vocabulary is implementedIn csharp, python, typescript now
that Python validates it. Every port still loads all of it strictly; the
manifest, the metamodel docs (a 'Language-specific to' line) and meta
types read the new field.

Also regenerates the agent-context conformance corpus for the 1.3 skill
edits, re-syncs the example owned copies for idColumn, and rewrites the
CONFORMANCE.md split-coverage entry.
…docs writer

Java and Kotlin run the key-types api-contract corpus in their generated
lanes (uuid, string and int keys). The Kotlin controller writes an
assigned key from the body on create. The Java entity generator writes
same-named types from two packages fully qualified instead of refusing
the model, and Java and Kotlin run xpkg-value-object-refs.
KotlinApiDocsRenderer moves onto KotlinWriter, byte for byte.

CONFORMANCE.md records the key-types sub-corpus on every port and the
xpkg corpus on every port but Rust.
- Kotlin: a TPH subtype create with an assigned key 400s a body that
  omits it (invalid_type), instead of a 500 from dto.pk!!.
- C#: M:N traversal routes over uuid junction keys spell the key type
  global::System.Guid, as the item routes do; WriteReadId's comment is
  back above it.
- TS: meta gen warns about a generator copy that carries a shipped name
  and declares no provides at all (SHIPPED_PROVIDES_BY_NAME, held to the
  shipped generators by a cli test); runtime-ts tests idColumn on both
  mounts.
- The install-size gates no longer describe a vendored printer.
- CI: one change per changelog fragment, the api-contract count 191,
  site-reference rebuilt, the install budget set 0.5 MB above the
  measurement (still 11.5 MB under main's), and the showcase regenerated
  (layout only: the Kotlin and Python writers).
The Python and Kotlin site excerpts follow the regenerated showcase
(layout only), and the comment on undeclaredProvides names the test that
holds it, ui-tier-marker-parity.test.ts.
@dmealing
dmealing merged commit 90ae22e into main Nov 29, 2026
11 checks passed
@dmealing
dmealing deleted the fm/mo-130-codegen-finish branch November 29, 2026 01:24
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