Repository navigation
Add the data layer for a model explorer: explorer.json and its three inputs - #532
Merged
Merged
Conversation
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.
…iagnostic matching
…a-spine # Conflicts: # AGENTS.md # examples/showcase/site-payload.json # server/typescript/packages/cli/src/commands/export.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 throughextendsmaterialized onto that node.extendsis still written as the canonical name. The plain export is unchanged.meta verify --format jsonnow carries arequirementLedger: one row perrequirement.*node, in document order, with its digest, each@implementedBy/@supersededBylink and the node it resolves to (from the gate's own resolver), the findings reported against it, and a verdict. Text output is unchanged..metaobjects/.gen-state/.hashes.json: a file emitted by aperEntitygenerator (or anyEmittedFilethat setssourceNode) 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 isgeneratedBy, notgenerator, because in the JVM manifestgeneratoris an ownership claim the orphan sweep acts on.buildExplorer/serializeExplorerin@metaobjectsdev/docs-siteturn those inputs into nodes (withinheritedFrom), 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.jsonandmetamodelVersionare untouched.Fixture and docs
fixtures/explorer-conformance/shop/: a small model with inheritance, a prompt and a five-level requirement tree, plus the committedeffective.json,verify.jsonandhashes.jsoninputs and theexpected.jsonoutput, checked byte for byte. The corpus count,docs/CONFORMANCE.mdand the site payload are updated to match.docs/features/explorer-data.md, with pointers from the CLI, requirements and own-your-codegen pages.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.docs-site69 pass,codegen-ts3067 pass,cli1911 pass, no failures.scripts/site/counts.test.tspasses, 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.