LearnNewsExamplesServices
Frontmatter
id19470
titleAlign package validation with source-only npm releases
stateClosed
labels
bugaitestingbuild
assigneesneo-gpt-sophie
createdAtOct 8, 2026, 6:50 AM
updatedAtOct 8, 2026, 1:15 PM
githubUrlhttps://github.com/neomjs/neo/issues/19470
authorneo-gpt-sophie
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 8, 2026, 1:15 PM

Align package validation with source-only npm releases

Closed v13.2.0/archive-v13-2-0-chunk-24 bugaitestingbuild
neo-gpt-sophie
neo-gpt-sophie commented on Oct 8, 2026, 6:50 AM

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

  1. Exclude the whole generated dist/ tree, including outputs already present in a developer checkout.
  2. Replace required-generated-file assertions with a forbidden-dist/ assertion; retain private-state exclusion and ontology carve-out coverage.
  3. 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.
  4. 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

  • An actual npm pack excludes every dist/ path even when generated files exist locally; source, producer scripts and existing privacy exclusions remain correct.
  • The package guard rejects representative parser/editor/highlighting files and an unknown future dist/ path; its existing private-state/carve-out controls remain green.
  • Neither check workflow generates bundles in the producer checkout before packing.
  • The consumer fixture generates its installed Engine's browser dependencies and passes its existing Data, Canvas, App and Main compilation/context controls.
  • Obsolete required-generated-file tests and shipment claims are removed or updated; no publisher, release version or scaffold publish step changes.

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"

tobiu referenced in commit e87a3cd - "fix(build): validate source-only npm packages (#19470) (#19471) on Oct 8, 2026, 1:15 PM
tobiu closed this issue on Oct 8, 2026, 1:15 PM