Context
The operator's release decision is recorded on #18823: generated browser bundles do not belong in the npm package; consuming workspaces generate them. The publisher already runs npm ci → npm publish on a fresh checkout.
This is the implementation follow-up proposed there. The older Mermaid-only decision body remains historical context; this leaf has one package-policy cleanup scope.
Design authority: the operator's October 6 no-generated-bundles decision, as recorded by Grace in the linked receipt.
The Problem
Validation still certifies a different package:
.npmignore re-includes generated parser, diagram, editor and highlighting bundles.
check-package-contents.mjs requires 13 generated dist/ entries.
- Package-content and consumer-runtime workflows generate them before packing.
A direct rule probe at 6e19f603 accepts dist/parse5.mjs and dist/monaco/editor.mjs, while a source-only path set reports all 13 bundle files missing. A developer's already-built checkout can therefore pack generated files even though a clean publisher does not.
The Architectural Reality
Existing owners:
.npmignore plus buildScripts/util/npmIgnoreComposition.mjs govern the actual npm file set.
buildScripts/util/check-package-contents.mjs audits that file set; its owning spec is test/playwright/unit/buildScripts/checkPackageContents.spec.mjs.
buildScripts/util/check-consumer-runtime-build.mjs packs and installs a real consumer fixture, then compiles Data, Canvas, App and Main contexts.
buildScripts/util/browserBundles.mjs identifies build/copy producers; its comments still describe shipping their output.
- The two named CI workflows decide whether generation happens before or after package installation.
No new module, service, build primitive or publisher step is needed. The existing consumer fixture is the right place to prove generation and compilation outside the producer checkout.
The Fix
- Exclude the whole generated
dist/ tree, including outputs already present in a developer checkout.
- Replace required-generated-file assertions with a forbidden-
dist/ assertion; retain private-state exclusion and ontology carve-out coverage.
- Pack the source-only package in both checks. In the consumer check, install the installed Engine's build dependencies without lifecycle side effects, then run its existing bundle-generation command inside that installed copy before compilation.
- Update directly affected comments/tests so they describe source delivery and consumer generation.
| Surface |
Source of authority |
Behavior |
Failure |
Documentation |
Evidence |
| npm file set |
Operator ruling; .npmignore composition |
No dist/ file ships, built checkout or clean |
Package guard fails on any generated entry |
Ignore header and guard JSDoc |
Real pack with planted generated files |
| Package guard |
Existing prefix validator and own spec |
Enforce generated-tree exclusion alongside existing private-state rules |
Nonzero exit on a forbidden entry |
Guard output/JSDoc |
Negative rule control and real pack |
| Consumer build |
Existing installed-fixture guard |
Generate dependencies in the installed Engine, then preserve all current compile/context assertions |
Dependency generation or compile failure fails the job |
Consumer guard/workflow comments |
Actual CI consumer fixture |
Decision Record impact: none; applies the existing release ruling.
Acceptance Criteria
Out of Scope
Publishing Engine or create-app, changing the accepted package decision, redesigning the bundlers, unrelated package-size cuts, and native Fleet installation.
Avoided Traps
Do not revive the deliberately closed #19423 publisher build step. Do not certify only a clean checkout: generated files must be present to falsify the ignore rule. Do not copy this checkout's prebuilt bundles into the consumer fixture.
Related: #18823, neomjs/create-app#34.
Ownership: Sophie takes this bounded implementation leaf; Grace retains the release stream and recorded package-policy context.
Discovery: latest 20 created-descending open Engine issues and 30 recent all-state A2A messages checked immediately before creation on October 8; no overlapping claim/PR. Live package-policy searches found the decision record only. MC sweep recovered session 40a3c119-6419-4e87-9248-002c686708fe and the explicit operator correction. Own assigned Engine issues are #19462 and #19465, both unrelated UI repairs. KB confirms this same unresolved policy/check mismatch.
Origin Session ID: e6ce4d70-a7ff-454e-996d-e7c25efdf4cf
Retrieval Hint: "source-only npm package generated dist required entries consumer bundle after install"
Context
The operator's release decision is recorded on #18823: generated browser bundles do not belong in the npm package; consuming workspaces generate them. The publisher already runs
npm ci→npm publishon a fresh checkout.This is the implementation follow-up proposed there. The older Mermaid-only decision body remains historical context; this leaf has one package-policy cleanup scope.
Design authority: the operator's October 6 no-generated-bundles decision, as recorded by Grace in the linked receipt.
The Problem
Validation still certifies a different package:
.npmignorere-includes generated parser, diagram, editor and highlighting bundles.check-package-contents.mjsrequires 13 generateddist/entries.A direct rule probe at
6e19f603acceptsdist/parse5.mjsanddist/monaco/editor.mjs, while a source-only path set reports all 13 bundle files missing. A developer's already-built checkout can therefore pack generated files even though a clean publisher does not.The Architectural Reality
Existing owners:
.npmignoreplusbuildScripts/util/npmIgnoreComposition.mjsgovern the actual npm file set.buildScripts/util/check-package-contents.mjsaudits that file set; its owning spec istest/playwright/unit/buildScripts/checkPackageContents.spec.mjs.buildScripts/util/check-consumer-runtime-build.mjspacks and installs a real consumer fixture, then compiles Data, Canvas, App and Main contexts.buildScripts/util/browserBundles.mjsidentifies build/copy producers; its comments still describe shipping their output.No new module, service, build primitive or publisher step is needed. The existing consumer fixture is the right place to prove generation and compilation outside the producer checkout.
The Fix
dist/tree, including outputs already present in a developer checkout.dist/assertion; retain private-state exclusion and ontology carve-out coverage..npmignorecompositiondist/file ships, built checkout or cleanDecision Record impact: none; applies the existing release ruling.
Acceptance Criteria
dist/path even when generated files exist locally; source, producer scripts and existing privacy exclusions remain correct.dist/path; its existing private-state/carve-out controls remain green.Out of Scope
Publishing Engine or create-app, changing the accepted package decision, redesigning the bundlers, unrelated package-size cuts, and native Fleet installation.
Avoided Traps
Do not revive the deliberately closed
#19423publisher build step. Do not certify only a clean checkout: generated files must be present to falsify the ignore rule. Do not copy this checkout's prebuilt bundles into the consumer fixture.Related: #18823, neomjs/create-app#34.
Ownership: Sophie takes this bounded implementation leaf; Grace retains the release stream and recorded package-policy context.
Discovery: latest 20 created-descending open Engine issues and 30 recent all-state A2A messages checked immediately before creation on October 8; no overlapping claim/PR. Live package-policy searches found the decision record only. MC sweep recovered session
40a3c119-6419-4e87-9248-002c686708feand the explicit operator correction. Own assigned Engine issues are#19462and#19465, both unrelated UI repairs. KB confirms this same unresolved policy/check mismatch.Origin Session ID: e6ce4d70-a7ff-454e-996d-e7c25efdf4cf Retrieval Hint: "source-only npm package generated dist required entries consumer bundle after install"