Repository navigation
Description
Part of #1836.
Scope
An operator can reset one platform with simlock nuke [--delete-devices] --platform <ios|android>, leaving the other platform's held leases, devices, seeds, baselines and learned kinds in place. An iOS lease whose seed simulator was deleted by hand is granted on a new seed, and simlock doctor names such a seed. The device-set refusal message points at the platform nuke.
If it goes wrong, an operator who meant to reset iOS loses Android emulators or seeds, or an iOS lease still fails after a seed was deleted by hand.
Technical spec
Commit 200afe5.
Rows
Behaviours: B1, B2, B3, B4, B5, B6, B7
Stored state: S1, S2
Interfaces: I1, I2, I3, I4, I5
Existing code: X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14
Facts
| # | Fact | Source |
|---|---|---|
| F1 | Every protocol bump moves both ends: the range is { min: 102, max: 102 }. |
src/contract/protocol.ts:13 |
| F2 | commandArgs turns a parseArgs error into a UsageError with its message, so a missing --platform value prints node's own text. |
src/cli/args.ts:12-21 |
| F3 | A learned baseline kind is a warm_kinds row with a non-empty baseline column. |
src/core/warm-pool/learned.ts:28-38 |
| F4 | Existing tests that hold the device-set refusal text: index-device-set.test.ts. |
rg -l "device-set-changed" src --include=*.test.ts |
Modules touched
Searches: rg "nuke\(|runNuke|nukeRun|releaseAllDuringMaintenance|removeAll\(|forget\(\)|SWITCH_STEPS|findReadySeed|sourceStaleReason" src.
flowchart LR
cli[cli nuke] --> client[simlock-client] --> contract[contract nuke.run] --> daemon[daemon dispatcher-admin]
daemon --> core[core Nuke / NukeService / baselines / warm pool]
core --> leasing[leasing release coordinator]
core --> ios[drivers/ios seeds + device-set-leftovers]
Rules in play
docs/internal/agent-rules/safety.mdrule 1 (registry-only destruction): a gone seed's row is dropped with nosimctlcall; a platform nuke destroys only registry records and seed rows of that platform, never an orphan.src/contract/AGENTS.mdprotocol version:nuke.runinput changes shape, soPROTOCOL_VERSION_RANGEmoves min and max by one in this PR.docs/internal/agent-rules/documentation.mdrule 9: the pages in I5 change in this PR.- ADR 0061 §1: nuke deletes seeds and never an orphan source; holds per platform.
Tests
The seams are createHarness (src/leasing/test-create-leasing.ts, model src/leasing/create-leasing-rejections.test.ts) for B1 to B3, the CLI command with a fake client for B4, and the iOS driver with fake simctl and filesystem (model src/drivers/ios/index-seed-provision.test.ts, index-seed-sources.test.ts, index-device-set.test.ts) for B5 to B7. The whole-machine nuke stays proven by src/core/nuke-service.test.ts and src/core/nuke.test.ts.
- B1: an operator runs a platform nuke: iOS with an iOS and an Android lease held (Android lease and device stay); Android mirror; an iOS physical lease ends and the device stays enrolled; a waiting Android request is cancelled
killedby an iOS nuke; the report lists only the platform'sdeletedDevicesandreleasedLeaseIds(Nuke.run, modelled onsrc/core/nuke.test.ts, with an Android device deleted by another path during the nuke left out). - B2: a platform nuke with
--delete-devicesdeletes only that platform's seeds and baselines: iOS; Android mirror; without--delete-devicesnothing is deleted; an orphan iOS source stays. - B3: a platform nuke forgets only that platform's learned kinds: iOS kinds gone, Android kinds kept; an iOS baseline kind gone.
- B4:
simlock nuke --platform:ios,android,windows,iOS, missing value, absent (noplatformsent), prompt text with and without a platform,--helpline. - B5: an iOS lease of a kind whose seed simulator is gone: folder present (cloned, no make); deleted by hand (remade); sources set folder missing (remade); two provisions at once (one make).
- B6: doctor lists a gone source: seed gone; baseline gone (baseline stale); both present (no reason); runtime missing and gone (runtime reason wins); a lease naming a baseline whose simulator is gone is refused
source <id> is stale: its simulator is gone; save it again(the B6 baseline reason), with no clone (decided in delivery, pending the maintainer). - B7: the device-set refusal names
simlock nuke --delete-devices --platform ios: own set; default sources set; Xcode's set.
Done when
pnpm test:changedandpnpm typecheckpass.simlock nuke --helpprintsUsage: simlock nuke [--delete-devices] [--platform <ios|android>] [--yes].- The website build passes:
pnpm --dir website install && pnpm --dir website build && node website/scripts/check-openapi.mjs.
Out of scope
The parent's Non-goals: a seeds-only command, an automatic device-set migration, platform scope for doctor --purge-orphans or cleanup, an Android seed folder deleted by hand, and nuke through a gateway.
Depends on
- Core settles quick seeds in the background, one at a time, when the worker is quiet #1746
- iOS: a quick seed is replaced by its settled copy, and each plain lease counts against its seed #1747
- simlock seed makes and settles a kind's seed on a worker #1749
- Warm pool: wait warmPool.refillDelayMs after a lease grant before refilling #1838
Written by an agent.
Activity
test: a platform nuke ends a physical lease, keeps the device and can…
test: a platform nuke with --delete-devices deletes only that platfor…
feat(nuke): a platform nuke deletes only its platform's seeds and bas…
test: a platform nuke forgets only that platform's learned kinds (#1842)
feat(nuke): a platform nuke forgets only its platform's learned kinds (…
test: simlock nuke --platform sends the platform, refuses bad values …
feat(nuke): simlock nuke --platform reaches the daemon (#1842)
test: an iOS lease of a kind whose seed simulator is gone is granted …
feat(ios): a lease of a kind whose seed simulator was deleted by hand…
test: doctor lists a source whose simulator is gone as stale (#1842)
feat(ios): doctor lists a source whose simulator is gone as stale (#1842
test: the device-set refusal names simlock nuke --delete-devices --pl…
feat(ios): the device-set refusal points at the iOS platform nuke (#1842
docs(nuke): the platform nuke and a seed deleted by hand (#1842)
docs(ios): keep the iOS manual under its size cap (#1842)
refactor(ios): split the stale-reason check so Fallow's complexity ga…
test: a platform nuke leaves an idle device and a lease row of the ot…
test(ios): a baseline whose simulator is gone is refused as stale, wi…
fix: nuke --platform and gone-simulator reasons match the spec text, …
feat(nuke): simlock nuke --platform resets one platform (callstackinc…