Repository navigation
fix(release): bundle full dependency closure in CLI/MCP tarballs - #245
Merged
Merged
Conversation
npm install -g dialectos-cli-0.3.1.tgz exited 0 but every invocation crashed with ERR_MODULE_NOT_FOUND: isomorphic-dompurify. npm silently skips installing dependencies co-declared by a bundleDependencies package (deps of bundled deps are assumed present), so the previous hoist-only strategy left isomorphic-dompurify, zod, marked and the whole jsdom tree as empty directories on clean machines. - pack-release-tarballs.mjs now vendors the full transitive closure (resolved via a real npm install) into the tarball and verifies every bundled/nested package is present in the packed artifact - new tarball-install-smoke.mjs gates releases on the defect bar: pristine-prefix OFFLINE install, --version prints, unknown dialect fails closed with an actionable error, known dialect passes, MCP initialize handshake answers - release.yml runs the smoke after packing; pack tests updated to the new bundle contract (49 packages cli, 137+4 nested mcp)
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.
Defect
t_63ad6d49countersign (growth-comms, 2026-10-27):npm install -g https://github.com/KyaniteLabs/DialectOS/releases/download/v0.3.1/dialectos-cli-0.3.1.tgzexits 0 on a clean machine (pristineNPM_CONFIG_PREFIX/NPM_CONFIG_CACHE, node v22.23.4, npm 10.9.9) but every CLI invocation crashes:Reproduced during this fix: every dependency directory except
commanderis installed empty.Root cause
npm does not install dependencies it considers part of a
bundleDependenciessubtree ("deps of bundled deps" are assumed present). The v0.3.1 pack strategy bundled the five@dialectos/*libs but only hoisted their public deps (isomorphic-dompurify, zod, marked) onto the parent manifest, expecting npm to fetch them. npm built the correct ideal tree (placeDep [email protected] OK…) but the reify diff only ever extracted two nodes (root +commander, the one dep declared solely by the root) and exited 0. Everything co-declared by a bundled lib — plus the entire jsdom subtree — was skipped, leaving empty placeholder dirs. The MCP tarball has the same hole (zodis co-declared by every bundled lib).The green governance re-probe (t_930420b7) only passed because a warm cache / non-pristine prefix satisfied those deps outside the tarball.
Fix
scripts/pack-release-tarballs.mjs: resolve the union of public runtime deps with a realnpm installinto a staging area, move the entire resolved tree into the tarball'snode_modules/, and list every package inbundleDependencies. The tarballs now install with zero registry access.scripts/tarball-install-smoke.mjs(wired intorelease.ymlafter packing and intoscripts/__tests__/pack-release-tarballs.test.mjs): pristine-prefix--offlineinstall must succeed, then the defect bar —dialectos --versionprints0.3.1validate --dialect xx-XXfails closed naming the dialect anddialectos dialects listvalidate --dialect es-MX(with--source) passesinitializehandshake answers@dialectos/[email protected]Evidence (local, node v22.23.4 / npm 10.9.9)
node --test scripts/__tests__/*.test.mjs→ 66/66 pass (includes the new pack + offline smoke tests)49 bundled + 0 nested verified(6.2 MB), mcp137 bundled + 4 nested verifiedFollow-up (same task lane)
After merge: rebuild both tarballs from main, replace the v0.3.1 release assets +
SHA256SUMS.txt(gh release upload --clobber), and re-run the four receipts against the live release URL on a pristine prefix/cache.Need help on this PR? Tag
@codesmith-botwith what you need.