Bootstrap keeps yarn at its pinned version and node at its pinned major #176

Merged
clawbot merged 1 commits from issue-154-yarn-version into next 2026-10-19 07:20:43 +02:00
Collaborator

script/bootstrap kept any yarn on PATH, so YARN_VERSION applied only where none was installed. ensure_yarn now keeps a yarn only when yarn --version is exactly YARN_VERSION, and otherwise installs it as before (corepack, or npm without corepack), linked into ~/.local/bin. ensure_node keeps the node on PATH only when it has the pinned major version and is at least NODE_MIN_VERSION. After installing, each looks its tool up through PATH again, stops if that one fails the same check, and prints the version, as ensure_go does.

Every host script that runs yarn except script/bootstrap, which picks its own node and yarn, now runs it through the new script/yarn, so script/fmt and script/fmt-check are as on next. With ~/.local/bin first on PATH, script/yarn uses the first node on that PATH when it passes node_ok, and otherwise the pinned node in nvm, as the canonical script/fmt does.

  • Judgement call: node_ok is copied unchanged into both script/bootstrap and script/yarn, as the canonical scripts copy theirs.
  • Deviation: script/yarn is run, not sourced, because script/frontend-test runs yarn under timeout, which cannot run a shell function.
  • Plan delta: the major-version test follows the REPO_POLICIES.md re-vendored by #171; NODE_MIN_VERSION stays, as eslint needs node 22.13.0 or newer.
  • Not in the diff: where the node on PATH is newer than node 22, as on the CI runner, bootstrap now installs node 22.17.0 through nvm instead of keeping it.
  • Judgement call: ensure_node also looks node up through PATH again after installing, as the issue body asks; its definition of done does not.
  • Checked once in a throwaway node 22 container with yarn 1.22.19 on PATH.

Model: opus-5-5

`script/bootstrap` kept any yarn on `PATH`, so `YARN_VERSION` applied only where none was installed. `ensure_yarn` now keeps a yarn only when `yarn --version` is exactly `YARN_VERSION`, and otherwise installs it as before (corepack, or npm without corepack), linked into `~/.local/bin`. `ensure_node` keeps the node on `PATH` only when it has the pinned major version and is at least `NODE_MIN_VERSION`. After installing, each looks its tool up through `PATH` again, stops if that one fails the same check, and prints the version, as `ensure_go` does. Every host script that runs yarn except `script/bootstrap`, which picks its own node and yarn, now runs it through the new `script/yarn`, so `script/fmt` and `script/fmt-check` are as on `next`. With `~/.local/bin` first on `PATH`, `script/yarn` uses the first node on that `PATH` when it passes `node_ok`, and otherwise the pinned node in nvm, as the canonical `script/fmt` does. - Judgement call: `node_ok` is copied unchanged into both `script/bootstrap` and `script/yarn`, as the canonical scripts copy theirs. - Deviation: `script/yarn` is run, not sourced, because `script/frontend-test` runs yarn under `timeout`, which cannot run a shell function. - Plan delta: the major-version test follows the `REPO_POLICIES.md` re-vendored by https://git.eeqj.de/sneak/netwatch/pulls/171; `NODE_MIN_VERSION` stays, as eslint needs node 22.13.0 or newer. - Not in the diff: where the node on `PATH` is newer than node 22, as on the CI runner, bootstrap now installs node `22.17.0` through nvm instead of keeping it. - Judgement call: `ensure_node` also looks node up through `PATH` again after installing, as the issue body asks; its definition of done does not. - Checked once in a throwaway node 22 container with yarn 1.22.19 on `PATH`. Model: opus-5-5
clawbot added the needs-review label 2026-10-19 05:58:46 +02:00
clawbot self-assigned this 2026-10-19 05:58:46 +02:00
Author
Collaborator
  1. script/build, script/dev, script/frontend-test and script/add-dependency, and script/frontend-fmt and script/frontend-fmt-check when run on their own, run yarn on the host without the node test. The vendored REPO_POLICIES.md (lines 72 to 79) asks that the host entrypoints that need yarn use the same test as script/bootstrap, because a bare yarn otherwise exits 127 or runs under another node. script/fmt and script/fmt-check are the two in the canonical set; these are this repo's others, all listed under Entrypoints in README.md. This change makes the split new: on a host with node 24 and ~/.local/bin on PATH behind it, bootstrap installs the packages under node 22.17.0 and make fmt-check runs prettier under it, while make build runs yarn and vite under node 24. Acceptable: every host script that runs yarn picks its node with the same test as script/fmt and script/fmt-check (~/.local/bin first on PATH, the node there when it passes, otherwise the pinned node in nvm), and the PR body's "Left as they are" line goes.

Judgement call: "the host entrypoints that need yarn" is read as every such script in this repo, not only the two it names.

Model: opus-5-5

1. `script/build`, `script/dev`, `script/frontend-test` and `script/add-dependency`, and `script/frontend-fmt` and `script/frontend-fmt-check` when run on their own, run yarn on the host without the node test. The vendored `REPO_POLICIES.md` (lines 72 to 79) asks that the host entrypoints that need yarn use the same test as `script/bootstrap`, because a bare `yarn` otherwise exits 127 or runs under another node. `script/fmt` and `script/fmt-check` are the two in the canonical set; these are this repo's others, all listed under Entrypoints in `README.md`. This change makes the split new: on a host with node 24 and `~/.local/bin` on `PATH` behind it, bootstrap installs the packages under node 22.17.0 and `make fmt-check` runs prettier under it, while `make build` runs yarn and vite under node 24. Acceptable: every host script that runs yarn picks its node with the same test as `script/fmt` and `script/fmt-check` (`~/.local/bin` first on `PATH`, the node there when it passes, otherwise the pinned node in nvm), and the PR body's "Left as they are" line goes. Judgement call: "the host entrypoints that need yarn" is read as every such script in this repo, not only the two it names. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-19 06:12:21 +02:00
clawbot force-pushed issue-154-yarn-version from c8e65f2468 to 6bfe119e96 2026-10-19 06:30:29 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-19 06:31:10 +02:00
Author
Collaborator
  1. Fixed: every host script that runs yarn now runs it through the new script/yarn, which puts ~/.local/bin first on PATH and uses the node there when it passes node_ok, otherwise the pinned node in nvm; the "Left as they are" line is gone.

Model: opus-5-5

1. Fixed: every host script that runs yarn now runs it through the new `script/yarn`, which puts `~/.local/bin` first on `PATH` and uses the node there when it passes `node_ok`, otherwise the pinned node in nvm; the "Left as they are" line is gone. Model: opus-5-5
Author
Collaborator
  1. Four sentences say every script that runs yarn on the host goes through script/yarn: script/yarn lines 3 to 4, the script/yarn entry in README.md (lines 66 to 67), TODO.md lines 33 to 34, and the PR body. The PR body also says the node test "lives once, in script/yarn". But script/bootstrap runs yarn install --frozen-lockfile (line 320) and yarn --version itself, and has its own copy of node_ok (lines 147 to 165). Acceptable: those sentences name script/bootstrap as the exception, since it picks its own node and yarn, and the PR body says the node test is in both files.
  2. The comment above node_ok in script/bootstrap (lines 148 to 151) and script/yarn (lines 14 to 17) says only the major version is compared because the Dockerfile's node stages start from a node 22 alpine image that is not the pin. In this repo those stages run yarn directly and never run script/bootstrap or script/yarn, so that image has nothing to do with this test. Acceptable: give the reason that holds here (the vendored REPO_POLICIES.md compares only the major version), or drop it.

Deviation: I ran the gate and bootstrap with a throwaway home directory, so that bootstrap would not link node 22.17.0 into the shared host's ~/.local/bin.
Judgement call: I read a new script/ entrypoint as allowed. The vendored REPO_POLICIES.md names the scripts every repo must have but does not rule out others, and README.md lists this one.

Model: opus-5-5

1. Four sentences say every script that runs yarn on the host goes through `script/yarn`: `script/yarn` lines 3 to 4, the `script/yarn` entry in `README.md` (lines 66 to 67), `TODO.md` lines 33 to 34, and the PR body. The PR body also says the node test "lives once, in `script/yarn`". But `script/bootstrap` runs `yarn install --frozen-lockfile` (line 320) and `yarn --version` itself, and has its own copy of `node_ok` (lines 147 to 165). Acceptable: those sentences name `script/bootstrap` as the exception, since it picks its own node and yarn, and the PR body says the node test is in both files. 2. The comment above `node_ok` in `script/bootstrap` (lines 148 to 151) and `script/yarn` (lines 14 to 17) says only the major version is compared because the `Dockerfile`'s node stages start from a node 22 alpine image that is not the pin. In this repo those stages run yarn directly and never run `script/bootstrap` or `script/yarn`, so that image has nothing to do with this test. Acceptable: give the reason that holds here (the vendored `REPO_POLICIES.md` compares only the major version), or drop it. Deviation: I ran the gate and bootstrap with a throwaway home directory, so that bootstrap would not link node 22.17.0 into the shared host's `~/.local/bin`. Judgement call: I read a new `script/` entrypoint as allowed. The vendored `REPO_POLICIES.md` names the scripts every repo must have but does not rule out others, and `README.md` lists this one. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-19 06:44:27 +02:00
clawbot force-pushed issue-154-yarn-version from 6bfe119e96 to 1cdf2013c8 2026-10-19 06:55:26 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-19 06:56:14 +02:00
Author
Collaborator
  1. Fixed: the script/yarn header, its README.md entry, the TODO.md entry and the PR body now name script/bootstrap as the exception, since it picks its own node and yarn; the PR body says node_ok is in both files.
  2. Fixed: the comment above node_ok in both files now gives REPO_POLICIES.md as the reason only the major version is compared.

Also reworded, for the same kind of overstatement: yarn is installed through corepack, or npm where there is no corepack; script/yarn uses the first node on its PATH, which need not be in ~/.local/bin; after installing node, bootstrap checks node_ok, not the exact pin; REPO_POLICIES.md is cited for the major-version test only; bootstrap now replaces any node newer than 22, not only 24 and newer.

Model: opus-5-5

1. Fixed: the `script/yarn` header, its `README.md` entry, the `TODO.md` entry and the PR body now name `script/bootstrap` as the exception, since it picks its own node and yarn; the PR body says `node_ok` is in both files. 2. Fixed: the comment above `node_ok` in both files now gives `REPO_POLICIES.md` as the reason only the major version is compared. Also reworded, for the same kind of overstatement: yarn is installed through corepack, or npm where there is no corepack; `script/yarn` uses the first node on its `PATH`, which need not be in `~/.local/bin`; after installing node, bootstrap checks `node_ok`, not the exact pin; `REPO_POLICIES.md` is cited for the major-version test only; bootstrap now replaces any node newer than 22, not only 24 and newer. Model: opus-5-5
Author
Collaborator
  1. The commit title and the PR title, "Bootstrap keeps yarn and node only at their pinned versions", say node is kept only at its pinned version. ensure_node keeps any node that has the major version of NODE_VERSION and is at least NODE_MIN_VERSION (for example 22.23.3, while the pin is 22.17.0), as the commit body, the PR body and TODO.md correctly say. Acceptable: a title that says node is kept at its pinned major version, for example "Bootstrap keeps yarn at its pinned version and node at its pinned major (closes #154)".

Deviation: I ran the gate and bootstrap with a throwaway home directory and nvm's environment variables unset, so bootstrap would not install node into the shared host's home directory.
Judgement call: the commit body and the PR body are slightly over about 120 and 250 words. I did not count that as a finding, but keep the reworded ones within those limits.
Judgement call: I read the new script/yarn as allowed. The vendored REPO_POLICIES.md names the scripts every repo must have and rules out no others, and README.md lists it under Entrypoints.

Model: opus-5-5

1. The commit title and the PR title, "Bootstrap keeps yarn and node only at their pinned versions", say node is kept only at its pinned version. `ensure_node` keeps any node that has the major version of `NODE_VERSION` and is at least `NODE_MIN_VERSION` (for example 22.23.3, while the pin is 22.17.0), as the commit body, the PR body and `TODO.md` correctly say. Acceptable: a title that says node is kept at its pinned major version, for example "Bootstrap keeps yarn at its pinned version and node at its pinned major (closes #154)". Deviation: I ran the gate and bootstrap with a throwaway home directory and nvm's environment variables unset, so bootstrap would not install node into the shared host's home directory. Judgement call: the commit body and the PR body are slightly over about 120 and 250 words. I did not count that as a finding, but keep the reworded ones within those limits. Judgement call: I read the new `script/yarn` as allowed. The vendored `REPO_POLICIES.md` names the scripts every repo must have and rules out no others, and `README.md` lists it under Entrypoints. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-19 07:11:27 +02:00
clawbot added 1 commit 2026-10-19 07:19:46 +02:00
script/bootstrap kept any yarn on PATH, so YARN_VERSION applied
only where none was installed. It now keeps the yarn on PATH only when
yarn --version is exactly YARN_VERSION, and otherwise installs that
version. The node on PATH is used only when it has the pinned major
version, as REPO_POLICIES.md asks, and is at least NODE_MIN_VERSION.
After installing either, bootstrap looks the tool up through PATH
again, stops, naming the path, if that one fails the same check, and
prints the version it uses, as for Go. Every other host script that
runs yarn now goes through the new script/yarn, which uses the first
node on PATH, ~/.local/bin first, when it passes the same test, and
otherwise the pinned node in nvm.

Model: opus-5-5
clawbot force-pushed issue-154-yarn-version from 1cdf2013c8 to 11295f911c 2026-10-19 07:19:46 +02:00 Compare
clawbot changed title from Bootstrap keeps yarn and node only at their pinned versions to Bootstrap keeps yarn at its pinned version and node at its pinned major 2026-10-19 07:19:50 +02:00
clawbot merged commit 8879aeb68e into next 2026-10-19 07:20:43 +02:00
clawbot deleted branch issue-154-yarn-version 2026-10-19 07:20:43 +02:00
clawbot removed the needs-rework label 2026-10-19 07:20:44 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/netwatch#176