Skip to content

nuke --platform resets one platform; a gone iOS seed is made again and doctor names it #1842

Done

Description

@V3RON

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]
Loading

Rules in play

  • docs/internal/agent-rules/safety.md rule 1 (registry-only destruction): a gone seed's row is dropped with no simctl call; a platform nuke destroys only registry records and seed rows of that platform, never an orphan.
  • src/contract/AGENTS.md protocol version: nuke.run input changes shape, so PROTOCOL_VERSION_RANGE moves min and max by one in this PR.
  • docs/internal/agent-rules/documentation.md rule 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 killed by an iOS nuke; the report lists only the platform's deletedDevices and releasedLeaseIds (Nuke.run, modelled on src/core/nuke.test.ts, with an Android device deleted by another path during the nuke left out).
  • B2: a platform nuke with --delete-devices deletes only that platform's seeds and baselines: iOS; Android mirror; without --delete-devices nothing 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 (no platform sent), prompt text with and without a platform, --help line.
  • 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:changed and pnpm typecheck pass.
  • simlock nuke --help prints Usage: 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

Written by an agent.

Activity

  1. added
    task:draft
    on Nov 25, 2026
  2. added
    task:ready
    and removed
    task:draft
    on Nov 25, 2026
  3. self-assigned this
    on Nov 25, 2026
  4. added 19 commits that reference this issue on Nov 25, 2026
  5. added a commit that references this issue on Nov 25, 2026
    50caa3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

task:ready

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions