test: guard tests from killing the live dashboard port

Adds a static pretest check and a runtime vitest-setup wrapper that block
shell/process calls matching `kill|pkill|killall|fuser|lsof ... <port>` or
`.listen(<port>)` against reserved Fusion ports. Reserved set is dynamic:
default 4040 plus $PORT, $FUSION_SERVER_PORT, $FUSION_RESERVED_PORTS, and any
port responding to /api/health on 4040..4045 at worker startup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-23 19:51:36 -07:00
parent 7cfda7434b
commit a6a57dc40a
8 changed files with 281 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
// port-4040-allowlist: this file embeds the "never kill port 4040" rule in the executor prompt.
import { exec, execSync } from "node:child_process";
import { promisify } from "node:util";

View File

@@ -1,3 +1,4 @@
// port-4040-allowlist: this file embeds the "never kill port 4040" rule in the reviewer prompt.
/**
* Reviewer — spawns a separate pi agent to review a worker's plan or code.
*