Skip to content

fix(release): state which jobs block egress, check the package's own prepare scripts, measure install size - #214

Merged
william-monroy merged 3 commits into
mainfrom
fix/release-hardening-claims
Nov 30, 2026
Merged

william-monroy merged 3 commits into
mainfrom
fix/release-hardening-claims

Conversation

@william-monroy

@william-monroy william-monroy commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Four release claims checked against what actually happens, then fixed where they were wrong.

1. Egress: "every release job can reach only the hosts on its allow list" (false)

Harden-Runner's README (compatibility matrix, v2.23.0) lists GitHub-hosted macOS and Windows runners as audit mode only; block mode needs Linux. The standalone build job runs on macos-15 and had no Harden-Runner step at all, and the macOS and Windows smoke jobs skipped it.

  • standalone.yml: the macOS build job now runs Harden-Runner in audit mode (connections logged in the insights page, not limited), with a comment on what protects it instead: contents: read, no id-token, no secrets. The smoke job uses block on Linux and audit on macOS and Windows (it used to skip Harden-Runner there).
  • release.yml header, SECURITY.md and docs/RELEASING.md now list Harden-Runner per job:
    • block: the four jobs of release.yml, the Linux smoke job and the upload job of standalone.yml;
    • audit: the standalone build job and the macOS and Windows smoke jobs, and the Linux jobs of ci.yml, install.yml, bench.yml, docs.yml, scorecard.yml and zizmor.yml;
    • none: the macOS jobs of ci.yml, install.yml and bench.yml, and the Windows job of ci.yml (no steps added to CI workflows).
  • Only the Node.js archives the standalone build embeds are checked against a pinned SHA-256. The Node.js and pnpm the job runs with come from setup-node and action-setup, which are pinned by action SHA but not checksummed. SECURITY.md and the workflow comment say so.

2. Homebrew installs the tested versions (true, plus a caveat)

The formula (wimo-dev/homebrew-turno, Formula/turno.rb, turno-cli 0.6.1) does not install the tarball with npm install. It unpacks the package, removes devDependencies and runs npm ci --omit=dev --ignore-scripts, and npm ci follows npm-shrinkwrap.json. Reproduced with Node 26.13.0 and npm 11.20.0, each run in its own empty prefix with a throwaway HOME, npm cache and npmrc:

Install 0.6.1: matches the shrinkwrap 0.6.3: matches the shrinkwrap
Formula recipe (npm ci in the package folder) 97 of 97 97 of 97
npm install -g turno-cli@<v> (registry) 97 of 97 not run
npm install -g ./turno-cli-<v>.tgz 87 of 97, 10 newer (hono 4.13.17 to 4.13.23, router 2.2.0 to 2.3.0, ...) 87 of 97, the same 10

So the README and install page claim holds, and the formula recipe needs no change. Nothing bumps the tap automatically, though: 0.6.2 and 0.6.3 never got a bump, so brew install turno still gives 0.6.1. wimo-dev/homebrew-turno#10 bumps it to 0.6.3 (the tarball's sha512 matches npm's dist.integrity), and docs/RELEASING.md now lists the tap bump as a step after every turno-cli release. The only exception is installing a downloaded .tgz by hand. The install pages (en, es) and SECURITY.md now name that case, since SECURITY.md tells readers to npm pack a tarball to verify it.

3. Install-script check misses prepare (partly true)

What npm runs depends on how the package is installed. Sources: npm docs ("Life Cycle Operation Order", npm install-scripts), arborist rebuild.js, pacote dir.js and git.js, and a run with npm 11.20 using a package that logs every lifecycle event:

  • dependency from the registry or a tarball: preinstall, install, postinstall only. prepare, prepack, preprepare, postprepare and prepublish do not run.
  • dependency from git or a folder: also prepare. A published tree never has one: every shrinkwrap entry resolves to a registry tarball.
  • the package itself, installed as the project by npm ci or a bare npm install in its folder (the Homebrew formula's mode): also prepublish, preprepare, prepare, postprepare and dependencies.

The check on dependencies was already complete. Adding prepare/prepublish there would fail on about 30 current dependencies (qs, ajv, express-rate-limit, ...) whose scripts npm never runs. The real gap was the published package itself. pack-check now checks it against the project set. publishedManifest drops the scripts pnpm pack leaves out (prepare, prepack, postpack, prepublishOnly, publish, postpublish, checked with pnpm 12.2), so the check sees the manifest that actually ships. The new test in scripts/shrinkwrap.test.mjs checks pack-check's view: a source manifest with only prepare and prepack passes once pnpm drops them, and a postprepare that would ship is flagged.

4. Package sizes (measured)

bench/install-size.mjs installs each version into an empty prefix with an empty cache, a throwaway HOME and empty npmrc files (--ignore-scripts). It records the load average at the start. Result: bench/results/2026-11-30-m3-16gb-install-size.json. Machine: Apple M3, 16 GB, macOS 27.2.1, Node v26.13.0, npm 11.20.0. Started 2026-11-30 06:41 UTC, load average 181.6 / 95.0 / 79.7 (shared machine). The load only affects the timings.

turno-cli Files On disk (du) Packages Shrinkwrap
0.1.1 41.1 MiB (43.1 MB) 54.6 MiB 100 no (its ranges resolve to today's versions)
0.2.0 17.7 MiB (18.5 MB) 27.8 MiB 97 yes
0.6.3 18.0 MiB (18.9 MB) 28.2 MiB 98 yes

An earlier run at 06:20 UTC had byte-identical file sizes and package counts, but du gave 51.4 / 27.7 / 28.2 MiB. Disk usage varies between runs of the same tree; file sizes do not.

The changelog's "about 52 MB down to 27 MB" matches disk usage in MiB, not MB of files. The 0.2.0 release page now cites the stable numbers (18.5 MB of files in 97 packages, down from 43.1 MB in 100) and links the result. The changelog files are left as published.

Changesets

None: no package code changes. Only release tooling (scripts/), a bench script, workflows and docs change, as in earlier docs and bench pull requests.

Checks

  • pnpm build && TURNO_SKIP_E2E=1 pnpm check (typecheck, Biome, knip, tests, em dash scan, node floor, changeset names, patchright guard, licenses)
  • node scripts/pack-check.mjs
  • actionlint on release.yml and standalone.yml. zizmor runs in CI on this pull request.
  • This pull request touches standalone.yml, so CI runs the standalone dry run, macOS build with the new audit step included.

…prepare scripts, measure install size

- standalone.yml: the macOS build job runs Harden-Runner in audit mode (GitHub's macOS and
  Windows runners support no block mode); smoke blocks on Linux and audits elsewhere.
  SECURITY.md, RELEASING.md and the release.yml header name the jobs that block.
- pack-check checks the published package as a project, the way the Homebrew formula's
  `npm ci` installs it: prepublish, preprepare, prepare, postprepare and dependencies too.
  publishedManifest drops the scripts pnpm pack leaves out.
- SECURITY.md and the install pages: npm ignores the shrinkwrap for a downloaded tarball.
- bench/install-size.mjs and its first result (turno-cli 0.1.1, 0.2.0, 0.6.3); the 0.2.0
  release page cites it.
…s, add the tap bump

- RELEASING.md: which jobs block, which audit and which run without Harden-Runner (the macOS
  jobs of ci, install and bench, and ci's Windows job); the Homebrew formula bump after
  every turno-cli release.
- SECURITY.md and standalone.yml: only the embedded Node.js archives are checked against a
  checksum; setup-node and action-setup are pinned by action SHA.
- The shrinkwrap test checks pack-check's view of the published manifest instead of the list.
- bench/install-size.mjs records the load average; rerun result, and the 0.2.0 page cites
  the file sizes, which do not vary between runs as disk usage does.
@william-monroy
william-monroy force-pushed the fix/release-hardening-claims branch from 162918d to 4c50c76 Compare November 30, 2026 08:00
@william-monroy
william-monroy merged commit 71ea0b7 into main Nov 30, 2026
29 of 30 checks passed
@william-monroy
william-monroy deleted the fix/release-hardening-claims branch November 30, 2026 08:45
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