Skip to content

Add the data layer for a model explorer: explorer.json and its three inputs - #532

Merged
dmealing merged 7 commits into
mainfrom
fm/mo-explorer-p0-data-spine
Nov 4, 2026
Merged

dmealing merged 7 commits into
mainfrom
fm/mo-explorer-p0-data-spine

Conversation

@dmealing

@dmealing dmealing commented Nov 4, 2026

Copy link
Copy Markdown
Member

What this adds

The data layer for a model explorer: one port-neutral file, explorer.json, that a future docs-site view can read to show a project's objects and how they connect, its prompts, its requirement tree with a verdict per claim, and which generated files each node produced. No screens or styling yet; this is the data only.

It is built from three inputs, so the builder never loads metadata itself:

  • meta export --effective (new flag): writes the model with every member a node inherits through extends materialized onto that node. extends is still written as the canonical name. The plain export is unchanged.
  • meta verify --format json now carries a requirementLedger: one row per requirement.* node, in document order, with its digest, each @implementedBy / @supersededBy link and the node it resolves to (from the gate's own resolver), the findings reported against it, and a verdict. Text output is unchanged.
  • Node provenance in .metaobjects/.gen-state/.hashes.json: a file emitted by a perEntity generator (or any EmittedFile that sets sourceNode) is recorded as { hash, generatedBy, sourceNode }. Files rendered from the whole model keep the plain "<path>": "<hash>" form, so a project that writes only those sees no change. The field is generatedBy, not generator, because in the JVM manifest generator is an ownership claim the orphan sweep acts on.

buildExplorer / serializeExplorer in @metaobjectsdev/docs-site turn those inputs into nodes (with inheritedFrom), typed edges (extends, references, objectRef, association, payload, reply, contains, implementedBy, supersededBy), the ledger, generated files per node, and derived slices (per package, per requirement subtree, per prompt). Output is deterministic: sorted nodes and edges, fixed two-space JSON with one trailing newline.

No new metamodel vocabulary; expected-registry.json and metamodelVersion are untouched.

Fixture and docs

  • New fixtures/explorer-conformance/shop/: a small model with inheritance, a prompt and a five-level requirement tree, plus the committed effective.json, verify.json and hashes.json inputs and the expected.json output, checked byte for byte. The corpus count, docs/CONFORMANCE.md and the site payload are updated to match.
  • New docs/features/explorer-data.md, with pointers from the CLI, requirements and own-your-codegen pages.
  • CHANGELOG entry under Unreleased. No version bump.

Tests run

On the branch head after merging current main:

  • scripts/ci-local.sh --quick: passed, including the gates lane, TypeScript build and typecheck, TypeScript conformance, the unit suites and the mutation completeness gate. The other-language lanes are skipped by --quick; this change touches TypeScript packages only.
  • Full suites: docs-site 69 pass, codegen-ts 3067 pass, cli 1911 pass, no failures.
  • scripts/site/counts.test.ts passes, and the regenerated site payload is unchanged after the merge.

This went through the no-mistakes gate earlier: review passed in two runs. The later runs were stopped by host and GitHub outages unrelated to the change, so this PR was opened directly after the local checks above.

The data a model explorer reads, built from port-neutral inputs only:

- `meta export --effective` writes the effective canonical JSON: every member and
  attribute a node inherits through `extends` is materialized on it.
- `meta verify --format json` carries `requirementLedger`, one row per requirement:
  digest, each @implementedBy link with the node the gate resolved it to, the
  findings against its path, and a clean/warn/error verdict from the gate.
- `meta gen` records the node a per-entity file was rendered from on its
  `.hashes.json` entry ({ hash, generatedBy, sourceNode }); `perEntity` stamps
  `EmittedFile.sourceNode`. Not named `generator`, which on the JVM is an
  ownership claim the orphan sweep acts on; JVM owner fields are preserved.
- `@metaobjectsdev/docs-site` exports `buildExplorer` / `serializeExplorer`:
  nodes, typed edges, ledger, generated files per node, derived slices
  (package, requirement subtree, prompt). Deterministic bytes.

Gated by the new fixtures/explorer-conformance/ corpus (expected.json checked
byte for byte; the committed inputs re-derived from the CLI). No metamodel
vocabulary change; metamodelVersion does not move.
…a-spine

# Conflicts:
#	AGENTS.md
#	examples/showcase/site-payload.json
#	server/typescript/packages/cli/src/commands/export.ts
@dmealing
dmealing merged commit d2fa0f7 into main Nov 4, 2026
9 checks passed
@dmealing
dmealing deleted the fm/mo-explorer-p0-data-spine branch November 4, 2026 15:11
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