Skip to content

feat: render the agent pages from the docs view in every port - #674

Merged
dmealing merged 23 commits into
mainfrom
fm/mo-130-agent-pages
Nov 28, 2026
Merged

dmealing merged 23 commits into
mainfrom
fm/mo-130-agent-pages

Conversation

@dmealing

@dmealing dmealing commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

What Changed

  • Agent pages in all six ports. C#, Java, Kotlin, Python, Rust and TypeScript now write requirements.toon, agent/requirements.md and the model-only agent/schema.md from the docs view alone. Each port renders the shared Mustache templates under templates/requirements/ and templates/agent/. scripts/sync-doc-templates.sh syncs those templates into each port, and ci-local gates the sync. Each port runs a docs-page conformance test against fixtures/docs-page-conformance. A TypeScript project with no dialect now gets the model-only agent/schema.md. Every port's schema page leaves out a dependency's objects that scope.include does not name. Rust has no requirement ledger yet, so its pages list every requirement in the view; docs/ports/rust.md says so. Java and Kotlin now filter rows through the shared ledger filter, and C#'s extra scope-only filter on the schema page is removed.
  • Docs view gains a storage section. Every builder adds {physical, dialect, tables, views}, with table and column names from each port's naming helpers. The physical facts are null or false unless a TypeScript run with a dialect fills them. fixtures/explorer-conformance pins the section. Because explorer.json now carries it, the explorer stamp pins in each port were re-pinned. The human requirements.md is retired in every port: the explorer shows the ledger, and the ledger-* fixtures were renamed to match.
  • Always-on agent file links the pages. In TypeScript, meta init and meta agent-docs (which the C# and Java commands hand off to) add a "Pages generated for this project" section to .metaobjects/AGENTS.md. Python's metaobjects agent-docs does the same. The list comes from the committed .metaobjects/.gen-state/.hashes/ and names only the pages the last gen wrote. With no pages wired, the file is byte-identical to before. A new fixtures/agent-pages-pointer corpus has 3 cases, which takes the shared corpus count from 48 to 49 in CONFORMANCE.md, AGENTS.md and the site payload. Docs, the changelog entry and a false reference claim in the api-docs header are fixed. The pages are built without "\n" literals so they pass the layout ratchets.
Validation

Risk Assessment

✅ Low: This round only changes the subDir default and its path prefix in three generators that are new in this PR, plus a stack-neutral pointer text. Default output paths and the conformance-pinned bytes are unchanged, the shipped bundles and manifests are consistent, and earlier rounds already reviewed the rest of the change.

Testing

I re-ran the configured affected selection after the fix round. The Java, Python, C#, TypeScript and packs lanes pass; the C# DependencyCodegenTests that failed in round 1 now pass. The Rust lane failed cargo fmt --check on the new test in the fix commit. I applied rustfmt's exact diff by hand, and the full Rust lane then passed. A cargo publish dry-run error caused by a stale target/package was an environment problem; clearing it fixed it. I drove three scenarios live against disposable projects in $DEV_SCRATCH, which I then deleted. (1) TS meta gen with agentDocsFile on a dependency consumer wrote agent/schema.md. The page lists the local orders table (app::Order) and no Customer, Address or acme::common. (2) Python metaobjects gen on the same consumer wrote the model-only agent/schema.md, agent/requirements.md and requirements.toon, with no imported node and no retired requirements.md. (3) TS and Python agent-docs insert the "Pages generated for this project" pointer above "## Rules", listing exactly the wired pages from .hashes. Without hashes, no section appears, and the file is byte-identical to the wired file minus that section. No UI surface: the evidence is generated Markdown and AGENTS.md files.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
TS: meta gen with agentDocsFile on a disposable project that imports the acme-common dependency writes agent/schema.md listing only the local app::Order table, never Customer/Address ✅ pass live s1-ts-dependency-schema.md; grep for Customer|customers|Address|acme returned nothing; gen exit 0
Python: metaobjects gen [agent-docs, requirements] on the same dependency consumer writes the model-only agent/schema.md, agent/requirements.md and requirements.toon, with no imported node and no re… ✅ pass live s2-python/ (3 files); grep found no imported name; requirements.md absent; gen exit 0
Always-on pointer: meta agent-docs / metaobjects agent-docs add the pages section only for pages recorded in .gen-state/.hashes; with no hashes AGENTS.md has no section and is otherwise identical ✅ pass live s3-ts-wired-AGENTS.md, s3-ts-nohashes-AGENTS.md, s3-python-wired-AGENTS.md; diff of the wired file minus its section against the no-hashes file was empty
Evidence: TS agent/schema.md for a dependency consumer (no imported node)
<!-- @generated by @metaobjectsdev/codegen-ts — DO NOT EDIT. -->

# Schema

The physical shape of the `sqlite` database this model generates. Read it before writing a query, a migration, or anything that names a table or a column.

- The **DDL is not repeated here.** The migration files are the DDL, they are generated, and they are what runs — this page describes the schema they produce.
- Change the schema by changing the **metadata** and writing the migration with the project's migration tool, from the schema `meta schema` prints. Never hand-apply SQL to a live database: it drifts from the migration history and collides at the next migration.
- `Field` and `Declared` are the METADATA names. Edit those; the column name follows.

> **Nothing in this model declares a `description`.** The tables and columns below are named but not explained. Adding `description` to an entity or a field is the single highest-value change to this page: it is what tells a reader *which* of two plausible columns to use, and it is the same text `meta schema` emits as a `COMMENT ON`, so it lands in the database too.

## Tables

\### `orders`

Declared by `app::Order`.

| Column | Field | Declared | SQL type | Null | Default | Key |
|---|---|---|---|---|---|---|
| `id` | `id` | `field.long` | `INTEGER` | no |  | PK |
| `ship_to` | `shipTo` | `field.object` | `TEXT` | yes |  |  |
Evidence: TS AGENTS.md with pointer (wired)
# Working with MetaObjects in this project

> Stack: typescript server, no client.
>
> Generated by MetaObjects (refresh: `meta init --refresh-docs`). Put project notes in your
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

\### TypeScript: generate with `npx meta gen`

1. **Config.** In `metaobjects.config.ts` set `dialect` (`"postgres" | "sqlite" | "mysql"`; D1 is
   `"sqlite"`) and list the generators. Nothing is generated until it is listed. The usual data
   layer:

   `` `ts
   import { entityFile, namesFile, barrel } from "@metaobjectsdev/codegen-ts/generators";
   // generators: [entityFile(), namesFile(), barrel()]
   `` `

   Per entity: `<Entity>.ts` (Drizzle table, row types, Zod schemas, enum types) and
   `<Entity>.names.ts` (physical names), plus an `index.ts` barrel. Install what they import:
   `npm i drizzle-orm zod` and your database driver. Every other generator (CRUD `queriesFile()`
   / `routesFile()`, docs, `requirementTests()`) is one line too; `npx meta gen --list` is the
   catalog. `npx meta eject <name>` copies one into `codegen/generators/` to change it;
   `npx meta generator new <name>` writes a new one.
2. **Generate.** `npx meta gen`. See a file's exports with `grep -n "^export" <file>`. When
   `agentDocsFile()` / `apiDocsFile()` are wired, read the `agent/*.md` or `api/AGENT-API.md`
   page for the tier you touch.

\### Requirements, when the metadata declares `requirement.*` nodes

A commit that changes behaviour updates them in the same commit: `@status: live` once a claim
is built (never before), a new node for new behaviour.

\### Before you call it done

- `npx meta verify --codegen` (the generated code and docs pages; the requirement gate runs on every `meta verify`).

Commit the metadata, the generated code and `.metaobjects/.gen-state/.hashes/`.

## Calling the generated REST API

When the project serves the generated routes (any port):

- Filter as `?filter[<field>][<op>]=<value>`: `?filter[status][eq]=active`, never
  `?status=active` (TypeScript refuses that with 400; the other ports ignore it). Operators: `eq`, `ne`, `isNull` (`true`/`false`), `in` (comma list, at most 100), `like`
  (case-sensitive, `%` and `_`), `gt`, `gte`, `lt`, `lte`. Filters AND; only `@filterable`
  fields filter.
- `?sort=<field>:asc|desc`, `?limit=N&offset=N`; `withCount=1` returns `{"rows", "total"}`.
  Always send `limit`: without it the project's `api.pagination.defaultLimit` applies, or with
  none set C# returns every row, the other ports 50; above `maxLimit` is 400.
- `PUT` is the same partial update as `PATCH`. Send only declared fields: an undeclared key is
  400 `unknown_fields` (unless `api.unknownFields` is `drop`).
- Errors are `{"error": "<code>"}`: 400 for validation (`issues` lists each problem) and for
  a bad filter or sort (`invalid_filter_field`, `_op`, `_value`, `invalid_sort`, each naming
  `field`), 404 `not_found`, 409 for a unique or foreign-key conflict.

## Pages generated for this project

The project's `gen` command writes these from the metadata (they are regenerated output, like the
code). Read the one for a tier before you change that tier:

- `docs/agent/schema.md`: before you touch persistence: tables, columns, keys and views.

## Rules

- What the metadata describes is generated, never hand-written (tables, types, validators,
  foreign keys, schema, migrations). Hand-write only what it cannot describe, on top.
- Never hand-edit generated output: change the metadata and regenerate. Output wrong for you, or
  broken? Fix the generator: eject it and it is yours, no permission needed, nothing to wait on.
- Never spell a table or column name as a string; use the generated table or names constants.
- Wire a generator only for output you will import.
- An LLM prompt in a project that declares `template.prompt` is a declared template
  (`metaobjects-prompts`); a grouped total or report view is an `object.report`
  (`metaobjects-authoring`). Open the skill before writing either by hand.
- Never invent metadata vocabulary. Search it: `npx meta types <term>`, and
  `npx meta types <type>.<subType> --detail` for one construct's valid attributes. Vocabulary of
  your own says what a thing is and relates to, never a product, a version or a step.
- Metadata nodes are fused-key maps, `{"field.string": {"name": "email"}}`. Attribute names are
  unique within a node, and package paths use `::`.

## Going deeper

The loop above needs no skill. For less common work load a `metaobjects-*` skill by name, or open
`.claude/skills/<skill>/SKILL.md` if your assistant does not load skills: `metaobjects-authoring`
(unusual shapes, your own vocabulary, reports, adopting existing code), `metaobjects-codegen`
(owning or writing a generator), `metaobjects-runtime-ui` (REST routes, the web client), `metaobjects-prompts` (LLM
prompts), `metaobjects-verify` (migration edge cases, drift, upgrades), `metaobjects-audit` (an
adoption review). Each names the one reference page to open.

`meta init --refresh-docs` regenerates this file and the skills, so keep project guidance in
the root `AGENTS.md` or `CLAUDE.md` (or copy a skill to a new name). A refresh never overwrites a
file you edited; it writes `<path>.new` beside it, which you merge into `<path>` and delete.
Never `--force` a refresh over local edits.
Evidence: TS AGENTS.md without pointer (no hashes)
# Working with MetaObjects in this project

> Stack: typescript server, no client.
>
> Generated by MetaObjects (refresh: `meta init --refresh-docs`). Put project notes in your
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

\### TypeScript: generate with `npx meta gen`

1. **Config.** In `metaobjects.config.ts` set `dialect` (`"postgres" | "sqlite" | "mysql"`; D1 is
   `"sqlite"`) and list the generators. Nothing is generated until it is listed. The usual data
   layer:

   `` `ts
   import { entityFile, namesFile, barrel } from "@metaobjectsdev/codegen-ts/generators";
   // generators: [entityFile(), namesFile(), barrel()]
   `` `

   Per entity: `<Entity>.ts` (Drizzle table, row types, Zod schemas, enum types) and
   `<Entity>.names.ts` (physical names), plus an `index.ts` barrel. Install what they import:
   `npm i drizzle-orm zod` and your database driver. Every other generator (CRUD `queriesFile()`
   / `routesFile()`, docs, `requirementTests()`) is one line too; `npx meta gen --list` is the
   catalog. `npx meta eject <name>` copies one into `codegen/generators/` to change it;
   `npx meta generator new <name>` writes a new one.
2. **Generate.** `npx meta gen`. See a file's exports with `grep -n "^export" <file>`. When
   `agentDocsFile()` / `apiDocsFile()` are wired, read the `agent/*.md` or `api/AGENT-API.md`
   page for the tier you touch.

\### Requirements, when the metadata declares `requirement.*` nodes

A commit that changes behaviour updates them in the same commit: `@status: live` once a claim
is built (never before), a new node for new behaviour.

\### Before you call it done

- `npx meta verify --codegen` (the generated code and docs pages; the requirement gate runs on every `meta verify`).

Commit the metadata, the generated code and `.metaobjects/.gen-state/.hashes/`.

## Calling the generated REST API

When the project serves the generated routes (any port):

- Filter as `?filter[<field>][<op>]=<value>`: `?filter[status][eq]=active`, never
  `?status=active` (TypeScript refuses that with 400; the other ports ignore it). Operators: `eq`, `ne`, `isNull` (`true`/`false`), `in` (comma list, at most 100), `like`
  (case-sensitive, `%` and `_`), `gt`, `gte`, `lt`, `lte`. Filters AND; only `@filterable`
  fields filter.
- `?sort=<field>:asc|desc`, `?limit=N&offset=N`; `withCount=1` returns `{"rows", "total"}`.
  Always send `limit`: without it the project's `api.pagination.defaultLimit` applies, or with
  none set C# returns every row, the other ports 50; above `maxLimit` is 400.
- `PUT` is the same partial update as `PATCH`. Send only declared fields: an undeclared key is
  400 `unknown_fields` (unless `api.unknownFields` is `drop`).
- Errors are `{"error": "<code>"}`: 400 for validation (`issues` lists each problem) and for
  a bad filter or sort (`invalid_filter_field`, `_op`, `_value`, `invalid_sort`, each naming
  `field`), 404 `not_found`, 409 for a unique or foreign-key conflict.

## Rules

- What the metadata describes is generated, never hand-written (tables, types, validators,
  foreign keys, schema, migrations). Hand-write only what it cannot describe, on top.
- Never hand-edit generated output: change the metadata and regenerate. Output wrong for you, or
  broken? Fix the generator: eject it and it is yours, no permission needed, nothing to wait on.
- Never spell a table or column name as a string; use the generated table or names constants.
- Wire a generator only for output you will import.
- An LLM prompt in a project that declares `template.prompt` is a declared template
  (`metaobjects-prompts`); a grouped total or report view is an `object.report`
  (`metaobjects-authoring`). Open the skill before writing either by hand.
- Never invent metadata vocabulary. Search it: `npx meta types <term>`, and
  `npx meta types <type>.<subType> --detail` for one construct's valid attributes. Vocabulary of
  your own says what a thing is and relates to, never a product, a version or a step.
- Metadata nodes are fused-key maps, `{"field.string": {"name": "email"}}`. Attribute names are
  unique within a node, and package paths use `::`.

## Going deeper

The loop above needs no skill. For less common work load a `metaobjects-*` skill by name, or open
`.claude/skills/<skill>/SKILL.md` if your assistant does not load skills: `metaobjects-authoring`
(unusual shapes, your own vocabulary, reports, adopting existing code), `metaobjects-codegen`
(owning or writing a generator), `metaobjects-runtime-ui` (REST routes, the web client), `metaobjects-prompts` (LLM
prompts), `metaobjects-verify` (migration edge cases, drift, upgrades), `metaobjects-audit` (an
adoption review). Each names the one reference page to open.

`meta init --refresh-docs` regenerates this file and the skills, so keep project guidance in
the root `AGENTS.md` or `CLAUDE.md` (or copy a skill to a new name). A refresh never overwrites a
file you edited; it writes `<path>.new` beside it, which you merge into `<path>` and delete.
Never `--force` a refresh over local edits.
Evidence: Python AGENTS.md with pointer (wired)
# Working with MetaObjects in this project

> Stack: python server, no client.
>
> Generated by MetaObjects (refresh: `meta init --refresh-docs`). Put project notes in your
> root `AGENTS.md` or `CLAUDE.md`, not here: this file is regenerated.

The metadata (`metaobjects/` unless `.metaobjects/config.json` says otherwise) is the source of
truth. Code, schema and migrations are generated from it and are regenerated output.

## Start here: the whole loop, in order

\### Python: generate with `metaobjects gen`

1. **Config.** `metaobjects.config.yaml` names each target's `outDir` and its generators. Nothing
   is generated until it is listed:

   `` `yaml
   targets:
     app:
       outDir: generated
       generators: [entity, names]     # Pydantic models + physical-name constants
   `` `

   `routes` and `filter-allowlist` add FastAPI routers over a repository `Protocol` you
   implement; `requirement-tests` writes one pytest file per package of requirements;
   `api-docs` writes `api/python/AGENT-API.md`. `metaobjects gen --list` is the catalog.
   Install what the output imports: `pip install "pydantic[email]>=2" fastapi`.
2. **Generate.** `metaobjects gen`. `metaobjects eject <name>` copies a generator into the repo
   to change what it emits.

\### Requirements, when the metadata declares `requirement.*` nodes

A commit that changes behaviour updates them in the same commit: `@status: live` once a claim
is built (never before), a new node for new behaviour.

\### Before you call it done

- `metaobjects verify` (the generated code and the requirements; `--codegen` is its default).

Commit the metadata, the generated code and `.metaobjects/.gen-state/.hashes/`.

## Calling the generated REST API

When the project serves the generated routes (any port):

- Filter as `?filter[<field>][<op>]=<value>`: `?filter[status][eq]=active`, never
  `?status=active` (TypeScript refuses that with 400; the other ports ignore it). Operators: `eq`, `ne`, `isNull` (`true`/`false`), `in` (comma list, at most 100), `like`
  (case-sensitive, `%` and `_`), `gt`, `gte`, `lt`, `lte`. Filters AND; only `@filterable`
  fields filter.
- `?sort=<field>:asc|desc`, `?limit=N&offset=N`; `withCount=1` returns `{"rows", "total"}`.
  Always send `limit`: without it the project's `api.pagination.defaultLimit` applies, or with
  none set C# returns every row, the other ports 50; above `maxLimit` is 400.
- `PUT` is the same partial update as `PATCH`. Send only declared fields: an undeclared key is
  400 `unknown_fields` (unless `api.unknownFields` is `drop`).
- Errors are `{"error": "<code>"}`: 400 for validation (`issues` lists each problem) and for
  a bad filter or sort (`invalid_filter_field`, `_op`, `_value`, `invalid_sort`, each naming
  `field`), 404 `not_found`, 409 for a unique or foreign-key conflict.

## Pages generated for this project

The project's `gen` command writes these from the metadata (they are regenerated output, like the
code). Read the one for a tier before you change that tier:

- `gen/agent/schema.md`: before you touch persistence: tables, columns, keys and views.
- `gen/agent/requirements.md`: before you add or change a capability.
- `gen/requirements.toon`: the requirement ledger, in the form a tool reads.

## Rules

- What the metadata describes is generated, never hand-written (tables, types, validators,
  foreign keys, schema, migrations). Hand-write only what it cannot describe, on top.
- Never hand-edit generated output: change the metadata and regenerate. Output wrong for you, or
  broken? Fix the generator: eject it and it is yours, no permission needed, nothing to wait on.
- Never spell a table or column name as a string; use the generated table or names constants.
- Wire a generator only for output you will import.
- An LLM prompt in a project that declares `template.prompt` is a declared template
  (`metaobjects-prompts`); a grouped total or report view is an `object.report`
  (`metaobjects-authoring`). Open the skill before writing either by hand.
- Never invent metadata vocabulary. Search it: `npx meta types <term>`, and
  `npx meta types <type>.<subType> --detail` for one construct's valid attributes. Vocabulary of
  your own says what a thing is and relates to, never a product, a version or a step.
- Metadata nodes are fused-key maps, `{"field.string": {"name": "email"}}`. Attribute names are
  unique within a node, and package paths use `::`.

## Going deeper

The loop above needs no skill. For less common work load a `metaobjects-*` skill by name, or open
`.claude/skills/<skill>/SKILL.md` if your assistant does not load skills: `metaobjects-authoring`
(unusual shapes, your own vocabulary, reports, adopting existing code), `metaobjects-codegen`
(owning or writing a generator), `metaobjects-runtime-ui` (REST routes, the web client), `metaobjects-prompts` (LLM
prompts), `metaobjects-verify` (migration edge cases, drift, upgrades), `metaobjects-audit` (an
adoption review). Each names the one reference page to open.

`meta init --refresh-docs` regenerates this file and the skills, so keep project guidance in
the root `AGENTS.md` or `CLAUDE.md` (or copy a skill to a new name). A refresh never overwrites a
file you edited; it writes `<path>.new` beside it, which you merge into `<path>` and delete.
Never `--force` a refresh over local edits.
Evidence: Python pointer section
## Pages generated for this project

The project's `gen` command writes these from the metadata (they are regenerated output, like the
code). Read the one for a tier before you change that tier:

- `gen/agent/schema.md`: before you touch persistence: tables, columns, keys and views.
- `gen/agent/requirements.md`: before you add or change a capability.
- `gen/requirements.toon`: the requirement ledger, in the form a tool reads.

## Rules
  • Outcome: ⚠️ 2 errors across 2 runs (1h11m13s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 4 infos
  • 🚨 server/java/codegen-base/src/main/java/com/metaobjects/generator/AgentDocsGenerator.java:49 - The ejected agent-docs copy does not compile. AgentDocsGenerator.generate calls RequirementsGenerator.inLedger(loader), which is a package-private static method on another class, with no import. It is registered with no ejectWith (codegen-spring GeneratorRegistry.java:506), so mvn metaobjects:eject -Dnames=agent-docs copies only AgentDocsGenerator.java and renames its package (EjectSupport.ownedSource). In the owned package RequirementsGenerator does not exist, and javac fails with "cannot find symbol". The file's own header advertises that eject command. No test catches this: EjectedGeneratorsCompileTest compiles only the classes in com.metaobjects.generator.spring, not codegen-base's com.metaobjects.generator. Fix: move the predicate into the packaged engine as a public helper (for example DocsPagesEmitter.inLedger(MetaDataLoader) in com.metaobjects.docs.pages, which an owned copy imports), or inline the two lines in each generator. Call that helper from both RequirementsGenerator.java:42 and AgentDocsGenerator.java:49.
  • ⚠️ server/java/codegen-kotlin/src/main/kotlin/com/metaobjects/generator/kotlin/KotlinAgentDocsGenerator.kt:33 - The intent says: "Rust has no requirement ledger of its own ... The other ports filter rows by the import ledger (requirements.inherit); Java was fixed to do so too." The Kotlin generators do not filter. DocsPagesEmitter.agentPages(view, choseMigrateDialect(loader), subDir, templateDir, null) passes null for the ledger predicate, and so does KotlinRequirementsGenerator.kt:30 (DocsPagesEmitter.requirementsPages(view, subDir, templateDir, null)). In a Kotlin project that imports a dependency published with requirements but not named in requirements.inherit, requirements.toon and agent/requirements.md therefore list the dependency's requirements. Java's generators drop them for the same model. Nothing tests this: no Kotlin test runs these two generators against the corpus or against a dependency. The likely fix is to pass the same predicate Java builds (loader.root.dependencySet.takeIf { !it.isEmpty }?.let { it::inLedger }). Confirm that Kotlin is meant to filter as the intent states.
  • ℹ️ server/typescript/packages/codegen-ts/src/docs-view-run.ts:62 - runDocsView now calls ctx.docs?.agentSchema?.() for every docs-view consumer: docsSiteFile() and the view-scoped template generator. That breaks two documented contracts. onceAgentSchema (docs-run.ts) says "a run that lists no agentDocsFile() never builds a schema, and never prints the reasons one could not be built". RunGenOpts.agentSchema (runner.ts:165) says "Absent: agentDocsFile() writes no schema page". A docs-site-only project with a dialect now builds the expected schema and can print its refusal reasons, and agentDocsFile now writes the model-only page when the schema is absent. Update both comments. They are outside the changed-file list, so this pass did not edit them.
  • ℹ️ docs/ports/kotlin.md:167 - Changed "The 20 generators registered in codegen-kotlin" to 22, and "The 20 generators above" (line 324) to 22. The table and GeneratorRegistry.kt now hold 22 entries after adding requirements and agent-docs.
  • ℹ️ docs/ports/rust.md:85 - The doc said requirements takes subDir. The Rust RequirementsGenerator has no configure override, so the default configure refuses any option with ERR_UNKNOWN_GENERATOR_OPTION. Reworded to "metamodel-docs and agent-docs take subDir".
  • ℹ️ server/typescript/packages/sdk/src/agent-context/assemble.ts:131 - The new ALWAYS_ON_PATH constant had been inserted between assemble()'s JSDoc block and the function, so that doc attached to the constant. Moved the constant above the JSDoc. No behavior change.

🔧 Fix applied.
4 infos still open:

  • ℹ️ server/typescript/packages/codegen-ts/src/docs-view-run.ts:62 - runDocsView now calls ctx.docs?.agentSchema?.() for every docs-view consumer: docsSiteFile() and the view-scoped template generator. That breaks two documented contracts. onceAgentSchema (docs-run.ts) says "a run that lists no agentDocsFile() never builds a schema, and never prints the reasons one could not be built". RunGenOpts.agentSchema (runner.ts:165) says "Absent: agentDocsFile() writes no schema page". A docs-site-only project with a dialect now builds the expected schema and can print its refusal reasons, and agentDocsFile now writes the model-only page when the schema is absent. Update both comments. They are outside the changed-file list, so this pass did not edit them.
  • ℹ️ docs/ports/kotlin.md:167 - Changed "The 20 generators registered in codegen-kotlin" to 22, and "The 20 generators above" (line 324) to 22. The table and GeneratorRegistry.kt now hold 22 entries after adding requirements and agent-docs.
  • ℹ️ docs/ports/rust.md:85 - The doc said requirements takes subDir. The Rust RequirementsGenerator has no configure override, so the default configure refuses any option with ERR_UNKNOWN_GENERATOR_OPTION. Reworded to "metamodel-docs and agent-docs take subDir".
  • ℹ️ server/typescript/packages/sdk/src/agent-context/assemble.ts:131 - The new ALWAYS_ON_PATH constant had been inserted between assemble()'s JSDoc block and the function, so that doc attached to the constant. Moved the constant above the JSDoc. No behavior change.

🔧 Fix applied.
7 infos still open:

  • ℹ️ docs/ports/kotlin.md:167 - Changed "The 20 generators registered in codegen-kotlin" to 22, and "The 20 generators above" (line 324) to 22. The table and GeneratorRegistry.kt now hold 22 entries after adding requirements and agent-docs.
  • ℹ️ docs/ports/rust.md:85 - The doc said requirements takes subDir. The Rust RequirementsGenerator has no configure override, so the default configure refuses any option with ERR_UNKNOWN_GENERATOR_OPTION. Reworded to "metamodel-docs and agent-docs take subDir".
  • ℹ️ server/typescript/packages/sdk/src/agent-context/assemble.ts:131 - The new ALWAYS_ON_PATH constant had been inserted between assemble()'s JSDoc block and the function, so that doc attached to the constant. Moved the constant above the JSDoc. No behavior change.
  • ℹ️ server/typescript/packages/codegen-ts/src/generators/agent-docs-file.ts:17 - The header comment was stale after this change. It said the requirements page comes from walkRequirements + requirementRows; the page is now built from the docs view (requirementRowsFromView/nodeIndexFromView). It also said a project with no physical schema gets no schema page; that project now gets the model-only page. Updated the derivation list and the 'AN EMPTY PAGE IS NO FILE' line. Comment-only, no behavior change.
  • ℹ️ server/typescript/packages/sdk/src/agent-context/agent-pages.ts:30 - wiredAgentPages finds the agent pages only by path suffix (agent/schema.md, agent/requirements.md). In TypeScript (agentDocsFile({subDir})), Python (AgentDocsGenerator(sub_dir=...)) and Rust ({&#34;subDir&#34;: ...}), subDir REPLACES the agent directory. Example: subDir: &#34;llm&#34; writes docs/llm/schema.md and docs/llm/requirements.md. The pointer then matches neither file, and .metaobjects/AGENTS.md silently gets no section. No error occurs; the result matches the behavior before this change. Sibling: server/python/src/metaobjects/agent_context/agent_pages.py:33 (_page_index). The TypeScript .hashes/ values carry no generatedBy (plain hash strings, as in the none fixture), so a fix cannot simply key on the generator name. A decision is needed: accept the limitation and document it, or record which generator wrote each path. That remedy, not the defect, needs authorization.
  • ℹ️ agent-context/templates/agent-pages.md.mustache:3 - The section always says "meta gen writes these from the metadata". Python writes the same template from metaobjects agent-docs (agent_docs.py:133), and the C#/Java stacks reach it through the Node CLI. In those projects the pages come from metaobjects gen, dotnet meta gen or mvn metaobjects:generate, not meta gen. An agent may run the Node CLI that has no codegen for that port. The text is pinned by fixtures/agent-pages-pointer/*/expected-section.md. Options: make the wording stack-neutral (for example "gen writes these"), or render the command per stack. Changing it changes a pinned corpus, so confirm the wording.
  • ℹ️ server/java/codegen-base/src/main/java/com/metaobjects/generator/AgentDocsGenerator.java:45 - The new JVM and C# agent-docs generators treat subDir as a PREFIX above a fixed agent/ directory (default "": &lt;subDir&gt;/agent/schema.md; DocsPagesEmitter.agentPages, C# AgentDocsGenerator.cs:40). TypeScript (agent-docs-file.ts:79, default "agent"), Python (agent_docs_generator.py:46) and Rust (agent_docs.rs:63) treat it as the REPLACEMENT for agent/. A port's own metamodel-docs and docs-site also use replacement semantics. Example: subDir: &#34;docs/agent&#34; writes docs/agent/schema.md in TS/Python/Rust and docs/agent/agent/schema.md in Java/Kotlin/C#. The port docs record each meaning, so this is a documented difference, not a hidden defect. Confirm the divergence is intended. Aligning it changes the new generators' option contract (KotlinAgentDocsGenerator.kt:31, C# AgentDocsGenerator.cs:40, docs/ports/java.md:473, docs/ports/kotlin.md:191, docs/ports/csharp.md).

🔧 Fix applied.
4 infos still open:

  • ℹ️ docs/ports/kotlin.md:167 - Changed "The 20 generators registered in codegen-kotlin" to 22, and "The 20 generators above" (line 324) to 22. The table and GeneratorRegistry.kt now hold 22 entries after adding requirements and agent-docs.
  • ℹ️ docs/ports/rust.md:85 - The doc said requirements takes subDir. The Rust RequirementsGenerator has no configure override, so the default configure refuses any option with ERR_UNKNOWN_GENERATOR_OPTION. Reworded to "metamodel-docs and agent-docs take subDir".
  • ℹ️ server/typescript/packages/sdk/src/agent-context/assemble.ts:131 - The new ALWAYS_ON_PATH constant had been inserted between assemble()'s JSDoc block and the function, so that doc attached to the constant. Moved the constant above the JSDoc. No behavior change.
  • ℹ️ server/typescript/packages/codegen-ts/src/generators/agent-docs-file.ts:17 - The header comment was stale after this change. It said the requirements page comes from walkRequirements + requirementRows; the page is now built from the docs view (requirementRowsFromView/nodeIndexFromView). It also said a project with no physical schema gets no schema page; that project now gets the model-only page. Updated the derivation list and the 'AN EMPTY PAGE IS NO FILE' line. Comment-only, no behavior change.
⚠️ **Test** - 2 errors
  • 🚨 configured test command failed with exit code 1
  • 🚨 server/csharp/MetaObjects.Codegen/Generators/AgentDocsGenerator.cs:49 - C# agent-docs builds the schema page from the whole docs view and passes the import-ledger predicate only to the requirements side. Imported tables (for example Customer, Address) appear in agent/schema.md. DependencyCodegenTests fails 4 tests: An_imported_node_emits_nothing_from_any_registered_generator ('agent/schema.md mentions an imported node'), plus An_imported_value_object_a_local_prompt_names_is_still_emitted, An_imported_value_object_a_local_entity_holds_is_still_emitted and An_imported_value_object_a_local_value_object_holds_is_still_emitted. Intended contract: an imported node emits nothing from any generator. Fix options: apply the ledger predicate to schema rows too (in DocsViewPages.Render, for every port), which changes the intended parity design and needs a human decision.
  • ⚠️ live validation verdict: inconclusive (0 of 3 scenarios were driven live against the product); untested: Affected CI selection runs the C# port conformance and codegen suites (ci-local --affected --strict-toolchains, csharp lane), Dependency import contract: a project importing a dependency emits no imported node from any generator, including agent-docs, Java, Python, Rust and TypeScript lanes of the affected selection complete green
  • Live validation: ⚠️ inconclusive - 0 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Affected CI selection runs the C# port conformance and codegen suites (ci-local --affected --strict-toolchains, csharp lane) ⏸️ untested no Prior payload recorded only the in-process xUnit suite run, not a live product drive. Conformance (2945) and Render (372) passed in-process; MetaObjects.Codegen.Tests had 4 DependencyCodegenTests fail…
Dependency import contract: a project importing a dependency emits no imported node from any generator, including agent-docs ⏸️ untested no Only drive was the C# xUnit test, which is not live. A live drive (dotnet meta gen on fixtures/dependency-conformance with the agent-docs generator) was not run within budget.
Java, Python, Rust and TypeScript lanes of the affected selection complete green ⏸️ untested no Run stopped before these lanes finished. Partial output showed no failures, but completion is not established.
  • scripts/ci-local.sh --affected --strict-toolchains
  • MO_CI_LIST_ONLY=1 scripts/ci-local.sh --affected --strict-toolchains (lane selection listed: ts-fast ts-unit java-slow python csharp rust packs)
  • scripts/ci-local.sh --affected --strict-toolchains, run in background. Stopped by process group after the C# failure was confirmed; the run did not finish.
  • C# conformance lane (in-process xUnit, not live): MetaObjects.Conformance.Tests passed 2945/2945; MetaObjects.Render.Tests passed 372/372; MetaObjects.Codegen.Tests: 4 DependencyCodegenTests failed.
  • Not run: full regression suite (the run did not finish, so the full bun test, Java reactor, and full Python run are unknown).

🔧 Fix applied.
2 errors still open:

  • 🚨 configured test command failed with exit code 1
  • 🚨 server/rust/metaobjects-codegen/tests/reference_nodes.rs:106 - The fix commit's new assert in reference_nodes.rs failed cargo fmt --all --check, so the Rust lane of the configured test command was red. I applied rustfmt's exact 4-line wrapping diff by hand (left in the worktree, not committed). With it, scripts/ci-local.sh --only rust --strict-toolchains passes.
  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
TS: meta gen with agentDocsFile on a disposable project that imports the acme-common dependency writes agent/schema.md listing only the local app::Order table, never Customer/Address ✅ pass live s1-ts-dependency-schema.md; grep for Customer|customers|Address|acme returned nothing; gen exit 0
Python: metaobjects gen [agent-docs, requirements] on the same dependency consumer writes the model-only agent/schema.md, agent/requirements.md and requirements.toon, with no imported node and no re… ✅ pass live s2-python/ (3 files); grep found no imported name; requirements.md absent; gen exit 0
Always-on pointer: meta agent-docs / metaobjects agent-docs add the pages section only for pages recorded in .gen-state/.hashes; with no hashes AGENTS.md has no section and is otherwise identical ✅ pass live s3-ts-wired-AGENTS.md, s3-ts-nohashes-AGENTS.md, s3-python-wired-AGENTS.md; diff of the wired file minus its section against the no-hashes file was empty
  • scripts/ci-local.sh --affected --strict-toolchains
  • scripts/ci-local.sh --affected --strict-toolchains: java-reactor, python, csharp, typescript conformance, ts build+typecheck, ts unit, completeness-gate and packs green; rust red on cargo fmt
  • Fixed the rustfmt diff in server/rust/metaobjects-codegen/tests/reference_nodes.rs; cargo fmt --all --check passes
  • scripts/ci-local.sh --only rust --strict-toolchains: tests pass; the publish dry-run hits a cargo internal error from a stale target/package; after rm -rf server/rust/target/package the re-run passes (LOCAL CI PASSED)
  • Live: node server/typescript/packages/cli/dist/bin/meta.js gen with agentDocsFile on a disposable consumer of the acme-common dependency, sqlite dialect
  • Live: server/python/.venv/bin/metaobjects gen with [agent-docs, requirements] on the same consumer plus a local requirement.functional
  • Live: meta agent-docs --server typescript on a wired project and on a project with no hashes; metaobjects agent-docs --server python on a wired project
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Pipeline run and notes

  • no-mistakes runs: 1. In that run: three review rounds, then one fix round at Test. Test was approved by the operator as an exception: the first affected-CI run was red, and after the fix every lane passed (java-reactor, Python, C#, Rust and TypeScript conformance, TS build and typecheck, TS unit, completeness gate, packs).
  • Known limit, documented, not fixed here: the .metaobjects/AGENTS.md pointer recognises only the default agent/ page paths. With a custom subDir, no section is written; that is the behaviour from before this PR, and it never writes a wrong pointer. Recording which generator wrote each path would change the committed .hashes/ format.
  • Decisions made during the run:
    • agent/schema.md leaves imported (dependency) nodes out in every port; docs-site stays the one whole-model exception.
    • subDir on agent-docs replaces agent/ in every port.
    • Kotlin filters requirement rows by the import ledger, as Java does.

…Node

The Rust port builds the port-neutral docs view from its loaded model
(metaobjects::docs_view), byte-identical to TypeScript on every
fixtures/explorer-conformance case, and a new opt-in docs-site generator
writes explorer.json, the explorer app, explorer-model.js and
explorer-stamp.js. The app is a canonical copy in metaobjects-codegen
(synced by scripts/sync-explorer-app.sh, held by the explorer app copies
gate) and ships in the published crate.

Rust codegen now records generatedBy/sourceNode provenance in the hash
manifest per the shared provenance vector, and the engine runs a
run-output reader (docs-site) after every other generator, so gen and
verify list the same files.

The docs-site builder is engine, as the shared registry rules: eject
refuses it and gen --list marks it [package-only]; an owned theme in
codegen/docs-site/ replaces the shipped one.

metaobjects::meta_endpoint adds the framework-free /_meta and
/_meta/docs bodies (ETag and If-None-Match as TypeScript's).
# Conflicts:
#	docs/features/docs-view.md
#	docs/features/explorer-data.md
#	docs/features/explorer-site.md
#	docs/features/metadata-api.md
#	fixtures/generator-registry-conformance/registry.json
…ORMANCE explorer row and paragraph; --transport question left open
…ages honour the ledger, C# drops its scope-only filter
@dmealing
dmealing merged commit 2ca0072 into main Nov 28, 2026
11 checks passed
@dmealing
dmealing deleted the fm/mo-130-agent-pages branch November 28, 2026 14:50
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