Patch: Process Supervisor Hardening & Logging Cleanup
Fixes
- Downgrade HTTP request/response logging from INFO to DEBUG — eliminates noisy per-request log spam from the viewer UI polling
- Fix
isPidAlive(0)returning true — PID 0 is the kernel scheduler, not a valid child process - Fix signal handler race condition — added
shutdownInitiatedflag to prevent duplicate shutdown cascades when signals arrive beforestopPromiseis set - Remove unused
dataDirparameter fromShutdownCascadeOptions - Export and reuse env sanitizer constants —
Server.tsnow importsENV_PREFIXES/ENV_EXACT_MATCHESfromenv-sanitizer.tsinstead of duplicating them - Rename
zombiePidFilestodeadProcessPids— now returns actual PID array instead of a boolean - Use
buildWorkerUrlhelper inworkerHttpRequestinstead of inline URL construction - Remove unused
getWorkerPortimports from observation and session-init handlers - Upgrade
reapSessionfailure log from debug to warn level - Clean up
.gitignore— remove stale~*/,http*/,https*/patterns and duplicatedatasets/entry
Tests
- Rewrote supervisor index tests to use temp directories instead of relying on real
~/.claude-mem/worker.pid - Added deterministic test cases for missing, invalid, stale, and alive PID file states
- Removed unused
dataDirfrom shutdown test fixtures