refactor/pool: modernize the seed cache index script, node: imports and top-level await #79

Merged
pti merged 2 commits from refactor/pool-seed-script-esm into main 2026-10-19 16:17:35 +02:00
Owner

Closes #69, part of the SonarQube cleanup in #73. The embedded seed_cache_index script becomes an ES module, seed_cache_index.mjs, so the top-level promise chain Sonar flagged as javascript S7785 turns into a plain top-level await inside try and catch, with the same exit codes and stderr output as before. The four requires use the node: scheme for S7772, and npm's CommonJS cacache is loaded through createRequire since ESM has no bare require. realize.go follows the rename in its go:embed directive, scratch filename and comments, as do the two tests that name the file and one design doc. For S4036, npm is still resolved through PATH on purpose: Guix ships node and npm as separate store items, so there is no fixed absolute path, and the script only runs inside the wraptool-constructed guix or OCI backend. A comment above findCacache records that reasoning so the finding can be marked accepted on the server. The real node and npm integration test TestIntegration_ShrinkwrapSeeding executed the script end to end and passed along with all gates. 🤖 Generated with Claude Code

Closes #69, part of the SonarQube cleanup in #73. The embedded seed_cache_index script becomes an ES module, seed_cache_index.mjs, so the top-level promise chain Sonar flagged as javascript S7785 turns into a plain top-level await inside try and catch, with the same exit codes and stderr output as before. The four requires use the node: scheme for S7772, and npm's CommonJS cacache is loaded through createRequire since ESM has no bare require. realize.go follows the rename in its go:embed directive, scratch filename and comments, as do the two tests that name the file and one design doc. For S4036, npm is still resolved through PATH on purpose: Guix ships node and npm as separate store items, so there is no fixed absolute path, and the script only runs inside the wraptool-constructed guix or OCI backend. A comment above findCacache records that reasoning so the finding can be marked accepted on the server. The real node and npm integration test TestIntegration_ShrinkwrapSeeding executed the script end to end and passed along with all gates. 🤖 Generated with Claude Code
Closes #69.

S4036: kept PATH resolution of npm (documented in the script; node and npm live in separate Guix store items, and the backend env is wraptool-constructed).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
docs(design): follow the seed script rename to .mjs
All checks were successful
Lint / lint (pull_request) Successful in 1m24s
Lint / sonarqube (pull_request) Has been skipped
901bcbad53
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
pti merged commit 10677d6d0d into main 2026-10-19 16:17:35 +02:00
pti deleted branch refactor/pool-seed-script-esm 2026-10-19 16:17:35 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pti/wraptool!79
No description provided.