iterate.com / kernel

git clone https://git.iterate.com/repos/kernel

GitHub mirror: the publish job takes an exact npm, and the workflow names the reviewer gate (#24)

The reviewer's read of pull 23 (card tasks/build-and-validate-the-standalone-npm-publisher.md).

- The job that holds npm's token installs npm 11.21.3, not the moving tag npm@11.
- Comments name the two gates that are settings of github.com/iterate/kernel and that no commit can remove: required reviewers on the environment npm (jonastemplestein, mmkal), and a ruleset that refuses a forced push to main and its deletion. Both are set.

Two workflow files change, nothing else.

Session: claude 11c408f7-7edb-4a8d-8a49-8382fb8307e6 on beelink

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Iterate-Run: /@1165508

jonas, 2026-11-27 14:10 UTC · 671f2cfcfbdf6c221637bcc8902a269e6cc20b74 · parent 2146c01

2 files changed

M .github/workflows/mirror.yml
@@ -2,7 +2,7 @@
 # github.com/iterate/kernel is a read-only mirror of https://git.iterate.com/repos/kernel, with the
 # same commits. This workflow runs in the mirror: it reads the source's main with no credential and
 # pushes it to the mirror's main. The push never forces: when the two have parted, it fails and a
-# person looks.
+# person looks. A ruleset of the mirror refuses a forced push to main and its deletion.
 #
 # It pushes with the deploy key in the secret MIRROR_DEPLOY_KEY, which can write to this repository
 # alone. The job's own token will not do: GitHub lets it push no commit that changes a workflow, and
M .github/workflows/npm-publish.yml
@@ -13,6 +13,10 @@
 # its tarball on computers that have nothing of ours. `publish` hands npm the tarball that both
 # installs passed, with no script of it run. `check` asks npm, as this workflow, whether the
 # package trusts it; it writes and removes the tag `npm-publish-check` and nothing else.
+#
+# `publish` and `check` wait for a person: the environment `npm` has required reviewers. That gate
+# is a setting on GitHub, so no commit here can remove it. Without it, a commit that edits this
+# file could publish, and mirror.yml brings every commit of the source's main.
 on:
   push:
     branches:
@@ -85,7 +89,8 @@
           path: ${{ runner.temp }}/tarball
       - run: node .github/npm-publish.mjs install --tarball "$(ls "$RUNNER_TEMP"/tarball/*.tgz)"
   # npm gets the tarball that both installs passed, as it is: no script of the package runs here.
-  # Only a dispatch on main that names a dist-tag gets here. The environment `npm` takes main alone.
+  # Only a dispatch on main that names a dist-tag gets here. The environment `npm` takes main
+  # alone, and a reviewer of it approves the job.
   publish:
     needs: [pack, install]
     if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && (inputs.action == 'canary' || inputs.action == 'main')
@@ -102,8 +107,9 @@
       - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
         with:
           node-version: 26
-      # trusted publishing needs npm 11.5.1 or later
-      - run: npm install --global npm@11
+      # trusted publishing needs npm 11.5.1 or later; an exact version, because this job holds
+      # npm's token
+      - run: npm install --global npm@11.21.3
       - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
         with:
           name: tarball