v10.5.6

thedotmack/claude-memv10.5.6Mar 16, 2026by thedotmack

AI Summary

This patch release (v10.5.6) focuses on process supervisor hardening and logging cleanup, fixing several bugs related to PID handling, signal handler race conditions, and removing noisy debug logging from the viewer UI polling.

Key Highlights

  • Fixed `isPidAlive(0)` returning true - PID 0 is the kernel scheduler, not a valid child process
  • Fixed signal handler race condition by adding `shutdownInitiated` flag to prevent duplicate shutdown cascades
  • Downgraded HTTP request/response logging from INFO to DEBUG to eliminate viewer UI polling log spam
  • Renamed `zombiePidFiles` to `deadProcessPids` - now returns actual PID array instead of boolean
  • Refactored supervisor tests to use temp directories instead of relying on real `~/.claude-mem/worker.pid`

Breaking Changes

  • Removed unused `dataDir` parameter from `ShutdownCascadeOptions` (may affect external consumers)
  • Renamed `zombiePidFiles` to `deadProcessPids` (API change for consumers using this function)

Full Release Notes

## 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 `shutdownInitiated` flag to prevent duplicate shutdown cascades when signals arrive before `stopPromise` is set
- **Remove unused `dataDir` parameter** from `ShutdownCascadeOptions`
- **Export and reuse env sanitizer constants** — `Server.ts` now imports `ENV_PREFIXES`/`ENV_EXACT_MATCHES` from `env-sanitizer.ts` instead of duplicating them
- **Rename `zombiePidFiles` to `deadProcessPids`** — now returns actual PID array instead of a boolean
- **Use `buildWorkerUrl` helper** in `workerHttpRequest` instead of inline URL construction
- **Remove unused `getWorkerPort` imports** from observation and session-init handlers
- **Upgrade `reapSession` failure log** from debug to warn level
- **Clean up `.gitignore`** — remove stale `~*/`, `http*/`, `https*/` patterns and duplicate `datasets/` 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 `dataDir` from shutdown test fixtures