Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2bdc228
feat(codegen): record each generated file's source node in C#, Java a…
dmealing Nov 28, 2026
189bc1e
no-mistakes(review): Stamp provenance in remaining per-object generators
dmealing Nov 28, 2026
f964f81
no-mistakes(document): Docs for C#/Java/Python provenance already upd…
dmealing Nov 28, 2026
9f3dd34
Merge remote-tracking branch 'origin/main' into fm/mo-130-docs-proven…
dmealing Nov 28, 2026
f3c6e89
no-mistakes(test): Stop identifier renaming in explorer bundle build
dmealing Nov 28, 2026
2fbd5eb
feat(java): build the docs view and write the model explorer on the J…
dmealing Nov 28, 2026
eb4c1a5
Merge remote-tracking branch 'origin/fm/mo-130-docs-provenance' into …
dmealing Nov 28, 2026
a00a3ee
fix(ci): clear stale unpacked workspace crates before the Rust publis…
dmealing Nov 28, 2026
12a4014
fix(java): keep the explorer data scripts out of codegen-base's layou…
dmealing Nov 28, 2026
6ab8364
no-mistakes(review): apply reviewer inline fixes
dmealing Nov 28, 2026
b62af34
no-mistakes(review): Build JVM docs-site file lists from the run's ou…
dmealing Nov 28, 2026
bbd9057
no-mistakes(review): apply reviewer inline fixes
dmealing Nov 28, 2026
7a75c99
no-mistakes(review): List other executions' files in the JVM docs site
dmealing Nov 28, 2026
5f3879e
no-mistakes(review): Re-run skip when manifest loses a file
dmealing Nov 28, 2026
e6977b7
no-mistakes(document): Stale docs-view claim fixed; Java/Kotlin now b…
dmealing Nov 28, 2026
550ef09
feat(docs-site): build the model explorer in C# and Python without Node
dmealing Nov 28, 2026
cc4c1f8
Merge remote-tracking branch 'origin/main' into fm/mo-130-docs-view-c…
dmealing Nov 28, 2026
b5e58f2
no-mistakes(review): Match verify docs-site render to gen; pin ETags
dmealing Nov 28, 2026
5c7b857
no-mistakes(review): Run docs-site targets last; carry plan provenance
dmealing Nov 28, 2026
d423b85
no-mistakes(review): Carry only files the orphan sweep keeps
dmealing Nov 28, 2026
0c02588
no-mistakes(review): apply reviewer inline fixes
dmealing Nov 28, 2026
9b2ca23
no-mistakes(review): Treat an empty run file list as unknown
dmealing Nov 28, 2026
631d270
no-mistakes(review): Keep empty run file lists known, as TypeScript
dmealing Nov 28, 2026
77d79b9
no-mistakes(document): Docs: C# and Python explorer now documented
dmealing Nov 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions changelog.d/explorer-csharp-python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- **C# and Python: the model explorer with no Node.** Both ports build the docs view from their
loaded model (`MetaObjects.DocsView` in C#, `metaobjects.docs_view` in Python), byte for byte
what TypeScript builds for every `fixtures/explorer-conformance/` case. A new `docs-site`
generator in each registry (`DocsSiteGenerator` in `codegen/Generators.cs`; `docs-site` in a
Python target's `generators`) writes `explorer.json`, the explorer app, `explorer-model.js`
and `explorer-stamp.js`. Each object lists the files generated for it: this run's (the runner
runs the generator after every other one) and the committed manifest's outside the directories
the run's orphan sweep clears, so `verify --codegen` renders what `gen` wrote. Options name a
`verify --format json` payload and a routes file. The running application can serve the same
view at `{apiPrefix}/_meta/docs`: `MetaEndpoint.MetaDocs(root)` (C#) and `meta_docs(root)`
(Python) build it once and carry its ETag; the host mounts it as it mounts `/_meta`.
C# and Python provenance now names a generator by its registry name (`entity`,
`filter-allowlist`, `routes`), as TypeScript and the JVM do.
4 changes: 3 additions & 1 deletion docs/CONFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ regenerate with `ls -d fixtures/<corpus>/*/ | wc -l` for directory-shaped corpor
| [`fixtures/cube-model/`](../fixtures/cube-model/) (FR-044 Plan 4 — the `cube-model` generator's golden Cube files, plus the canonical model's golden) | 46 cases (36 trees + 10 errors) + 1 canonical golden | ✓ (the exporter is TypeScript-only, spec R6; its `cube` lane also loads the files into a real Cube) | — | — | — | — | — |
| [`fixtures/writer-conformance/`](../fixtures/writer-conformance/) (ADR-0063 — the code writer generators write through) | 88 cases (31 core + 10 TypeScript + 9 Java + 12 Kotlin + 6 C# + 12 Python + 8 Rust) | ✓ (the first writer; core and TypeScript dialect) | ✓ (core and Java dialect; `JavaWriter` in `codegen-base`) | ✓ (core and Kotlin dialect; `KotlinWriter` in `codegen-kotlin`) | ✓ (core and C# dialect) | ✓ (core and Python dialect) | ✓ (core and Rust dialect) |
| [`fixtures/contract-conformance/`](../fixtures/contract-conformance/) (FR-022 — the `contract-schema` and `openapi` generators' golden trees and refusals) | 22 cases (17 trees + 5 errors) | ✓ (one neutral engine, ADR-0034 Amendment 10; the generated API lanes also hold real traffic to the documents) | — | — | — | — | — |
| [`fixtures/explorer-conformance/`](../fixtures/explorer-conformance/) (the docs view: a loaded project + the verify payload, manifest and routes in, one `explorer.json` out) | 3 cases (`shop`, `crm`, `model-alone`) | ✓ | ✓ (`DocsView`, and the `docs-site` generator end to end) | ✓ (the JVM builder, through `codegen-kotlin`'s `docs-site`) | — | — | — |
| [`fixtures/explorer-conformance/`](../fixtures/explorer-conformance/) (the docs view: a loaded project + the verify payload, manifest and routes in, one `explorer.json` out) | 3 cases (`shop`, `crm`, `model-alone`) | ✓ | ✓ (`DocsView`, and the `docs-site` generator end to end) | ✓ (the JVM builder, through `codegen-kotlin`'s `docs-site`) | ✓ (`MetaObjects.DocsView`, and the `docs-site` generator end to end) | ✓ (`metaobjects.docs_view`, and the `docs-site` generator end to end) | — |

**Rust (ADR-0065)** joined the table with its service stack. Its ledgers (the metamodel
corpus's `server/rust/metaobjects/tests/conformance-expected-failures.json`, empty; the YAML
Expand Down Expand Up @@ -915,6 +915,8 @@ its `expected.json` is the body the running application's `GET {apiPrefix}/_meta
Java (`metadata`'s `DocsViewConformanceTest`, and `codegen-base`'s `ExplorerSiteTest` through the
generator) and Kotlin (`KotlinDocsSiteConformanceTest`, through its registry's `docs-site`) build
every case byte for byte; the JVM has one builder, which Kotlin calls rather than re-implements.
C# (`MetaObjects.DocsView`, through `DocsSiteGenerator` and `MetaEndpoint.MetaDocs`) and Python
(`metaobjects.docs_view`, through `docs-site` and `meta_docs`) build every case byte for byte too.

**TypeScript runs it** in
`server/typescript/packages/metadata/test/docs-view-conformance.test.ts` (the view) and
Expand Down
11 changes: 6 additions & 5 deletions docs/features/docs-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ writes the same bytes for the same model, and the shared corpus
[`fixtures/explorer-conformance/`](../../fixtures/explorer-conformance/) holds them to that.

TypeScript builds it today, and so do Java and Kotlin (one JVM builder, `DocsView` in
`metadata`). `buildDocsView` and `serializeDocsView` are exported from `@metaobjectsdev/metadata`,
and `docsSiteFile()` writes the result as the site's `explorer.json` (see
[explorer-site.md](explorer-site.md)). C#, Python and Rust will build it as their own step of the same
plan ([explorer-data.md](explorer-data.md#not-built-yet)). The explorer pages still render their
HTML in TypeScript; the JVM copies the app and writes the same `explorer.json`.
`metadata`), C# (`MetaObjects.DocsView`) and Python (`metaobjects.docs_view`). `buildDocsView` and
`serializeDocsView` are exported from `@metaobjectsdev/metadata`, and `docsSiteFile()` writes the
result as the site's `explorer.json` (see [explorer-site.md](explorer-site.md)). Rust will build
it as its own step of the same plan ([explorer-data.md](explorer-data.md#not-built-yet)). The
explorer pages still render their HTML in TypeScript; the JVM, C# and Python copy the app and
write the same `explorer.json`.

A page of your own is a template over the view: the TypeScript `template` generator renders it
with the `perNode` and `perRequirement` scopes (and `data: "docsView"` on `perModel` and
Expand Down
7 changes: 4 additions & 3 deletions docs/features/explorer-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ A file rendered from the whole model or a whole package keeps the plain `"<path>
form, so a project that writes only such files has an unchanged manifest. Every port's
manifest reader takes `hash` from either form.

The provenance field is named `generatedBy`, not `generator`. In a Java or Kotlin module's
`generatedBy` is the generator's registry name (`entity`, `filter-allowlist`), the name
`gen --list` shows, in every port. The provenance field is named `generatedBy`, not `generator`. In a Java or Kotlin module's
manifest, `generator` means that generator owns the file (ADR-0060), and the orphan sweep acts
on that ownership, so a JVM entry carries both: `{ "hash", "generator", "outputDir",
"generatedBy", "sourceNode" }`. The four ports that write provenance write the same entry for the
Expand Down Expand Up @@ -158,8 +159,8 @@ malformed leaves its part of the view empty.
optional, and nothing builds it yet.
- **Provenance from the Kotlin and Rust generators.** Their manifest entries have no
`sourceNode` yet, so for those ports a node lists no files.
- **The docs view in C#, Python and Rust.** TypeScript, Java and Kotlin build it today; the
corpus is what the other ports will be held to.
- **The docs view in Rust.** TypeScript, Java, Kotlin, C# and Python build it today, each held
to the corpus byte for byte; Rust will be held to the same corpus.

## Verified by

Expand Down
12 changes: 6 additions & 6 deletions docs/features/explorer-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ same model and inputs: every port that builds the docs view is held to
| TypeScript | `docsSiteFile()` (`meta gen`) | `output: "app"` (default) or `"static"`; `site: "classic"` for the earlier site | The model, the requirement ledger, the files and routes this run wrote and mounts |
| Java | `com.metaobjects.generator.DocsSiteGenerator` (`mvn metaobjects:generate`), no Node | The app only | The model, the files generated per node (this execution's, and what the committed hash manifest records for the module's other executions), and a `verify --format json` payload when you name one (`verifyFile`) |
| Kotlin | the same JVM `DocsSiteGenerator`, through `codegen-kotlin`'s registry | The app only | As Java; the Kotlin generators do not record provenance in the manifest yet, so their files are not listed |
| C#, Python, Rust | not yet | | |
| C# | `docs-site` (`dotnet meta gen`, `MetaObjects.Codegen.Generators.DocsSiteGenerator`), no Node | The app only | The model, the files generated per node (this run's, and what the committed hash manifest records outside the directories the run's orphan sweep clears), and a `verify --format json` payload (`VerifyFile`) and a routes file (`RoutesFile`) when you name them |
| Python | `docs-site` (`metaobjects gen`, `metaobjects.codegen.generators.docs_site_generator`), no Node | The app only | As C# (`verify_file`, `routes_file`) |
| Rust | not yet | | |

On the JVM, wire it like any other generator, with its own output directory:

Expand Down Expand Up @@ -297,11 +299,9 @@ a dangling link. `createExplorer` (the page table both outputs draw from) and

- An LLM-written summary, a test-result overlay, zoom levels and lenses on the map, and
publishing the site.
- The docs view route in C#, Python and Rust: the contract is in
[metadata-api.md](metadata-api.md#the-docs-view-endpoint-get-_metadocs), and each port serves
it once it has its docs view builder. Java and Kotlin ship it (`MetaEndpoint.docs(root)`).
- The app in C#, Python and Rust: its files are in each port's package already (see
`explorer-app/README.md`), and each port's docs-site generator is still to write them.
- The docs view route and the app in Rust: the contract is in
[metadata-api.md](metadata-api.md#the-docs-view-endpoint-get-_metadocs). Java, Kotlin, C#
and Python ship both.
- The static export and the classic site outside TypeScript.
- "Hand-written code that imports it": the site reads no import graph, so the object pages say
it was not scanned.
Expand Down
8 changes: 6 additions & 2 deletions docs/features/metadata-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,12 @@ Kotlin calls the same symbols through `metadata-ktx`. To let the explorer read t
`file://`, add `Access-Control-Allow-Origin: null` and `Access-Control-Expose-Headers: ETag` to
that response, or use Spring's CORS configuration.

C#, Python and Rust serve the route once each has its docs view builder, with the
body that builder writes; their `/_meta` sections above show where each mounts it.
C# and Python ship the same helper beside their `/_meta` one, and like it, mount it yourself
under the same guard. C#: `MetaEndpoint.MetaDocs(root)` gives the body, `ETag` and
`Matches(ifNoneMatch)` (`MetaEndpoint.MetaDocsRoutePath`, `MetaDocsJson(root, routes)`).
Python: `meta_docs(root)` gives `body`, `etag` and `matches(if_none_match)`
(`META_DOCS_ROUTE_PATH`, `meta_docs_json(root, routes)`). Each helper's doc comment shows the
ASP.NET or FastAPI mount. Rust serves the route once it has its docs view builder.

## Browser consumption

Expand Down
2 changes: 2 additions & 0 deletions docs/ports/csharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,8 @@ generated code), and no `migrate` surface (EF Core Migrations, or the Node `meta
| Migrations | EF Core Migrations is the native path; the Node `meta migrate` is the reference helper, one option (ADR-0015 Amendments 1 and 2) — no C# migrate surface |
| Drift verify | `dotnet meta verify` (template drift, FR-004; `--codegen` regenerates the list in `codegen/Generators.cs` and diffs it) |
| API reference docs | Yes — the `ApiDocsGenerator` entry in `codegen/Generators.cs` (`OutDir`, `ApiSubDir`, `ProjectName`, `ModelBaseUrl`); `dotnet meta docs` was removed in 1.1.0 ([migration](../features/migrations/docs-are-generators.md#c)) |
| Model explorer | Yes, with no Node — a `DocsSiteGenerator` entry in `codegen/Generators.cs` (registry name `docs-site`): under `<OutDir>/<SubDir>` (default `site`) it writes the explorer app (`index.html` and `assets/`, the same bytes in every port, embedded in `MetaObjects.Codegen`), `explorer.json` (the docs view, built from the loaded model by `MetaObjects.DocsView`; byte-identical to TypeScript's for the same inputs, gated by `fixtures/explorer-conformance/`), `explorer-model.js` and `explorer-stamp.js`. Each object lists the files generated for it, recorded under each generator's registry name: this run's, laid over what the committed hash manifest records outside the directories the run's orphan sweep clears, so it never lists a file the run deletes. The runner runs it after every other entry, so `gen` and `verify --codegen` list the same files. Options: `SubDir`, `Title` (default: the project directory's name), `Stamp` (footer text), `Prompts` (a directory of prompt `.mustache` sources beside the metadata and `templates/`), `VerifyFile` (a `verify --format json` payload from the Node CLI, for the requirement verdicts), `RoutesFile` (`[{ node, method, path }]`, `node` a resolution key). An owned theme under `codegen/docs-site/` (`assets/explorer.css`, `assets/explorer.js`, `templates/explorer-*.mustache`) wins over the embedded one. Not ejectable: the builder is engine, the theme is what you own. The page-per-screen static export and the classic site stay TypeScript's |
| Docs view endpoint | `MetaEndpoint.MetaDocsRoutePath` (`/_meta/docs`), `MetaDocsJson(root, routes)` and `MetaDocs(root, routes)` (like `/_meta`, a helper you mount, not a mount): the body is the docs view of the loaded model alone, byte-identical to every other port's (`fixtures/explorer-conformance/model-alone/`); `MetaDocs` builds it once with a strong `ETag` and `Matches(ifNoneMatch)` for the `304`. Contract: [metadata-api.md](../features/metadata-api.md#the-docs-view-endpoint-get-_metadocs) |
| Requirement gate + requirement tests | Yes (`dotnet meta verify`, on every run; `requirement-tests` emits xUnit and is ejectable) |
| Business-rules gate (ADR-0066, experimental) | Yes (`dotnet meta verify`, on every run; see [business rules](../features/business-rules.md)) |
| Runtime metadata | Loader API + render engine; ObjectManager-style runtime tier on the roadmap |
Expand Down
2 changes: 2 additions & 0 deletions docs/ports/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,8 @@ definitions, and import lines are stable.
| API reference docs | Yes — `api-docs` in a target's `generators`, options in the top-level `apiDocs` block (`apiSubDir`, `projectName`, `modelBaseUrl`); `metaobjects docs` was removed in 1.1.0 ([migration](../features/migrations/docs-are-generators.md#python)) |
| Requirements and agent pages | Yes — `requirements` (`requirements.md`, `requirements.toon`) and `agent-docs` (`agent/requirements.md` and the model-only `agent/schema.md`: no SQL types, defaults, indexes or checks; `agent/ui.md` is TypeScript-only) in a target's `generators`, rendered from the shared templates bundled in the package; a same-named file under the project's templates directory overrides a page; both ejectable |
| Metamodel reference | Yes — `metamodel-docs` in a target's `generators` (`INDEX.md`, `providers.md` and `types/<family>.md` under `metamodel/`; option `subDir`), rendered from the shared templates bundled in the package over the port's own registry manifest and embedded provider definitions; reads no model objects; a same-named file under the project's templates directory overrides a page; ejectable |
| Model explorer | Yes, with no Node — `docs-site` in a target's `generators`: under `<target>/<subDir>` (default `site`) it writes the explorer app (`index.html` and `assets/`, the same bytes in every port, shipped as package data), `explorer.json` (the docs view, built from the model the run loaded by `metaobjects.docs_view.build_docs_view`; byte-identical to TypeScript's for the same inputs, gated by `fixtures/explorer-conformance/`), `explorer-model.js` and `explorer-stamp.js`. Each object lists the files generated for it (`generatedBy`, `sourceNode`): the run's own, laid over what the committed hash manifest records. The runner runs it after every other generator, so a write run and `verify --codegen` list the same files. Options: `subDir`, `title` (default: the project directory's name), `stamp` (footer text, default none), `prompts` (a directory of prompt `.mustache` sources beside the metadata and `templates/`), `verifyFile` (a `verify --format json` payload from the Node CLI, for the requirement verdicts), `routesFile` (the routes the application mounts, `[{ node, method, path }]`, `node` a resolution key). An owned theme under `codegen/docs-site/` (`assets/explorer.css`, `assets/explorer.js`, `templates/explorer-*.mustache`) wins over the packaged one. Not ejectable: the builder is engine, the theme is what you own. The page-per-screen static export and the classic site stay TypeScript's |
| Docs view endpoint | `META_DOCS_ROUTE_PATH` (`/_meta/docs`), `meta_docs_json(root, routes=None)` and `meta_docs(root, routes=None)` in `metaobjects` (like `/_meta`, a framework-free helper, not a mount): the body is the docs view of the loaded model alone, byte-identical to every other port's (`fixtures/explorer-conformance/model-alone/`); `meta_docs` builds it once with a strong `ETag` and `matches(if_none_match)` for the `304`. Contract: [metadata-api.md](../features/metadata-api.md#the-docs-view-endpoint-get-_metadocs) |
| Requirement gate + requirement tests | Yes (`metaobjects verify`, on every run; `requirement-tests` emits pytest and is ejectable) |
| Business-rules gate (ADR-0066, experimental) | Yes (`metaobjects verify`, on every run; see [business rules](../features/business-rules.md)) |
| Runtime metadata | Yes (`metaobjects.runtime.ObjectManagerDb` — DB-API 2 drivers: Postgres via pg8000/psycopg, `SqliteDriver` over the standard library's `sqlite3`, `MySqlDriver` over PyMySQL with the `mysql` extra) + loader API + render engine |
Expand Down
4 changes: 2 additions & 2 deletions fixtures/generator-registry-conformance/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,12 @@
"concept": "The browsable HTML site of the model: navigation, search, a page per package and per object, ER diagrams.",
"tier": "neutral",
"layer": "docs",
"note": "It was `meta docs --site` until 1.1.0 (ADR-0034 Amendment 9). Java and Kotlin write the model explorer app over the docs view, with no Node (both run the JVM DocsSiteGenerator); the classic site and the page-per-screen static export stay TypeScript's.",
"note": "It was `meta docs --site` until 1.1.0 (ADR-0034 Amendment 9). C#, Java, Kotlin and Python write the model explorer app over the docs view, with no Node (C# its DocsSiteGenerator, Java and Kotlin the JVM DocsSiteGenerator, Python its docs-site generator); the classic site and the page-per-screen static export stay TypeScript's.",
"eject": {
"exempt": "The site builder is engine: it assembles the page data the site's templates read, and what an adopter changes is those templates and the assets beside them, which `meta eject docs-site` copies into codegen/docs-site/ and the generator reads from there.",
"ruling": "ADR-0034 Amendment 9 (restating Amendment 8, ruling 3)"
},
"ports": ["typescript", "java", "kotlin"]
"ports": ["typescript", "csharp", "java", "kotlin", "python"]
},
"plantuml": {
"concept": "PlantUML class diagram of the object model.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void ListHeader_says_generators_are_owned_via_eject()
public void ListLines_prints_all_generators_with_stable_names_and_descriptions()
{
var lines = GenCommand.ListLines(_tmp);
Assert.Equal(19, lines.Count);
Assert.Equal(20, lines.Count);
foreach (var name in new[]
{
"entity", "db-context", "routes", "output-parser", "extractor",
Expand All @@ -66,6 +66,8 @@ public void ListLines_prints_all_generators_with_stable_names_and_descriptions()
// ADR-0025 — the api reference, an ordinary entry since ADR-0034 Amendment 9.
"api-docs",
"metamodel-docs",
// The model explorer, written with no Node.
"docs-site",
// The @expr indexes the EF model cannot carry, as SQL.
"expression-indexes",
})
Expand Down
Loading
Loading