Skip to content

feat(docs-site): build the model explorer in Java and Kotlin without Node - #671

Merged
dmealing merged 15 commits into
mainfrom
fm/mo-130-docs-view-jvm
Nov 28, 2026
Merged

dmealing merged 15 commits into
mainfrom
fm/mo-130-docs-view-jvm

Conversation

@dmealing

@dmealing dmealing commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Supersedes #669

This PR supersedes #669, which could not go green on its own while main's Rust check was red, and carries its generated-file provenance work. It also fixes that Rust check: the publish dry-run verified metaobjects-codegen against a stale unpacked metaobjects-1.3.0 that cargo reuses for an unchanged version, so the gate now clears stale unpacked copies of the workspace's own crates first (scripts/rust-clear-stale-publish-sources.sh).

#669's summary:

  • C#, Java and Python codegen write generatedBy and sourceNode into each per-object hash manifest entry, matching the TypeScript format. Files rendered from the whole model or a package keep the plain hash. The shared provenance vector in fixtures/codegen-skip-conformance/manifests.json checks all four ports against the same entries, and new per-port tests cover it.
  • The docs explorer's "generated files" panel is now filled from C#, Java and Python manifests, not only TypeScript. The next gen rewrites the committed .metaobjects/.gen-state/.hashes/ files once; generated source files do not change.
  • The explorer app bundle (explorer-app/assets/explorer-app.js) is minified without renaming identifiers, so unchanged sources build identical bytes. Every port's copy and the docs-site copy are refreshed. Also updates the explorer and own-your-codegen docs and ADR-0064 wording.

Validated in one no-mistakes run (three review fix rounds; the Test step was approved as an exception, recorded below).

What Changed

  • Java and Kotlin get a docs-site generator (DocsSiteGenerator, registered in both registries). It builds the port-neutral docs view in memory from the loaded model (DocsView, DocsViewJson, ExplorerModelScript, ExplorerSite) and writes explorer.json, the shared explorer app, explorer-model.js and explorer-stamp.js, with no Node. The output matches TypeScript byte for byte on fixtures/explorer-conformance/. The running app can also serve the view at {apiPrefix}/_meta/docs (MetaEndpoint.docs). The static export and classic site remain TypeScript-only.
  • C#, Java and Python codegen now write per-object hash-manifest entries as { "hash", "generatedBy", "sourceNode" }, matching TypeScript. A docs view built from these manifests fills the explorer's generated-files panel. Whole-model and package-level files keep the plain hash. The shared provenance vector in fixtures/codegen-skip-conformance/manifests.json holds all four ports to the same entries. Upgrade note: the first gen after this rewrites the committed .hashes/ files once. Generated source does not change.
  • The explorer app bundle is minified without renaming identifiers, so the committed bundle is byte-stable across builds. Every port's copy is refreshed. The Rust publish dry-run gets scripts/rust-clear-stale-publish-sources.sh, which removes stale unpacked copies of the workspace's own crates. This fixes the red Rust packaging check (could not find metamodel_docs).

Pipeline notes

  • Changelog fragments added under changelog.d/: explorer-jvm, generated-file-provenance-all-ports, explorer-app-stable-bundle, rust-publish-stale-sources.
  • Docs updated: docs/features/explorer-site.md, explorer-data.md, metadata-api.md, docs-view.md, own-your-codegen.md, docs/CONFORMANCE.md, docs/ports/java.md, docs/ports/kotlin.md, and ADR-0064.
Validation

Risk Assessment

✅ Low: The round-3 fix adds one key-set equality check to fingerprintMatches. The check can only turn a skip into a run, never the reverse. finishWholeRun already stores exactly the manifest's keys as outputs, so an unchanged build still skips. The new DocsSiteSkipTest covers the skip, settle and sibling-removal sequences: the removal case would have skipped before the fix and now runs. The rest of the branch is mechanical provenance stamping and additive JVM docs-view code, and prior rounds reviewed it.

Testing

Baseline ci-local affected run passed. I ran the focused JVM tests covering docs-site generation, generated-file provenance, the explorer site and the docs-view conformance corpus; all pass. These are unit and integration tests run through Maven, not a live run of the Maven plugin or CLI on a fixture project, so per the live rule they are recorded as not live. A live scenario for a Java or Kotlin project building explorer.json with no Node was not driven, so the verdict is inconclusive, not go. Logs are in the evidence directory.

  • Live validation: ⚠️ inconclusive - 0 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Focused JVM docs-site, provenance and explorer tests pass (Maven, offline) ⏸️ untested no These are unit and integration tests, not a live product run. Passing them does not count as live under the rule. Live driving needs a disposable Maven fixture project run through the plugin, which I…
Java project gets explorer.json with no Node (live generate on a small fixture) ⏸️ untested no Not driven in the turn budget. Would need a fixture module with a docs-site execution, mvn metaobjects:generate run offline and output inspected. Tried to assess feasibility; the plugin install woul…
Stale-manifest adversarial: remove a generator and check docs-site regenerates, not skips ⏸️ untested no Requires a live two-run Maven sequence on a fixture. Only the unit test DocsSiteSkipTest covers the skip logic, not the live sequence.
Evidence: Maven log: DocsSiteSkipTest, GeneratedProvenanceTest, KotlinDocsSiteConformanceTest
[warn] Could not get phase from MojoExecution
[info] MetaData Mojo > Create Loader: MetaDataLoader[manual:docs-skip]
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[info] MetaData Mojo > Executing Generator: com.metaobjects.generator.direct.object.javacode.JavaObjectCodeGenerator
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[info] MetaData Mojo > Executing Generator: com.metaobjects.generator.spring.SpringValueObjectGenerator
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[info] MetaData Mojo > Executing Generator: com.metaobjects.generator.spring.SpringDtoGenerator
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[info] MetaData Mojo > Executing Generator: com.metaobjects.generator.DocsSiteGenerator
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[info] MetaData Mojo > Registered compile source root: <tmp>/module/generated
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[info] MetaData Mojo > Registered compile source root: <tmp>/module/generated-dto
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[warn] Could not get phase from MojoExecution
[info] MetaData Mojo > Create Loader: MetaDataLoader[manual:docs-skip]
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>

... [107045 bytes truncated] ...

ebug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[info] MetaData Mojo > Executing Generator: com.metaobjects.generator.DocsSiteGenerator
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[warn] Could not get phase from MojoExecution
[info] MetaData Mojo > Create Loader: MetaDataLoader[manual:per-package]
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[info] MetaData Verify Mojo > Regenerating (in memory): com.metaobjects.generator.DocsSiteGenerator
[debug] -- Generator [GeneratorParam] merged Args
[debug]     title = 'Shop
[debug]     outputDir = '<tmp>/module/docs
[debug]     projectRoot = '<tmp>/module
[info] MetaData Verify Mojo > No codegen drift detected across 1 generator(s) in 1 output director(y/ies).
[info] metaobjects:verify — template gate skipped: no templateRoot (-Dmeta.verify.templateRoot=...) to resolve @textRef against
[warn] Could not get phase from MojoExecution
[info] MetaData Mojo > Create Loader: MetaDataLoader[manual:per-package]
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[info] MetaData Mojo > Executing Generator: com.metaobjects.generator.direct.object.javacode.JavaObjectCodeGenerator
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[info] MetaData Mojo > Executing Generator: com.metaobjects.generator.spring.SpringValueObjectGenerator
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[info] MetaData Mojo > Executing Generator: com.metaobjects.generator.spring.SpringDtoGenerator
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[debug] -- Generator [GeneratorParam] merged Args
[debug]     flavor = 'pojoAware
[debug]     outputDir = '<tmp>/module/generated
[debug]     projectRoot = '<tmp>/module
[debug]     type = 'class
[info] MetaData Mojo > Registered compile source root: <tmp>/module/generated
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
[info] MetaData Mojo > Registered compile source root: <tmp>/module/generated-dto
[debug] -- Generator [GeneratorParam] merged Args
[debug]     outputDir = '<tmp>/module/generated-dto
[debug]     projectRoot = '<tmp>/module
  • Evidence: Maven log: ExplorerSiteTest, DocsViewConformanceTest
  • Outcome: ⚠️ 2 warnings across 1 run (5m51s)

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 6 issues (1 warning, 5 infos)
  • 🚨 server/java/codegen-base/src/main/java/com/metaobjects/generator/DocsSiteGenerator.java:91 - The JVM docs-site generator lists generated files from the hash manifest on disk (manifest(genState)). MetaDataGeneratorMojo saves that manifest only after every generator has run (run.flush(), MetaDataGeneratorMojo.java:190). So in a write run the explorer is built from the PREVIOUS run's provenance. metaobjects:verify then does a full in-memory render (beginCaptureRun, MetaDataVerifyMojo.java:631) against the manifest that the write run has just saved, so its explorer differs from the committed one. Here is a concrete case: a project adds docs-site and upgrades to this build. Run 1 reads a manifest that has no generatedBy/sourceNode yet (or no manifest, so sources.files:false). It writes explorer.json with empty file lists and then saves provenance for every per-object file. In CI, where the gitignored fingerprint is absent, mvn metaobjects:verify renders explorer.json, explorer-model.js and explorer-stamp.js with the file lists filled, and reports drift. Adding or renaming an entity has the same effect. Running generate again does not repair it, because ADR-0064 skips an unchanged run. The manifest is deliberately not in extraInputs() (DocsSiteGenerator.java:68-70, whose rationale 'that run regenerates anyway' misses that the regeneration reads the pre-save manifest), so the user needs -Dmetaobjects.force=true. Kotlin hits the same flip on its first run, when there is no manifest at docs-site time but one exists at verify time. TypeScript avoids this because runDocsView builds from the run's own output (ctx.runOutput). Recommended fix: build the docs view's files input from the active GeneratedFileWriter.Run provenance. That is the map loaded from disk plus this run's records, and it needs an accessor. Give the capture run the same loaded-and-recorded provenance, so generate and verify see the same input. The sentence 'they show the files the previous write run recorded' (docs/features/explorer-site.md:94, docs/ports/java.md:472 'as of the last write run') would then need updating.
  • ⚠️ server/java/metadata/src/main/java/com/metaobjects/io/json/MetaEndpoint.java:80 - Simplification: the JVM GET {apiPrefix}/_meta/docs helper (META_DOCS_ROUTE_PATH, metaDocsJson, docs(root), the Docs ETag holder, metaDocsEtag, etagMatches, plus MetaDocsEndpointTest, the metadata-ktx test and the Spring controller example in docs/features/metadata-api.md) is a runtime serving surface. The stated Option 4 is to build the docs view, write explorer.json and copy the app, so that a Java/Kotlin project gets the explorer with no Node. The route is not needed for that. The captain's 'pull it all into 1.3.0' may cover it. If it does not, remove the component and keep it for a later change.
  • ℹ️ docs/CONFORMANCE.md:919 - Changed 'One port runs it: TypeScript, in' to 'TypeScript runs it in'. The paragraph just above now says Java and Kotlin build every explorer-conformance case.
  • ℹ️ docs/features/explorer-data.md:161 - The 'Not built yet' entry still said only TypeScript builds the docs view. Reworded it to 'The docs view in C#, Python and Rust. TypeScript, Java and Kotlin build it today'.
  • ℹ️ docs/features/explorer-site.md:91 - The JVM section said no node lists REST routes, but DocsSiteGenerator accepts a routesFile arg. Added 'unless you name them in routesFile ([{ node, method, path }], node a resolution key)'.
  • ℹ️ docs/ports/java.md:472 - Added the missing routesFile arg to the docs-site row's argument list. DocsSiteGenerator.ARG_ROUTES_FILE exists, and the Java/Kotlin conformance tests pass it.

🔧 Fix applied.
7 issues (2 warnings, 5 infos) still open:

  • ⚠️ server/java/metadata/src/main/java/com/metaobjects/io/json/MetaEndpoint.java:80 - Simplification: the JVM GET {apiPrefix}/_meta/docs helper (META_DOCS_ROUTE_PATH, metaDocsJson, docs(root), the Docs ETag holder, metaDocsEtag, etagMatches, plus MetaDocsEndpointTest, the metadata-ktx test and the Spring controller example in docs/features/metadata-api.md) is a runtime serving surface. The stated Option 4 is to build the docs view, write explorer.json and copy the app, so that a Java/Kotlin project gets the explorer with no Node. The route is not needed for that. The captain's 'pull it all into 1.3.0' may cover it. If it does not, remove the component and keep it for a later change.
  • ℹ️ docs/CONFORMANCE.md:919 - Changed 'One port runs it: TypeScript, in' to 'TypeScript runs it in'. The paragraph just above now says Java and Kotlin build every explorer-conformance case.
  • ℹ️ docs/features/explorer-data.md:161 - The 'Not built yet' entry still said only TypeScript builds the docs view. Reworded it to 'The docs view in C#, Python and Rust. TypeScript, Java and Kotlin build it today'.
  • ℹ️ docs/features/explorer-site.md:91 - The JVM section said no node lists REST routes, but DocsSiteGenerator accepts a routesFile arg. Added 'unless you name them in routesFile ([{ node, method, path }], node a resolution key)'.
  • ℹ️ docs/ports/java.md:472 - Added the missing routesFile arg to the docs-site row's argument list. DocsSiteGenerator.ARG_ROUTES_FILE exists, and the Java/Kotlin conformance tests pass it.
  • ⚠️ server/java/codegen-base/src/main/java/com/metaobjects/generator/util/GeneratedFileWriter.java:177 - Round 1's fix for docs-site-stale-manifest-verify-drift introduced this regression. The fix made the docs site list only Run.generatedFiles(), which holds this execution's own record() calls. The committed manifest is merged in only when meta.entities narrows the run (MetaDataGeneratorMojo.java:158). The plugin supports several &lt;execution&gt;s that share one manifest in a module (MetaDataGeneratorMojo.java:131-135: 'two executions in one module share it (merged)'; 'a sibling <execution> sharing the manifest'). Concrete sequence: execution A runs the entity, DTO and controller generators at generate-sources and flushes their provenance. Execution B runs docs-site alone in a later phase. Its run calls configureManifest, so projectRoot is set and generatedFiles() returns an empty map that is not null. DocsView then writes sources.files: true and an empty file list for every object. The round-1 code listed A's files correctly in this setup. metaobjects:verify@B renders the same empty lists, so no gate catches the wrong output. The new docs carry the same claim: explorer-site.md:92-94 and java.md:472 say 'the run builds the site after every other generator', which holds only within one execution. Fix: build the list from this run's records plus every committed-manifest entry whose owner is not one of this execution's owners (the orphan sweep's runOwners rule). Apply the same rule in MetaDataVerifyMojo.renderInMemory by loading the manifest's provenance and owners into the capture run. Then generate and verify still see the same input. Reword the two doc sentences to say 'this execution'.
  • ℹ️ docs/features/explorer-site.md:74 - After the fix round, the Java row of the 'In each port' table still said the explorer reads 'the files the committed hash manifest records per node'. Changed it to 'the files the same run generated per node', which matches the prose below the table and the java.md row.

🔧 Fix applied.
7 issues (2 warnings, 5 infos) still open:

  • ⚠️ server/java/metadata/src/main/java/com/metaobjects/io/json/MetaEndpoint.java:80 - Simplification: the JVM GET {apiPrefix}/_meta/docs helper (META_DOCS_ROUTE_PATH, metaDocsJson, docs(root), the Docs ETag holder, metaDocsEtag, etagMatches, plus MetaDocsEndpointTest, the metadata-ktx test and the Spring controller example in docs/features/metadata-api.md) is a runtime serving surface. The stated Option 4 is to build the docs view, write explorer.json and copy the app, so that a Java/Kotlin project gets the explorer with no Node. The route is not needed for that. The captain's 'pull it all into 1.3.0' may cover it. If it does not, remove the component and keep it for a later change.
  • ℹ️ docs/CONFORMANCE.md:919 - Changed 'One port runs it: TypeScript, in' to 'TypeScript runs it in'. The paragraph just above now says Java and Kotlin build every explorer-conformance case.
  • ℹ️ docs/features/explorer-data.md:161 - The 'Not built yet' entry still said only TypeScript builds the docs view. Reworded it to 'The docs view in C#, Python and Rust. TypeScript, Java and Kotlin build it today'.
  • ℹ️ docs/features/explorer-site.md:91 - The JVM section said no node lists REST routes, but DocsSiteGenerator accepts a routesFile arg. Added 'unless you name them in routesFile ([{ node, method, path }], node a resolution key)'.
  • ℹ️ docs/ports/java.md:472 - Added the missing routesFile arg to the docs-site row's argument list. DocsSiteGenerator.ARG_ROUTES_FILE exists, and the Java/Kotlin conformance tests pass it.
  • ℹ️ docs/features/explorer-site.md:74 - After the fix round, the Java row of the 'In each port' table still said the explorer reads 'the files the committed hash manifest records per node'. Changed it to 'the files the same run generated per node', which matches the prose below the table and the java.md row.
  • ⚠️ server/java/maven-plugin/src/main/java/com/metaobjects/mojo/AbstractMetaDataMojo.java:639 - Round 2's fix (docs-site-run-output-drops-sibling-execution-files) made the JVM docs site list the committed files of the module's OTHER executions (committedFilesBeside, AbstractMetaDataMojo.java:851). The ADR-0064 whole-run skip does not track those files, so the site can go stale with no input change. Concrete sequence: execution A runs entity, DTO and controller generators at generate-sources. Execution B runs docs-site alone later, with the case the round-2 test aDocsSiteExecutionOfItsOwnListsTheFilesAnotherExecutionGenerated covers. The user removes the controller generator from A. A runs, sweeps the controller files and drops their manifest entries. B's per-execution fingerprint (fingerprintOwnerTag) is unchanged: same model, same B config, same extraInputs(). fingerprintMatches iterates only the CURRENT manifest's entries (line 639) and checks each against stored.outputs(). A key that DISAPPEARED from the manifest is never noticed. B skips, so explorer.json, explorer-model.js and explorer-stamp.js still list the deleted controller files. A local verify answers no drift from the fingerprint. CI (fingerprint gitignored) runs renderInMemory, which carries the swept manifest and reports drift. A plain generate does not repair it, and the user needs -Dmetaobjects.force=true. Additions and content changes in A are caught, because a new key or hash has no matching stored output. Only removals leak. The same blind spot leaves the comment at DocsSiteGenerator.java:72-73 wrong. It says 'the files the site lists are the ones this run generates, which follow from the model and these inputs', but since round 2 the site also lists other executions' files, which follow from neither. Smallest fix: in fingerprintMatches, also return false when stored.get().outputs().keySet() differs from the current manifest's key set, so additions and removals are handled the same way. Then correct the DocsSiteGenerator comment. Sibling: fingerprintAnswersNoDrift goes through the same fingerprintMatches, so the one fix covers both generate and local verify.

🔧 Fix applied.
6 issues (1 warning, 5 infos) still open:

  • ⚠️ server/java/metadata/src/main/java/com/metaobjects/io/json/MetaEndpoint.java:80 - Simplification: the JVM GET {apiPrefix}/_meta/docs helper (META_DOCS_ROUTE_PATH, metaDocsJson, docs(root), the Docs ETag holder, metaDocsEtag, etagMatches, plus MetaDocsEndpointTest, the metadata-ktx test and the Spring controller example in docs/features/metadata-api.md) is a runtime serving surface. The stated Option 4 is to build the docs view, write explorer.json and copy the app, so that a Java/Kotlin project gets the explorer with no Node. The route is not needed for that. The captain's 'pull it all into 1.3.0' may cover it. If it does not, remove the component and keep it for a later change.
  • ℹ️ docs/CONFORMANCE.md:919 - Changed 'One port runs it: TypeScript, in' to 'TypeScript runs it in'. The paragraph just above now says Java and Kotlin build every explorer-conformance case.
  • ℹ️ docs/features/explorer-data.md:161 - The 'Not built yet' entry still said only TypeScript builds the docs view. Reworded it to 'The docs view in C#, Python and Rust. TypeScript, Java and Kotlin build it today'.
  • ℹ️ docs/features/explorer-site.md:91 - The JVM section said no node lists REST routes, but DocsSiteGenerator accepts a routesFile arg. Added 'unless you name them in routesFile ([{ node, method, path }], node a resolution key)'.
  • ℹ️ docs/ports/java.md:472 - Added the missing routesFile arg to the docs-site row's argument list. DocsSiteGenerator.ARG_ROUTES_FILE exists, and the Java/Kotlin conformance tests pass it.
  • ℹ️ docs/features/explorer-site.md:74 - After the fix round, the Java row of the 'In each port' table still said the explorer reads 'the files the committed hash manifest records per node'. Changed it to 'the files the same run generated per node', which matches the prose below the table and the java.md row.
⚠️ **Test** - 2 warnings
  • ⚠️ server/java/maven-plugin - No live end-to-end run: the Java/Kotlin docs-site path (metaobjects:generate with a docs-site entry, then explorer.json and the copied app with no Node) was not driven against a fixture project. Evidence is focused tests only. Needs a disposable fixture run of the Maven plugin to confirm the explorer output and the stale-manifest fixes (rounds 1-4) hold live.
  • ⚠️ live validation verdict: inconclusive (0 of 3 scenarios were driven live against the product); untested: Focused JVM docs-site, provenance and explorer tests pass (Maven, offline), Java project gets explorer.json with no Node (live generate on a small fixture), Stale-manifest adversarial: remove a generator and check docs-site regenerates, not skips
  • Live validation: ⚠️ inconclusive - 0 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Focused JVM docs-site, provenance and explorer tests pass (Maven, offline) ⏸️ untested no These are unit and integration tests, not a live product run. Passing them does not count as live under the rule. Live driving needs a disposable Maven fixture project run through the plugin, which I…
Java project gets explorer.json with no Node (live generate on a small fixture) ⏸️ untested no Not driven in the turn budget. Would need a fixture module with a docs-site execution, mvn metaobjects:generate run offline and output inspected. Tried to assess feasibility; the plugin install woul…
Stale-manifest adversarial: remove a generator and check docs-site regenerates, not skips ⏸️ untested no Requires a live two-run Maven sequence on a fixture. Only the unit test DocsSiteSkipTest covers the skip logic, not the live sequence.
  • scripts/ci-local.sh --affected --strict-toolchains
  • baseline: scripts/ci-local.sh --affected --strict-toolchains (passed at target commit, per run context)
  • mvn -o -q -pl maven-plugin -am test -Dtest=DocsSiteSkipTest,GeneratedProvenanceTest (run from server/java): DocsSiteSkipTest 3/3, GeneratedProvenanceTest 5/5, KotlinDocsSiteConformanceTest 1/1 pass
  • mvn -o -q -pl codegen-base,metadata -am test -Dtest=ExplorerSiteTest,DocsViewConformanceTest (run from server/java): ExplorerSiteTest 7/7, DocsViewConformanceTest 3/3 pass
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…nd Python manifests

After a write run, the hash manifest entry of a per-object file now names its
generator and the node's resolution key ({hash, generatedBy, sourceNode}, after
the JVM's generator/outputDir), as TypeScript already did, so a docs view built
from any of these ports lists each node's generated files. A whole-model file
keeps the plain hash. A shared 'provenance' vector in
fixtures/codegen-skip-conformance/manifests.json holds TypeScript, C#, Java and
Python to the same entries.
…VM, with no Node

The JVM builds the port-neutral docs view from its loaded model (DocsView), byte for byte
what TypeScript builds for every fixtures/explorer-conformance case, gated in the metadata
suite. A docs-site generator (DocsSiteGenerator, registered in the Java and Kotlin
registries, eject-exempt like TypeScript's) writes explorer.json, the shared explorer app,
explorer-model.js and explorer-stamp.js, and lists each node's generated files from the
hash manifest's provenance. Kotlin runs the same class, and its suite gates every corpus
case through its own registry. MetaEndpoint gains the /_meta/docs helpers (body, ETag,
If-None-Match), mounted by the host as /_meta is.

Needs the HashManifest.loadProvenance API from #669.
…fm/mo-130-docs-view-jvm

# Conflicts:
#	docs/features/explorer-site.md
…h dry-run

cargo publish --workspace unpacks its overlay-registry dependencies into a
per-checkout directory and never re-unpacks while the version is unchanged,
so the self-hosted runner verified metaobjects-codegen against a
metaobjects-1.3.0 unpacked before metamodel_docs existed. Main has been red on
the rust lane since #670 for this reason; the crate itself packages correctly.
…t, and hold docs-site to the inert line

The model and stamp scripts move beside the docs view serializer
(com.metaobjects.docsview.ExplorerModelScript), so codegen-base types no line
breaks (LayoutRatchetTest). The codegen-noop inert tests hold docs-site to the
line TypeScript's rules-inert test draws: the explorer documents every node, so
only its data payload may differ, and only by the new nodes and members.
@dmealing
dmealing merged commit 07fdf70 into main Nov 28, 2026
11 checks passed
@dmealing
dmealing deleted the fm/mo-130-docs-view-jvm branch November 28, 2026 09:26
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