fix(remote): speak one platform axis between a device and its bound connection (#2962)

Merged
TH
1mo ago
+1505-94

Summary

A proxy lease refused every iOS install and open: applyResolvedDeviceSelector wrote the device's internal apple platform into the request flags while the connection state recorded the public leaf ios, so assertRequestedConnectionScope saw two platforms and demanded connect --force. Android passed only because its internal and public names are both android.

A resolved device now projects onto the axis a connection already records it on (platform, target, deviceKey, leaseBackend) in resolveConnectionDeviceScope, inside the module that declares that record. Each rule it composes resolves at its owner: platformSelectorsConflict (kernel, also replacing connect's string-equality check and the daemon's request-lock copy), leaseBackendForPlatform, and the now-exported deviceIdentityFlag.

install_from_source compared --platform against the session device's internal platform and echoed the apple token back; it asks the device whether the selector names it.

Closes #2962

11 files, 172 net production lines. Three deferred sites are named in code comments and below; each differs from the shared rule in a way that is its own decision.

Validation

Commit c68540940. pnpm check:affected --run passed: 934 files / 8,172 tests, and wire compat reports the protocol unchanged. check:layering, lint, format, typecheck pass. 11 new tests, each mutation-verified (dropping the leaf write fails 3; reverting the conflict rule fails 3; narrowing the identity flag fails its own test).

No live device run: the repro needs a remote lease provider.

Deferred: limrun-profile.ts:66 backend copy, device-claim-conflict.ts:53 and device-selection-resolver.ts:242 flag copies, session-selector.ts:64.