Skip to content

Publish to npm only after attestation, and keep one launcher copy per version - #193

Merged
devmaxxx merged 2 commits into
mainfrom
fix/release-attest-gate
Oct 17, 2026
Merged

devmaxxx merged 2 commits into
mainfrom
fix/release-attest-gate

Conversation

@devmaxxx

@devmaxxx devmaxxx commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes from the post-merge review of #190 (commit 47c324a), before v0.6.1 is tagged.

  • npm publishes only after attestation (.github/workflows/release.yml): npm now needs: [build, verify]. Before, a failed attest step still published an unattested version that npm will never accept again, while docs/install.md promises every binary verifies.
  • One launcher copy per version and size (npm/zerograph/bin/zerograph.js): the slot key no longer includes the install's ctime, so a reinstall or a daily npm ci reuses 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.
  • Tests: runnable takes platform and LOCALAPPDATA as arguments and is exported. npm/zerograph/test/launcher.test.js covers 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 in ci.yml is corrected.

Test plan

  • node --test npm/zerograph/test/launcher.test.js locally: 9/9
  • CI green on Linux, macOS and Windows (the Windows step still upgrades under a live serve)
  • verify → npm ordering proven on the v0.6.1 tag run

…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.
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