Fix Windows background test-run signal coverage

Merged
UN
4mo ago
+244-23

Summary

Fixes #376.
Tracks pm-2kkl.

This PR stabilizes the Windows nightly failure where Vitest reported Worker forks emitted error / Worker exited unexpectedly after all assertions had passed. The missing full-nightly file was tests/unit/commands/test-runs-command.spec.ts; its child fixture was sending OS-level signals to process.ppid, which can target the Vitest fork worker on Windows.

Changes:

  • Update background test-run signal coverage to call process.emit("SIGTERM"/"SIGINT") from the test process after worker progress is observed, instead of having a child fixture send OS signals to the parent process.
  • Add tests/unit/commands/test-runs-command.spec.ts to the required Windows regression CI slice so this class is caught before nightly.
  • Keep MCP dynamic upgrade routing coverage dry-run only so the broad coverage gate stays network-free and deterministic.

Validation

  • pm test pm-2kkl --run --progress (3/3 linked tests passed)
  • node scripts/run-tests.mjs coverage -> 256 files, 5132 tests, 100/100/100/100
  • pnpm typecheck
  • pnpm quality:static
  • git diff --check
  • pnpm contracts:check
  • pm health --check-only --summary --json
  • pm validate --check-resolution --check-history-drift (history drift ok; existing closed-item resolution backfill warnings remain)
  • pnpm audit --audit-level low
  • pnpm changelog:pm:check with pm-changelog 2026.6.20
  • node dist/cli.js package doctor --project --detail deep --json
  • pnpm security:scan
  • node scripts/release/sentry-telemetry-gate.mjs --json --telemetry-mode best-effort (0 critical/high Sentry issues, telemetry ok)
  • Manual temp smoke using isolated PM_PATH/PM_GLOBAL_PATH and dist/cli.js: init, create, claim, update, comment, linked test, health, validate, close, release
  • pnpm release:gates (build, typecheck/static/docs, coverage 100/100/100/100, version policy, security scan, packed npx smoke, package-first dogfood)

Notes

GitHub issue #374 / auto release remains externally blocked because the release environment does not have RELEASE_PAT configured. That is not changed by this PR.