fix: persist identities for Stim-owned processes - #487
Merged
Merged
Conversation
Collaborator
Author
|
Fresh review is clear on aed7aa8. The reclaim race is covered by real replacement-supervisor and replacement-collector tests; both their processes and device claims survive cleanup. Published unique-pid 0.1.1 is verified inside the actual Codex sandbox. All 3602 unit tests, 66 E2E tests, build, typecheck, lint, formatting, knip and runtime smoke pass. The full unit run uses maxWorkers=4 after a process-start handshake timed out at default concurrency. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Stim cleanup depends on
ps, which some agent sandboxes cannot execute. It also infers ownership from command names, directories, and ports. This change limits host-process cleanup to instances Stim launched and recorded. Agent-device is unchanged.Solution
Persist
unique-pid@0.1.1tokens for supervisors, collectors, and managed tunnels, and check the exact OS identity before signalling. Cleanup retains live records it cannot verify and leaves replacement processes and their devices alone. External Metro can still be reused but is left running;stop --forceis removed. Live legacy supervisor records require manual shutdown before reuse.Exact identities replace the wall-clock tolerance that protected collectors from clock skew, while retaining caller-group protection: only a recorded detached supervisor's group is signalled, with no inferred listener fallback.
Denied process inspection retains records; this does not bypass sandbox permissions. The published library's macOS sandbox fix permits capture without a boot ID while retaining the exact start timestamp. Without boot identity, a repeated PID and exact timestamp after a reboot or clock reset cannot be distinguished. Identity checks and signalling remain separate OS calls, not an atomic termination guarantee.
Test plan
npm_config_offline=true npm_config_yes=falseto prevent an unrelated fingerprint fixture's fallbacknpxlookup from waiting on package downloads.Fixes #477. Replaces #478.