Repository navigation
Publish to npm only after attestation, and keep one launcher copy per version - #193
Merged
Merged
Conversation
…r copy per version The npm job ran beside `verify`, so a failed attestation still shipped an unattested version that npm will never take again. It now needs `verify`. The launcher keyed its copy by install time as well as version and size, so every fresh extract added a 95 MB copy that stayed for 30 days. It is keyed by version and size now; a published version's bytes never change. A launch whose copy was swept by another launcher between the check and the spawn falls back to the package's own binary instead of exiting 2. `runnable` takes the platform and LOCALAPPDATA as arguments, and npm/zerograph/test/launcher.test.js pins the slot rules on all three CI platforms: reuse, reinstall, the 30-day sweep and the daily mark.
The linker pads a PE file to 512 bytes, so a rebuild of one version often keeps its size, and the version-and-size slot kept running the old copy. An install the slot has not seen is now hashed once against the copy; a match is remembered in `seen`, a mismatch replaces the copy, and a replace blocked by the old build still running runs the package's own binary. The ENOENT fallback moves into `spawnBinary`, and the tests pin it along with the same-size rebuild.
This was referenced Oct 17, 2026
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.
Summary
Fixes from the post-merge review of #190 (commit 47c324a), before
v0.6.1is tagged..github/workflows/release.yml):npmnowneeds: [build, verify]. Before, a failed attest step still published an unattested version that npm will never accept again, whiledocs/install.mdpromises every binary verifies.npm/zerograph/bin/zerograph.js): the slot key no longer includes the install's ctime, so a reinstall or a dailynpm cireuses its copy instead of adding a 95 MB one that stays 30 days. Different versions still get separate slots, and the 30-day sweep stays. If another launcher's sweep removes the copy between the check and the spawn (ENOENT), the package's own binary runs instead of exiting 2.A same-size rebuild (the linker pads PE files to 512 bytes) is hashed once against the copy and replaces it when the bytes differ.
runnabletakes platform and LOCALAPPDATA as arguments and is exported.npm/zerograph/test/launcher.test.jscovers reuse, reinstall, sweeping a stale slot, keeping a recent one, and the daily mark. It runs in CI beside the hook tests on all three platforms. The stale "per-version copy" comment inci.ymlis corrected.Test plan
node --test npm/zerograph/test/launcher.test.jslocally: 9/9serve)verify→npmordering proven on thev0.6.1tag run