Problem
On macOS, a sandbox that refuses execution of setuid tools can prevent Stim from inspecting its own collector processes. Cleanup safely refuses to signal an unverified collector, but cannot finish even when the collector belongs to the workspace.
Evidence
src/process-args.ts reads commands and start times through ps. A synthetic child-process probe under a macOS sandbox returns no command/start identity when /bin/ps cannot execute. A read-only native probe using proc_pidinfo(PROC_PIDTBSDINFO) and sysctl(KERN_PROCARGS2) can inspect the same child under that policy.
Cause
Process ownership currently depends on executing ps, rather than using the non-privileged native process APIs available to a same-user process. collector/ownership.ts correctly treats failed inspection as unverified.
Fix idea
Add a bounded macOS native inspection path with exact argument boundaries and stable start-time validation. Preserve fail-closed ownership, PID-reuse checks, and existing behavior on other platforms. Verify live, exited, zombie, denied, malformed, and changed-identity cases, plus real sandboxed collector cleanup. Package the helper reproducibly without requiring a global installation or weakening the sandbox.
Problem
On macOS, a sandbox that refuses execution of setuid tools can prevent Stim from inspecting its own collector processes. Cleanup safely refuses to signal an unverified collector, but cannot finish even when the collector belongs to the workspace.
Evidence
src/process-args.tsreads commands and start times throughps. A synthetic child-process probe under a macOS sandbox returns no command/start identity when/bin/pscannot execute. A read-only native probe usingproc_pidinfo(PROC_PIDTBSDINFO)andsysctl(KERN_PROCARGS2)can inspect the same child under that policy.Cause
Process ownership currently depends on executing
ps, rather than using the non-privileged native process APIs available to a same-user process.collector/ownership.tscorrectly treats failed inspection as unverified.Fix idea
Add a bounded macOS native inspection path with exact argument boundaries and stable start-time validation. Preserve fail-closed ownership, PID-reuse checks, and existing behavior on other platforms. Verify live, exited, zombie, denied, malformed, and changed-identity cases, plus real sandboxed collector cleanup. Package the helper reproducibly without requiring a global installation or weakening the sandbox.