Install the pinned node when the installed one is another major version (closes #118) #127

Merged
clawbot merged 1 commits from issue-118-pinned-node into next 2026-10-08 04:14:22 +02:00
Collaborator

Implements #118.

script/bootstrap uses the installed node only when its major version is the pinned one (22). Otherwise (node missing, or another major such as the CI runner image's node 24) it installs the pinned NODE_VERSION with nvm and installs yarn and the packages under it, so yarn 1.22.22 no longer prints DEP0169. Either way it prints the version of the node it uses. The Dockerfile stages keep the image's own node 22.

script/fmt and script/fmt-check carry bootstrap's node_is_pinned_major unchanged and pick their yarn by it: the yarn on PATH when the node on PATH is the pinned major, otherwise yarn under the pinned node, loading nvm through $HOME/.nvm/nvm.sh (which honours NVM_DIR). When that yarn or nvm is missing they print "no yarn; run script/bootstrap first" and exit 1, as on next.

REPO_POLICIES.md and both checklists describe this. The version-comparison rule in REPO_POLICIES.md names node as its exception, and the checklists' final script/cibuild check names what the CI runner image has: docker, git and node 24, no yarn.

On a host whose own node is another major, a developer's node 26 included, bootstrap installs node 22.17.0 under nvm and the fmt scripts use it.

Disclosures:

  • Judgement call: node is compared by major version only, because the node 22 alpine image is not the exact pin and nvm cannot install on alpine.
  • Judgement call: bootstrap tests for node with command -v rather than its missing helper, so the function reads the same in all three scripts.
  • Not tried on the Gitea runner itself.

Model: opus-5-5

Implements https://git.eeqj.de/sneak/prompts/issues/118. `script/bootstrap` uses the installed node only when its major version is the pinned one (22). Otherwise (node missing, or another major such as the CI runner image's node 24) it installs the pinned `NODE_VERSION` with nvm and installs yarn and the packages under it, so yarn 1.22.22 no longer prints DEP0169. Either way it prints the version of the node it uses. The `Dockerfile` stages keep the image's own node 22. `script/fmt` and `script/fmt-check` carry bootstrap's `node_is_pinned_major` unchanged and pick their yarn by it: the `yarn` on `PATH` when the node on `PATH` is the pinned major, otherwise yarn under the pinned node, loading nvm through `$HOME/.nvm/nvm.sh` (which honours `NVM_DIR`). When that yarn or nvm is missing they print "no yarn; run script/bootstrap first" and exit 1, as on `next`. `REPO_POLICIES.md` and both checklists describe this. The version-comparison rule in `REPO_POLICIES.md` names node as its exception, and the checklists' final `script/cibuild` check names what the CI runner image has: docker, git and node 24, no yarn. On a host whose own node is another major, a developer's node 26 included, bootstrap installs node 22.17.0 under nvm and the fmt scripts use it. Disclosures: - Judgement call: node is compared by major version only, because the node 22 alpine image is not the exact pin and nvm cannot install on alpine. - Judgement call: bootstrap tests for node with `command -v` rather than its `missing` helper, so the function reads the same in all three scripts. - Not tried on the Gitea runner itself. Model: opus-5-5
clawbot added the needs-review label 2026-10-08 02:35:30 +02:00
clawbot self-assigned this 2026-10-08 02:35:30 +02:00
Author
Collaborator
  1. script/fmt and script/fmt-check (lines 16-19) pick which yarn to run by checking whether $HOME/.nvm/versions/node/v22.17.0 exists. That is not the test script/bootstrap uses (the major version of the node on PATH), and it ignores NVM_DIR. As a result, script/fmt-check can fail straight after a successful script/bootstrap:

    • NVM_DIR set to another directory (nvm's own installer does this when XDG_CONFIG_HOME is set): nvm puts node 22.17.0 there and the check misses it. The script then stops with "no yarn", which worked before this change, or, if a yarn is on PATH, runs that yarn under the other node.
    • The node on PATH is another 22.x with its own yarn, and nvm also holds 22.17.0 without one: bootstrap uses the yarn on PATH, while script/fmt-check switches to nvm's 22.17.0 and exits 127.

    Acceptable: the fmt scripts decide the same way bootstrap does, so the two never disagree. If the node on PATH is the pinned major, use the yarn on PATH; otherwise run yarn under the pinned node, loaded through $HOME/.nvm/nvm.sh (which honours NVM_DIR). REPO_POLICIES.md, both checklists and the PR body should describe that.

  2. prompts/REPO_POLICIES.md, the rule that script/bootstrap installs a pinned tool by comparing versions (line 536 on): it still gives comparison "over the whole version token" as the canonical form, with no exception. The canonical script/bootstrap now compares only node's major version, and the reason is given only in the bootstrap paragraph near the top of the file, so anyone reading the rule will take the canonical script for a violation of it. Acceptable: keep the major-version comparison and add one sentence at that rule naming node as the exception and why (the node 22 alpine image in the Dockerfile stages is not the exact pin, and nvm cannot install a prebuilt node on alpine).

  3. prompts/NEW_REPO_CHECKLIST.md line 194 and prompts/EXISTING_REPO_CHECKLIST.md line 210 still say CI has "no node or yarn on PATH". That contradicts the policy text this PR adds: the CI runner image ships node 24 (and no yarn). Acceptable: both items state what CI actually has, so the check they ask for covers the host this change was made for.

Model: opus-5-5

1. `script/fmt` and `script/fmt-check` (lines 16-19) pick which yarn to run by checking whether `$HOME/.nvm/versions/node/v22.17.0` exists. That is not the test `script/bootstrap` uses (the major version of the node on `PATH`), and it ignores `NVM_DIR`. As a result, `script/fmt-check` can fail straight after a successful `script/bootstrap`: - `NVM_DIR` set to another directory (nvm's own installer does this when `XDG_CONFIG_HOME` is set): nvm puts node 22.17.0 there and the check misses it. The script then stops with "no yarn", which worked before this change, or, if a `yarn` is on `PATH`, runs that yarn under the other node. - The node on `PATH` is another 22.x with its own yarn, and nvm also holds 22.17.0 without one: bootstrap uses the yarn on `PATH`, while `script/fmt-check` switches to nvm's 22.17.0 and exits 127. Acceptable: the fmt scripts decide the same way bootstrap does, so the two never disagree. If the node on `PATH` is the pinned major, use the `yarn` on `PATH`; otherwise run yarn under the pinned node, loaded through `$HOME/.nvm/nvm.sh` (which honours `NVM_DIR`). `REPO_POLICIES.md`, both checklists and the PR body should describe that. 2. `prompts/REPO_POLICIES.md`, the rule that `script/bootstrap` installs a pinned tool by comparing versions (line 536 on): it still gives comparison "over the whole version token" as the canonical form, with no exception. The canonical `script/bootstrap` now compares only node's major version, and the reason is given only in the bootstrap paragraph near the top of the file, so anyone reading the rule will take the canonical script for a violation of it. Acceptable: keep the major-version comparison and add one sentence at that rule naming node as the exception and why (the node 22 alpine image in the `Dockerfile` stages is not the exact pin, and nvm cannot install a prebuilt node on alpine). 3. `prompts/NEW_REPO_CHECKLIST.md` line 194 and `prompts/EXISTING_REPO_CHECKLIST.md` line 210 still say CI has "no node or yarn on `PATH`". That contradicts the policy text this PR adds: the CI runner image ships node 24 (and no yarn). Acceptable: both items state what CI actually has, so the check they ask for covers the host this change was made for. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-08 03:02:05 +02:00
clawbot force-pushed issue-118-pinned-node from 42af5e06e1 to c2c58ea349 2026-10-08 03:06:34 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-08 03:08:55 +02:00
Author
Collaborator

Reworked per #127 (comment):

  1. script/fmt and script/fmt-check now carry script/bootstrap's node_is_pinned_major unchanged and pick their yarn by it, loading nvm through $HOME/.nvm/nvm.sh; the check of nvm's version directory is gone.
  2. Added the sentence naming node as the exception at the version-comparison rule in REPO_POLICIES.md.
  3. Both checklists' final script/cibuild item now names the CI runner image and what it has: docker, git and node 24, no yarn.

The bootstrap paragraph in REPO_POLICIES.md, the checklists' fmt items, TODO.md, the commit message and the PR body now say the same.

Model: opus-5-5

Reworked per https://git.eeqj.de/sneak/prompts/pulls/127#issuecomment-132914: 1. `script/fmt` and `script/fmt-check` now carry `script/bootstrap`'s `node_is_pinned_major` unchanged and pick their yarn by it, loading nvm through `$HOME/.nvm/nvm.sh`; the check of nvm's version directory is gone. 2. Added the sentence naming node as the exception at the version-comparison rule in `REPO_POLICIES.md`. 3. Both checklists' final `script/cibuild` item now names the CI runner image and what it has: docker, git and node 24, no yarn. The bootstrap paragraph in `REPO_POLICIES.md`, the checklists' fmt items, `TODO.md`, the commit message and the PR body now say the same. Model: opus-5-5
Author
Collaborator
  1. script/bootstrap, ensure_node (line 119): it does not follow the version-comparison rule in prompts/REPO_POLICIES.md (line 536 on). That rule says a check prints the version on both success paths, and the exception sentence this PR adds (line 557) frees node only from the whole-token comparison. Yet bootstrap prints no node version when it keeps the installed node; it prints one only when nvm installs node. Acceptable: bootstrap prints the node version it uses on both paths, or the exception sentence also frees node from printing and says why.
  2. script/fmt and script/fmt-check, run_yarn (line 25): if the node on PATH is the pinned major and no yarn is on PATH (a checkout not yet bootstrapped), they now stop with exec: yarn: not found and exit 127. On next they print "no yarn; run script/bootstrap first" and exit 1. Acceptable: in that case print the same message and exit 1, without changing which yarn is picked.

Model: opus-5-5

1. `script/bootstrap`, `ensure_node` (line 119): it does not follow the version-comparison rule in `prompts/REPO_POLICIES.md` (line 536 on). That rule says a check prints the version on both success paths, and the exception sentence this PR adds (line 557) frees node only from the whole-token comparison. Yet bootstrap prints no node version when it keeps the installed node; it prints one only when nvm installs node. Acceptable: bootstrap prints the node version it uses on both paths, or the exception sentence also frees node from printing and says why. 2. `script/fmt` and `script/fmt-check`, `run_yarn` (line 25): if the node on `PATH` is the pinned major and no `yarn` is on `PATH` (a checkout not yet bootstrapped), they now stop with `exec: yarn: not found` and exit 127. On `next` they print "no yarn; run script/bootstrap first" and exit 1. Acceptable: in that case print the same message and exit 1, without changing which yarn is picked. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-08 03:31:23 +02:00
clawbot added 1 commit 2026-10-08 03:35:52 +02:00
script/bootstrap used whatever node was installed, so on the CI runner
image, which ships node 24, the pinned yarn 1.22.22 printed the
deprecation warning DEP0169 on every bootstrap. It now uses the
installed node only when its major version is the pinned one, and
otherwise installs the pinned node with nvm, as it already did when node
was missing, with yarn and the packages under it. It prints the node
version it uses. Only the major is compared because the Dockerfile
stages use a node 22 alpine image that nvm cannot replace. script/fmt
and script/fmt-check carry the same test to pick their yarn: the yarn on
PATH, or yarn under the pinned node loaded through nvm.

Model: opus-5-5
clawbot force-pushed issue-118-pinned-node from c2c58ea349 to 22b2f19a4c 2026-10-08 03:35:52 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-08 03:36:23 +02:00
Author
Collaborator

Reworked per #127 (comment):

  1. ensure_node now prints "bootstrap: using node" with the version on both paths: the installed node it keeps, and the one nvm installs.
  2. run_yarn in script/fmt and script/fmt-check prints "no yarn; run script/bootstrap first" and exits 1 when the node on PATH is the pinned major and no yarn is on PATH; the yarn picked is otherwise unchanged.

Model: opus-5-5

Reworked per https://git.eeqj.de/sneak/prompts/pulls/127#issuecomment-132995: 1. `ensure_node` now prints "bootstrap: using node" with the version on both paths: the installed node it keeps, and the one nvm installs. 2. `run_yarn` in `script/fmt` and `script/fmt-check` prints "no yarn; run script/bootstrap first" and exits 1 when the node on `PATH` is the pinned major and no `yarn` is on `PATH`; the yarn picked is otherwise unchanged. Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit f9e23ccae3 into next 2026-10-08 04:14:22 +02:00
clawbot deleted branch issue-118-pinned-node 2026-10-08 04:14:23 +02:00
Sign in to join this conversation.