script/bootstrap keeps any yarn it finds on PATH; the policy says compare versions, never test presence #154

Open
opened 2026-10-14 16:08:48 +02:00 by clawbot · 2 comments
Collaborator

script/bootstrap lines 169 to 185 (ensure_yarn), at v1.0.0-rc1: if ! missing yarn; then return 0; fi. The pin YARN_VERSION="1.22.22" (line 34) is applied only when no yarn is on PATH; on a host that has any yarn, whatever its version, bootstrap keeps it and never prepares 1.22.22. A host with yarn 2 or newer then runs yarn install --frozen-lockfile against the v1 lockfile and fails; a host with another 1.x runs a version the repo never chose. ensure_yarn and ensure_node (lines 159 to 164) also neither look the tool up again through PATH after installing nor print the version they end up with, as ensure_go (lines 250 to 258) does.

How to see it: on a host with, say, yarn 1.22.19 on PATH, run make bootstrap; yarn --version afterwards still says 1.22.19.

What is right: REPO_POLICIES.md lines 503 to 521: "script/bootstrap installs a pinned tool by comparing versions, never by testing presence. An if ! command -v <tool>; then install; fi guard tests PATH only, so on an already-provisioned machine the pin is inert ... and prints the version on both success paths." The org model script/bootstrap carries the same presence guard for yarn (and for node, where this repo already compares a minimum version), so the fix may belong in sneak/prompts as well; ensure_go in this repo shows the canonical shape.

Severity: low. The CI runner has no yarn, and the lockfile is pinned by hash.

Definition of done

  • ensure_yarn compares yarn --version with YARN_VERSION over the whole version token and installs (through corepack, linked into ~/.local/bin) unless it matches; afterwards it re-resolves yarn through PATH, fails naming the path if that is not the pinned one, and prints the version on both paths; ensure_node prints the version it uses.
  • Checked on a host with a different yarn on PATH (a throwaway container is enough): bootstrap ends with yarn --version reporting 1.22.22.
  • If the org model is to change too, a note on sneak/prompts#78 or a PR there.
  • TODO.md updated in the same commit; commit title ends (closes #N) with this issue's number.

Model: fable-5-1

`script/bootstrap` lines 169 to 185 (`ensure_yarn`), at `v1.0.0-rc1`: `if ! missing yarn; then return 0; fi`. The pin `YARN_VERSION="1.22.22"` (line 34) is applied only when no `yarn` is on `PATH`; on a host that has any yarn, whatever its version, bootstrap keeps it and never prepares 1.22.22. A host with yarn 2 or newer then runs `yarn install --frozen-lockfile` against the v1 lockfile and fails; a host with another 1.x runs a version the repo never chose. `ensure_yarn` and `ensure_node` (lines 159 to 164) also neither look the tool up again through `PATH` after installing nor print the version they end up with, as `ensure_go` (lines 250 to 258) does. **How to see it**: on a host with, say, yarn 1.22.19 on `PATH`, run `make bootstrap`; `yarn --version` afterwards still says 1.22.19. **What is right**: `REPO_POLICIES.md` lines 503 to 521: "`script/bootstrap` installs a pinned tool by comparing versions, never by testing presence. An `if ! command -v <tool>; then install; fi` guard tests `PATH` only, so on an already-provisioned machine the pin is inert ... and prints the version on both success paths." The org model `script/bootstrap` carries the same presence guard for yarn (and for node, where this repo already compares a minimum version), so the fix may belong in `sneak/prompts` as well; `ensure_go` in this repo shows the canonical shape. **Severity**: low. The CI runner has no yarn, and the lockfile is pinned by hash. ## Definition of done - [ ] `ensure_yarn` compares `yarn --version` with `YARN_VERSION` over the whole version token and installs (through corepack, linked into `~/.local/bin`) unless it matches; afterwards it re-resolves `yarn` through `PATH`, fails naming the path if that is not the pinned one, and prints the version on both paths; `ensure_node` prints the version it uses. - [ ] Checked on a host with a different yarn on `PATH` (a throwaway container is enough): bootstrap ends with `yarn --version` reporting 1.22.22. - [ ] If the org model is to change too, a note on https://git.eeqj.de/sneak/prompts/issues/78 or a PR there. - [ ] `TODO.md` updated in the same commit; commit title ends ` (closes #N)` with this issue's number. Model: fable-5-1
clawbot self-assigned this 2026-10-14 16:08:48 +02:00
Author
Collaborator

Plan: as the definition of done says. ensure_yarn compares yarn --version with YARN_VERSION over the whole version, installs through corepack unless they match, looks yarn up again through PATH afterwards, fails naming the path if that is not the pinned one, and prints the version on both paths, as ensure_go does; ensure_node prints the version it uses. Checked once in a throwaway container with another yarn on PATH. The canonical script/bootstrap in sneak/prompts has the same presence test for yarn, so the worker notes it on sneak/prompts#78.

Model: opus-5-5

Plan: as the definition of done says. `ensure_yarn` compares `yarn --version` with `YARN_VERSION` over the whole version, installs through corepack unless they match, looks `yarn` up again through `PATH` afterwards, fails naming the path if that is not the pinned one, and prints the version on both paths, as `ensure_go` does; `ensure_node` prints the version it uses. Checked once in a throwaway container with another yarn on `PATH`. The canonical `script/bootstrap` in sneak/prompts has the same presence test for yarn, so the worker notes it on https://git.eeqj.de/sneak/prompts/issues/78. Model: opus-5-5
Author
Collaborator

Plan addition: the REPO_POLICIES.md re-vendored in #171 asks that node be used only when its major version is the pinned one, and that script/fmt and script/fmt-check use the same test. This issue's PR also makes ensure_node, script/fmt and script/fmt-check follow it, as the sneak/prompts copies at 0653579 do. Starts after #171 is merged.

Model: opus-5-5

Plan addition: the `REPO_POLICIES.md` re-vendored in https://git.eeqj.de/sneak/netwatch/pulls/171 asks that node be used only when its major version is the pinned one, and that `script/fmt` and `script/fmt-check` use the same test. This issue's PR also makes `ensure_node`, `script/fmt` and `script/fmt-check` follow it, as the sneak/prompts copies at `0653579` do. Starts after https://git.eeqj.de/sneak/netwatch/pulls/171 is merged. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/netwatch#154