feat(boot): let an unscoped boot pick the newest of several shut-down devices

Merged
KR
4d ago
+561-42

Summary

boot --platform ios fails with AMBIGUOUS_MATCH on any Mac with several iPhone simulators, which includes every stock Xcode install. Closes #4041.

boot --pick newest is an explicit opt-in. It decides only when every equally preferred local match is shut down: mobile over TV, then the newest OS version, then the name. Booted ties, provider devices and other commands still refuse, so #1880's guarantee holds. A selection record (reason newest-bootable-local) and the CLI output report the pick, and an ambiguous boot now suggests the opt-in.

agent-device boot --platform ios --pick newest   # SDK: devices.boot({ platform: 'ios', pick: 'newest' })
→ Boot ready: iPhone 17 (ios), picked by --pick newest from 3 matching devices

A second commit ranks iPads by appleOs rather than by name, so a renamed iPad no longer ties with iPhones. 28 files changed.

Validation

  • check:affected --run --head daf6f912d (66 checks): everything passes except 3 timing tests (daemon-client, Android fill) under load. Those pass 64/64 when run alone, and main shows the same daemon-client errors on this host. 9 unreached checks (docs, wire-compat, flags) pass when run directly.
  • Review round 167663c5a: lint, typecheck, focused tests (device-selection, boot handler, commands, MCP), and the mcp-metadata, command-docs, docs, wire-compat and progress-model gates all pass.
  • Each new test fails with its fix removed.
  • Live on macOS 26.5 / Xcode 26.6 with a private set (iPhone 17 Pro, iPhone 17, iPad Pro):
    • plain boot refuses;
    • --pick newest boots iPhone 17;
    • two booted devices still refuse.
  • A renamed-iPad set fails at main 144bd5989 and passes here.

Changes made by Claude Opus 5.5 running in Claude Code (T3 Code).