Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 31 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1341,8 +1341,7 @@ four `rules.*` and `verify.lifecycle.unreachable` settings, held to `fixtures/ru
for Pagefind, work at phone width, depend on the model alone (so `meta verify --codegen` holds
them) and are link-checked. The graphs load Cytoscape.js from `assetBase`. `meta eject
docs-site` now copies the explorer's `explorer-*.mustache` templates and `explorer.css` /
`explorer.js` beside the classic theme. `buildExplorer` takes an optional `routes` input, and
nodes carry their declaration `order`. Each `requirements.rows` entry in `meta verify
`explorer.js` beside the classic theme. Each `requirements.rows` entry in `meta verify
--format json` now carries `node`: the entity's resolution key on a
`WARN_REQUIREMENT_OBJECT_UNCLAIMED` row, `""` on every other row, and each finding in a
`requirementLedger` row carries its `message`. See `docs/features/explorer-site.md`.
Expand Down Expand Up @@ -1458,13 +1457,35 @@ four `rules.*` and `verify.lifecycle.unreachable` settings, held to `fixtures/ru
`{ "hash", "generatedBy", "sourceNode" }`. `EmittedFile.sourceNode` lets an owned generator set
it, and `perEntity` sets it automatically. A file rendered from the whole model keeps the plain
hash entry. The field is not called `generator`, because on the JVM that word claims ownership.
- `@metaobjectsdev/docs-site` exports `buildExplorer` and `serializeExplorer`. Together they build a
deterministic `explorer.json` from those three inputs. The file holds nodes, typed edges, the
requirement ledger, the generated files for each node, and derived slices for each package,
requirement subtree and prompt.

Gated by the new `fixtures/explorer-conformance/` corpus. See `docs/features/explorer-data.md`.
No metamodel vocabulary changes, and `metamodelVersion` does not move.
- `@metaobjectsdev/metadata` exports `buildDocsView` and `serializeDocsView`, which build the
**docs view**: one port-neutral document of the facts every documentation page reads, built
from the model the port has already loaded, with those inputs and the routes the run mounts
as optional additions. It holds every top-level node of any type with its effective
attributes, its members grouped by type (an inherited member names the node that declares
it), the references the loader resolved and their reverse, requirement claims and generated
files; the requirements flat, with depth, status, links and the roll-up of the statuses
below; packages, counts, the gate's advisories and derived slices for each package,
requirement subtree and prompt. Facts only, no HTML, with a boolean or a count wherever a
page must choose, so a Mustache template can render it. A provider's own vocabulary gets
its members and links with no docs code: the view reads the loader's resolution, never a
list the docs code keeps, so a provider attribute links when the loader resolves it as a
reference (one of the reference attributes it knows, such as `@objectRef`). `docsSiteFile()` writes it as the site's `explorer.json`.

Gated by the new `fixtures/explorer-conformance/` corpus (`shop`, and `crm` for vocabulary a
data-driven provider registers), which every port that builds the view is held to byte for
byte. See `docs/features/docs-view.md` and `docs/features/explorer-data.md`. No metamodel
vocabulary changes, and `metamodelVersion` does not move. **If you ran 1.3.0-rc.1 or rc.2:**
those candidates exported `buildExplorer`, `serializeExplorer` and the `ExplorerJson` types
from `@metaobjectsdev/docs-site` and wrote a `metaobjects-explorer/1` file built from
`meta export --effective`; all are gone. Build the view from the loaded model
(`buildDocsView({ root, verify, manifest, routes })`), pass it to `generateExplorerSite` as
`view`, and regenerate: `explorer.json` and the explorer pages change. Map edges are labelled
with the reference attribute (`objectRef`, `payloadRef`, `responseRef`, …) and, with each
page's "Referenced by", include every reference the loader resolves (`@from`, `@of`, `@via`,
`@through`, `@spine` too). An attribute links to a node only when the loader resolved it as a
reference, never because its text matches a name, and a map-valued attribute such as
`@filter` prints its keys sorted. A theme ejected from an rc needs no change.
Generated-output change — regenerate to pick it up; three-way merge preserves hand edits.
- **`@flattenedColumnPrefix`: name a flattened value object's columns.** On a `field.object` with
`@storage: "flattened"`, it replaces the default prefix (the field's column and `_`) verbatim;
`""` keeps the members' own column names. It sits on the embedding field because one value
Expand Down Expand Up @@ -3011,7 +3032,7 @@ four `rules.*` and `verify.lifecycle.unreachable` settings, held to `fixtures/ru
(`caseRow`) that a collection-name clash already took.
- **The model explorer builds on a project with its own top-level vocabulary.** Two top-level
nodes of different types sharing a package and a name (an entity `Lead` and a page `Lead`)
made `buildExplorer` throw `two nodes share the id`. The object now keeps the plain
made the explorer throw `two nodes share the id`. The object now keeps the plain
`<package>::<name>` id and each other node adds its type, `acme::crm::Lead[page.list]`, as a
nested sibling already did; a model with no such collision gets the same ids as before. A
requirement whose id took a qualifier still takes its ledger row.
Expand Down
34 changes: 20 additions & 14 deletions 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 `explorer.json` data spine: `meta export --effective` + `meta verify --format json` + the generated-file manifest in, one explorer document out) | 1 case (`shop`) | ✓ (the builder is TypeScript, and reads only port-neutral inputs) | — | — | — | — | — |
| [`fixtures/explorer-conformance/`](../fixtures/explorer-conformance/) (the docs view: a loaded project + the verify payload, manifest and routes in, one `explorer.json` out) | 2 cases (`shop`, `crm`) | ✓ | — | — | — | — | — |

**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 @@ -897,21 +897,27 @@ message. The case list, with the rule each pins, is the
(`server/typescript/packages/integration-tests/cube-live/cube-model.live.ts`) loads the same
files into a real Cube.

### `fixtures/explorer-conformance/` (1 case)

The `shop` case → [features/explorer-data.md](features/explorer-data.md). Its `project/` is a
small model with inheritance, a value object, a reference, a prompt with a payload and a reply,
and a five-level requirement tree that has a resolved member claim, a dangling planned claim and a
live requirement nothing implements. `effective.json` and `verify.json` are what
`meta export --effective` and `meta verify --format json` write for it, `hashes.json` is a
hand-written manifest with node provenance, and `expected.json` is the explorer document built
from the three, compared byte for byte.
### `fixtures/explorer-conformance/` (2 cases)

The docs view → [features/docs-view.md](features/docs-view.md). Each case is a `project/` and
its optional committed inputs (`verify.json`, what `meta verify --format json` writes for it;
`hashes.json`, a hand-written manifest with node provenance; `routes.json`), and `expected.json`
is the docs view a port builds from the LOADED project and those inputs, compared byte for byte.
`shop` is a small model with inheritance, a value object, a reference, a prompt with a payload
and a reply, and a five-level requirement tree that has a resolved member claim, a dangling
planned claim and a live requirement nothing implements. `crm` adds a `provider.json`, a
data-driven provider for vocabulary the core does not register (`page.list`, `block.table`,
`capability.module`): its members and references must appear with no docs code that names them.
It also pins three id rules: a page declared before the entity it shares a name with leaves the
entity its claims, a reference and a claim naming an inherited member land on the owner's row,
and a nameless member keeps its index in its label.

**One port runs it:** TypeScript, in
`server/typescript/packages/docs-site/test/explorer-build.test.ts` (the builder) and
`server/typescript/packages/cli/test/explorer-fixture.test.ts` (the two committed inputs are
what the CLI writes today). The builder reads no loader, so a port that writes the same effective
JSON and verify payload feeds it unchanged.
`server/typescript/packages/metadata/test/docs-view-conformance.test.ts` (the view) and
`server/typescript/packages/cli/test/explorer-fixture.test.ts` (the committed `verify.json` files
are what the gate writes today). A port loads the project with the provider applied, builds its
own view and compares; the view reads the port's own loaded model, so it is a port's step, not a
shared input.

## Orphaned fixtures (tested but not yet documented)

Expand Down
5 changes: 3 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ docs/
│ ├── business-rules.md # operations, permission names and lifecycles: vocabulary, load rules, verify checks (ADR-0066)
│ ├── contract-emitters.md # the contract-schema and openapi generators: JSON Schema and OpenAPI for the REST contract (FR-022)
│ ├── cube-export.md # the cube-model generator: reporting vocabulary as Cube data-model files (FR-044)
│ ├── explorer-data.md # explorer.json and its inputs: export --effective, the verify ledger rows, manifest provenance
│ ├── docs-view.md # the docs view (explorer.json): the port-neutral facts every docs page reads, built from the loaded model
│ ├── explorer-data.md # the docs view's inputs: the verify ledger rows, manifest provenance, routes, export --effective
│ ├── explorer-site.md # the model explorer site docsSiteFile() builds from explorer.json
│ ├── metadata-driven-runtime.md # one grid, one form and one route mount for every entity, read from the loaded metadata (TypeScript example, measured)
│ ├── own-your-codegen.md # scaffold-and-own generator ownership (ADR-0034)
Expand Down Expand Up @@ -89,7 +90,7 @@ this tree is documentation, not the source of truth.
| Keep Prisma as the ORM, with `schema.prisma` generated from the model and gated by `verify` (TypeScript) | [`recipes/prisma.md`](recipes/prisma.md) |
| Publish the API as JSON Schema or OpenAPI, and check a change against the last release | [`features/contract-emitters.md`](features/contract-emitters.md), [`recipes/check-api-against-last-release.md`](recipes/check-api-against-last-release.md) |
| Export the reporting vocabulary to Cube (`cube-model`: cubes, joins, rollups; the `cube` lane that checks it against a real Cube) | [`features/cube-export.md`](features/cube-export.md) |
| Build the data a model explorer reads (`explorer.json` from `meta export --effective`, `meta verify --format json` and the generated-file manifest) | [`features/explorer-data.md`](features/explorer-data.md) |
| Build the data a model explorer reads (the docs view, `explorer.json`, from the loaded model, `meta verify --format json`, the generated-file manifest and the routes) | [`features/docs-view.md`](features/docs-view.md), [`features/explorer-data.md`](features/explorer-data.md) |
| Build the model explorer site: what the software does, the model map, requirement pages, the matrix, trace and gaps (`docsSiteFile()`) | [`features/explorer-site.md`](features/explorer-site.md) |
| Wire prompt construction (FR-004) | [`features/templates-and-payloads.md`](features/templates-and-payloads.md) |
| Share a metadata shape across multiple instances (abstracts, `extends:`) | [`features/abstracts-and-inheritance.md`](features/abstracts-and-inheritance.md) |
Expand Down
2 changes: 1 addition & 1 deletion docs/features/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ command surface splits in two:
| **Codegen drift** (`verify --codegen`) | **Node `meta`** | `meta verify --codegen` | TS reference (ADR-0021 D2) — regen-to-temp + diff committed output |
| **Template/prompt drift** (`verify --templates`) | **Node `meta`** | `meta verify --templates` | TS reference (ADR-0021 D2) — `{{field}}`↔payload; part of the bare-`verify` default |
| **Vocabulary upgrade** (`upgrade`) | **Node `meta`** | `meta upgrade [--to <version>] [--apply]` | **any backend** — rewrites RETIRED metadata vocabulary (`@violation` → `@counterexample`, `@readOnly` → `@mutability`, dropping `@verifiedBy`) and resolves ATTRIBUTE CONTRADICTIONS (`@fields` beside `@expr` on an index key). Node-only because it edits the metadata documents themselves, which every port shares; a non-TS project runs `npx meta upgrade` against its own `metaobjects/`. **Canonical JSON and YAML alike.** Previews by default. Retirements needing a human decision are refused and the run exits non-zero, so CI cannot record a partial migration as finished |
| **Model export** (`export`) | **Node `meta`** | `meta export [--effective] [--out <file>]` | the loaded model, overlays merged, as one canonical JSON document. `--effective` also writes every inherited field, child and attribute onto the node that inherits it, which is the input the [explorer builder](explorer-data.md) reads. The output is for reading: loading an effective document back would declare each inherited member twice |
| **Model export** (`export`) | **Node `meta`** | `meta export [--effective] [--out <file>]` | the loaded model, overlays merged, as one canonical JSON document. `--effective` also writes every inherited field, child and attribute onto the node that inherits it. The docs view does not read it (see [explorer-data.md](explorer-data.md)). The output is for reading: loading an effective document back would declare each inherited member twice |
| **Vocabulary search** (`types`) | **Node `meta`** | `meta types [query]` | **any backend** — apropos/`kubectl explain` over the live metamodel registry (names + descriptions + when-to-use); the vocabulary is cross-port identical (registry-conformance) |
| **Dependency sync** (`deps`) | **Node `meta`** | `meta deps sync \| check \| list` | **any backend** — resolves a declared metadata dependency (`path`, an installed `npm` / `python` package, or a `maven` jar / `nuget` package already in the local Maven repository / NuGet cache; it never downloads) into a committed snapshot + lock (FR-023), so `sync`/`check`/`list` themselves stay Node-only regardless of your server language. TypeScript, Python and Java then LOAD that snapshot at every rung of their own source ladder (Kotlin loads through Java's loader and Maven plugin); C# loads the snapshot through `dotnet meta` (Phase 2 S6). On a project whose own metadata Node `meta` cannot read (a Maven `src/main/resources/metadata` directory, a C# metadata directory, or another port's vocabulary), `sync` and `check` prove the locked dependencies load together and say that the port's own `verify` is the full check. See [`metadata-dependencies.md`](metadata-dependencies.md) |
| **Canonical format** (`fmt`) | every port | `meta fmt` / `dotnet meta fmt` / `mvn metaobjects:fmt` / `metaobjects fmt` | (#304) ships in **every** port — the canonical serializer already exists in all five, so formatting is local, not Node-only. `--check` lists non-canonical files and exits non-zero without changing anything. Formats each file STANDALONE — own-mode, declared-here layer only (ADR-0039); an `extends` onto another file's base is preserved as-is, never resolved or erred on; a file declaring `overlay: true` anywhere — whether or not a same-file base exists — is reported as skipped rather than merged (merging would drop the overlay marker, a structural change fmt never makes). A YAML file is always skipped — no canonical YAML emitter exists (ADR-0006). Before writing, every port reloads the whole project with the candidate swapped in and refuses the write unless the reloaded model's canonical form is byte-identical to the untouched baseline — fmt never changes meaning. See [Fixture corpus](#meta-fmt--canonical-formatting-304) below and `fixtures/fmt-conformance/README.md` |
Expand Down
6 changes: 3 additions & 3 deletions docs/features/codegen-data-shapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ the expected schema writes) leaves out.

The corpus also pins the rows those builders start from (`expected/rows/`): `RequirementRow[]`
(`requirementRows`) for both requirements pages, and `SchemaRows` (`schemaRows`, a subset of the
`meta schema --as json` shape) for the model-only schema page. These are the rows the docs site
reads too: the requirement rows are what the explorer graph holds, and the schema rows are part
of the storage lens's input. One shape serves the pages and the site, so it is not pinned twice.
`meta schema --as json` shape) for the model-only schema page. These are the rows the pages
read: the requirement rows feed the requirements pages, and the schema rows are part
of the agent schema page's input. The docs site does not read these rows: its explorer builds requirements from the verify payload's `requirementLedger` and the loaded model ([docs-view.md](docs-view.md), pinned by `fixtures/explorer-conformance/`).

### Neutral structural shapes → `EntityTemplateData` / `PackageTemplateData` / `ModelTemplateData`

Expand Down
Loading
Loading