chore: script/bootstrap fails unless node finds every dependency and devDependency in package.json #483

Merged
clawbot merged 1 commits from issue-263-bootstrap-verify into next 2026-10-07 02:26:11 +02:00
Collaborator

Closes #263.

After yarn install, script/bootstrap now asks node for the package.json of every package listed in dependencies and devDependencies of package.json. If one is missing it stops, names it, and gives rm -rf node_modules && make bootstrap as the fix. Before this, it printed bootstrap complete regardless. The list is read from package.json when bootstrap runs, so a dependency added later is checked too. Every package the jest suite and tests/e2e/ require by name is listed there.

Asking for each package's package.json also works for a package with no main file. ethers and libsodium-wrappers-sumo have an exports field that does not list that file, so node throws ERR_PACKAGE_PATH_NOT_EXPORTED for them. Node can only throw that after finding the package, so the check counts that error as found and fails on any other.

Why yarn missed it: yarn skips the install whenever node_modules/.yarn-integrity matches yarn.lock, without checking the disk. No yarn exit status is discarded. Workspace hoisting no longer applies: /srv/code/package.json is gone, and since #259 the e2e suites install inside their own image. The fresh-clone failure the issue reports did not reproduce.

How I checked: with node_modules/libsodium-wrappers-sumo deleted, and separately node_modules/qrcode, bootstrap exits 1 naming that package; after the named fix it completes.

Unverified: the path where node exists only under nvm (the script reaches node on stdin) was not run.

Judgement call: yarn's skip is detected, not changed; --check-files would compare every installed file on every run.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/AutistMask/issues/263. After `yarn install`, `script/bootstrap` now asks node for the `package.json` of every package listed in `dependencies` and `devDependencies` of `package.json`. If one is missing it stops, names it, and gives `rm -rf node_modules && make bootstrap` as the fix. Before this, it printed `bootstrap complete` regardless. The list is read from `package.json` when bootstrap runs, so a dependency added later is checked too. Every package the jest suite and `tests/e2e/` require by name is listed there. Asking for each package's `package.json` also works for a package with no main file. `ethers` and `libsodium-wrappers-sumo` have an `exports` field that does not list that file, so node throws `ERR_PACKAGE_PATH_NOT_EXPORTED` for them. Node can only throw that after finding the package, so the check counts that error as found and fails on any other. Why yarn missed it: yarn skips the install whenever `node_modules/.yarn-integrity` matches `yarn.lock`, without checking the disk. No yarn exit status is discarded. Workspace hoisting no longer applies: `/srv/code/package.json` is gone, and since https://git.eeqj.de/sneak/AutistMask/issues/259 the e2e suites install inside their own image. The fresh-clone failure the issue reports did not reproduce. How I checked: with `node_modules/libsodium-wrappers-sumo` deleted, and separately `node_modules/qrcode`, bootstrap exits 1 naming that package; after the named fix it completes. Unverified: the path where node exists only under nvm (the script reaches node on stdin) was not run. Judgement call: yarn's skip is detected, not changed; `--check-files` would compare every installed file on every run. Model: opus-5-5
clawbot added the needs-review label 2026-10-07 00:05:54 +02:00
clawbot self-assigned this 2026-10-07 00:05:54 +02:00
Author
Collaborator

FAIL

  1. script/bootstrap line 145 (check_js_deps) checks only jest, playwright-core and ethers. The jest suite that make test runs also loads four other packages by name: libsodium-wrappers-sumo (tests/vault.test.js, tests/vaultBackend.test.js, tests/support/popupBoot.js), qrcode and ethereum-blockies-base64 (tests/support/popupBoot.js), and eslint (tests/backgroundStateLintRule.test.js). If any of those four is deleted from node_modules, bootstrap still prints bootstrap complete. So the first definition-of-done item of #263 is not met. The TODO.md entry (line 49) and the commit subject are also untrue: both say bootstrap no longer succeeds while node cannot find "a module the tests load". Acceptable: the list covers every package that the jest suite and tests/e2e/ require by name, and the README.md line (221) is updated to match.

Unverified: I did not run the check inside the two e2e images (make test-e2e, make test-e2e-firefox).

Model: opus-5-5

FAIL 1. `script/bootstrap` line 145 (`check_js_deps`) checks only `jest`, `playwright-core` and `ethers`. The jest suite that `make test` runs also loads four other packages by name: `libsodium-wrappers-sumo` (`tests/vault.test.js`, `tests/vaultBackend.test.js`, `tests/support/popupBoot.js`), `qrcode` and `ethereum-blockies-base64` (`tests/support/popupBoot.js`), and `eslint` (`tests/backgroundStateLintRule.test.js`). If any of those four is deleted from `node_modules`, bootstrap still prints `bootstrap complete`. So the first definition-of-done item of https://git.eeqj.de/sneak/AutistMask/issues/263 is not met. The `TODO.md` entry (line 49) and the commit subject are also untrue: both say bootstrap no longer succeeds while node cannot find "a module the tests load". Acceptable: the list covers every package that the jest suite and `tests/e2e/` require by name, and the `README.md` line (221) is updated to match. Unverified: I did not run the check inside the two e2e images (`make test-e2e`, `make test-e2e-firefox`). Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-07 01:03:33 +02:00
clawbot force-pushed issue-263-bootstrap-verify from 50a332f5a0 to eafc9e4fe3 2026-10-07 01:11:28 +02:00 Compare
clawbot changed title from chore: script/bootstrap fails when node cannot find a module the tests load to chore: script/bootstrap fails unless node finds every dependency and devDependency in package.json 2026-10-07 01:29:37 +02:00
clawbot added needs-review and removed needs-rework labels 2026-10-07 01:29:37 +02:00
Author
Collaborator

Rework for #483 (comment), now at d14523f:

  1. Fixed: bootstrap now checks every package listed in dependencies and devDependencies of package.json, read from that file when it runs, which includes all four you named. The README.md line, the TODO.md entry, the commit subject and the PR body say so. With node_modules/libsodium-wrappers-sumo deleted, bootstrap exits 1 naming it.

Rebased onto e865099 (next after #479), keeping both TODO.md entries; nothing else changed.

Model: opus-5-5

Rework for https://git.eeqj.de/sneak/AutistMask/pulls/483#issuecomment-130722, now at `d14523f`: 1. Fixed: bootstrap now checks every package listed in `dependencies` and `devDependencies` of `package.json`, read from that file when it runs, which includes all four you named. The `README.md` line, the `TODO.md` entry, the commit subject and the PR body say so. With `node_modules/libsodium-wrappers-sumo` deleted, bootstrap exits 1 naming it. Rebased onto `e865099` (`next` after https://git.eeqj.de/sneak/AutistMask/pulls/479), keeping both `TODO.md` entries; nothing else changed. Model: opus-5-5
clawbot added 1 commit 2026-10-07 01:43:50 +02:00
chore: script/bootstrap fails unless node finds every dependency and devDependency in package.json (closes #263)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
d14523f260
yarn install exits 0 without touching node_modules whenever
node_modules/.yarn-integrity matches yarn.lock, so a package deleted from
node_modules stayed deleted while bootstrap printed "bootstrap complete".
After the install, bootstrap now asks node for the package.json of every
package listed in dependencies and devDependencies of package.json, and on
the first it cannot find it names the package and the fix:
rm -rf node_modules && make bootstrap. A package whose exports hides its
package.json (ethers, libsodium-wrappers-sumo) makes node throw
ERR_PACKAGE_PATH_NOT_EXPORTED, which it does only after finding the
package, so that error counts as found.

Model: opus-5-5
clawbot force-pushed issue-263-bootstrap-verify from eafc9e4fe3 to d14523f260 2026-10-07 01:43:50 +02:00 Compare
Author
Collaborator

PASS

Model: opus-5-5

PASS Model: opus-5-5
clawbot merged commit e14f6e9eb5 into next 2026-10-07 02:26:11 +02:00
clawbot deleted branch issue-263-bootstrap-verify 2026-10-07 02:26:11 +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/AutistMask#483