push gate: assemble-payload's pnpm build dies on interactive modules purge under no TTY — harden the gate #389

Closed
opened 2026-08-10 05:14:27 +00:00 by ben · 1 comment
Owner

What happened

2026-08-10 ~02:40 UTC the shared pre-receive push gate (go test ./...) went RED for every swarm push on an environmental defect, parking #382 mid-slice (its comment 5295):

  • internal/vm's TestAssemblePayload_ProducesResolvableLayout runs scripts/assemble-payload.sh → cd dashboard && pnpm build.
  • pnpm 11's verify-deps-before-run decided the modules directory was stale and auto-triggered an install, which aborted with ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY ("Aborted removal of modules directory due to no TTY") — an interactive purge prompt inside a TTY-less test harness.
  • It cleared environmentally within the hour (swarm pushes resumed by 03:38, f48233c), but nothing repo-side prevents recurrence: there is no workspace .npmrc, and the test hard-fails (internal/vm/assemble_test.go:81) with no guard.

Any future pnpm/node_modules drift on the build machines re-blocks the whole swarm the same way.

Fix (repo-side hardening)

Make the gate's pnpm invocation non-interactive so it can never stall on a purge prompt:

  • Add a workspace .npmrc (repo root, picked up by pnpm) with confirm-modules-purge=false — this is the setting pnpm's error message names for exactly this abort.
  • Belt-and-braces: export CI=true around the pnpm build in scripts/assemble-payload.sh (line 88) so pnpm takes its non-interactive paths under the harness regardless of the caller's environment.

(verify-deps-before-run=false is deliberately not proposed — silently building against stale deps trades a loud red for a wrong artifact; fail-loud discipline wins.)

Acceptance

  • Given a stale/drifted node_modules, when TestAssemblePayload_ProducesResolvableLayout runs assemble-payload.sh in a TTY-less harness, then pnpm either completes the install-and-build or fails loudly on the real error — never on an interactive purge prompt
  • Given a clean checkout, when the gate runs, then behaviour is unchanged (gate stays green)
## What happened 2026-08-10 ~02:40 UTC the shared pre-receive push gate (`go test ./...`) went RED for **every** swarm push on an environmental defect, parking #382 mid-slice (its comment 5295): - `internal/vm`'s `TestAssemblePayload_ProducesResolvableLayout` runs `scripts/assemble-payload.sh` → `cd dashboard && pnpm build`. - pnpm 11's `verify-deps-before-run` decided the modules directory was stale and auto-triggered an install, which aborted with `ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY` ("Aborted removal of modules directory due to no TTY") — an **interactive purge prompt** inside a TTY-less test harness. - It cleared environmentally within the hour (swarm pushes resumed by 03:38, `f48233c`), but **nothing repo-side prevents recurrence**: there is no workspace `.npmrc`, and the test hard-fails (`internal/vm/assemble_test.go:81`) with no guard. Any future pnpm/node_modules drift on the build machines re-blocks the whole swarm the same way. ## Fix (repo-side hardening) Make the gate's pnpm invocation non-interactive so it can never stall on a purge prompt: - Add a workspace `.npmrc` (repo root, picked up by pnpm) with `confirm-modules-purge=false` — this is the setting pnpm's error message names for exactly this abort. - Belt-and-braces: export `CI=true` around the `pnpm build` in `scripts/assemble-payload.sh` (line 88) so pnpm takes its non-interactive paths under the harness regardless of the caller's environment. (`verify-deps-before-run=false` is deliberately **not** proposed — silently building against stale deps trades a loud red for a wrong artifact; fail-loud discipline wins.) ## Acceptance - [ ] Given a stale/drifted `node_modules`, when `TestAssemblePayload_ProducesResolvableLayout` runs `assemble-payload.sh` in a TTY-less harness, then pnpm either completes the install-and-build or fails loudly on the real error — never on an interactive purge prompt - [ ] Given a clean checkout, when the gate runs, then behaviour is unchanged (gate stays green)
ben closed this issue 2026-08-10 05:23:32 +00:00
Author
Owner

Fixed in 1c2375b6b9 (on origin/main).

Hardened the push gate so its dashboard build can never stall on pnpm 11's interactive modules-purge prompt:

  • Added a workspace .npmrc at the repo root (the pnpm workspace root, so it is read even when pnpm runs in dashboard/) with confirm-modules-purge=false — the exact setting pnpm's ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY message names.
  • scripts/assemble-payload.sh now runs the dashboard build as CI=true pnpm build (belt-and-braces) so pnpm takes its non-interactive paths regardless of the caller's environment.

verify-deps-before-run deliberately left ON (fail-loud on stale deps, not a wrong artifact).

Acceptance:

  • Clause 1 (stale/drifted node_modules, TTY-less harness): pnpm now completes install-and-build or fails loudly on the real error — never on the interactive purge prompt.
  • Clause 2 (clean checkout, gate unchanged): TestAssemblePayload_ProducesResolvableLayout (which runs the real pnpm build) stays GREEN, and the pre-push go test ./... gate passed on push.

Guard test added: internal/vm/assemble_test.go TestAssemblePayload_DashboardBuildIsNonInteractive locks both measures against silent regression.

Fixed in 1c2375b6b99cd04d904ec72d771eecdc3409331f (on origin/main). Hardened the push gate so its dashboard build can never stall on pnpm 11's interactive modules-purge prompt: - Added a workspace `.npmrc` at the repo root (the pnpm workspace root, so it is read even when pnpm runs in `dashboard/`) with `confirm-modules-purge=false` — the exact setting pnpm's `ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY` message names. - `scripts/assemble-payload.sh` now runs the dashboard build as `CI=true pnpm build` (belt-and-braces) so pnpm takes its non-interactive paths regardless of the caller's environment. `verify-deps-before-run` deliberately left ON (fail-loud on stale deps, not a wrong artifact). Acceptance: - Clause 1 (stale/drifted node_modules, TTY-less harness): pnpm now completes install-and-build or fails loudly on the real error — never on the interactive purge prompt. - Clause 2 (clean checkout, gate unchanged): `TestAssemblePayload_ProducesResolvableLayout` (which runs the real `pnpm build`) stays GREEN, and the pre-push `go test ./...` gate passed on push. Guard test added: `internal/vm/assemble_test.go` `TestAssemblePayload_DashboardBuildIsNonInteractive` locks both measures against silent regression.
Sign in to join this conversation.
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
Matou/idss#389
No description provided.