9488950a9d
/simplify-code efficiency reviewer (verified): cleanup_stale=False does NOT deliver the exclusion the salvaged fix intended — get_running_pid returns None whenever a record fails liveness VALIDATION (start-time mismatch, argv drift, lock hiccup) regardless of the flag, which only controls unlinking. In exactly the at-risk scenario the recorded PID still never joined the exclusion set. Exclusion evidence now comes from the RAW pidfile + lock records (no validation, no unlink side effects); the validated non-destructive probe is kept for the runtime-status fallback PID. For a KILL exclusion list this is strictly safer: a stale recorded PID at worst spares one process for one sweep, while a validation false-negative would TerminateProcess a live gateway. Regression test reworked to drive the real function semantics (raw record present, validation rejects); mutation-checked: removing the raw-record read fails the test.