fix(Scripts): harden simulator ownership - #288
Open
kyleve wants to merge 6 commits into
Open
Conversation
kyleve
commented
Aug 17, 2026
| Resolution.new(action: "create", udid: nil) | ||
| end | ||
|
|
||
| def deletion_target(name:, checkout:, device:, os:, runtime_key:, all:) |
Owner
Author
There was a problem hiding this comment.
Posted by an AI agent on kve's behalf.
Review focus: this is the destructive-operation boundary. A derived name is deliberately insufficient; deletion requires the registry entry plus exact checkout, device, OS, runtime, and UDID identity. A stale claim beside a same-named replacement is a refusal, not an ownership transfer.
kyleve
force-pushed
the
codex/harden-simulator-ownership
branch
2 times, most recently
from
August 19, 2026 02:58
2e86799 to
55eab38
Compare
kyleve
force-pushed
the
codex/harden-simulator-ownership
branch
from
August 19, 2026 03:22
5c14c7b to
db023c8
Compare
kyleve
force-pushed
the
codex/harden-simulator-ownership
branch
from
August 19, 2026 03:49
db023c8 to
48de4de
Compare
kyleve
force-pushed
the
codex/harden-simulator-ownership
branch
from
August 19, 2026 04:07
2c7657c to
0a3d86a
Compare
kyleve
force-pushed
the
codex/harden-simulator-ownership
branch
2 times, most recently
from
August 19, 2026 04:14
ab66b06 to
c885558
Compare
kyleve
force-pushed
the
codex/harden-simulator-ownership
branch
from
August 19, 2026 04:20
c885558 to
176709f
Compare
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.
Summary
simctlauthoritative for live statelockfWhy
Name-derived devices are useful for discovery but are insufficient proof of ownership. A duplicate name on another runtime, stale claim, or concurrent first resolution must never authorize deletion or create twin devices.
Design decisions
xcrun simctlorchestration and live boot output/usr/bin/lockfowns concurrency; kernel release after process death eliminates stale owner files, PID reuse, and directory-takeover racesCompatibility
Public flags, defaults, stdout/stderr conventions, and exit codes remain stable. Existing plain-text registry entries are validated and rewritten atomically.
Adversarial coverage
--delete/--recreate; mutation-free--prune --dry-runTesting
./simulator --no-bootand./simulator --listagainst real CoreSimulator./test StuffCoreTestsStack
Third PR; based on #284.