refactor(daemon): own the boot/shutdown device-status response in one place

Merged
TH
1mo ago
+112-97

Summary

No behavior change. Cleans up three leftovers from the session-state split (#3455–#3458, #3472):

  • packages/contracts/src/device.ts: the BootCommandResult and ShutdownCommandResult doc comments cited the retired session-appstate.ts; each now names its owning handler and the shared builder that owns the literal (session-boot.ts / session-shutdown.ts via session-device-status-response.ts).
  • The bootedDeviceResponse builders duplicated in session-boot.ts and session-shutdown.ts become one owner, deviceStatusReportResponse in session-device-status-response.ts — it answers "what does this device report on the wire after a readiness command": public identity fields plus the command's status field (booted / shutdown) and the gated additive appleOs. Wire key order is unchanged and pinned by test.
  • The boot, shutdown, and appstate pass-through wrappers in session.ts are deleted; the dispatch table maps straight to the handlers, whose RuntimeCommandHandlerParams accept SessionCommandParams directly.

New module claimed by daemon-sessions in the daemon layer manifest (separate chore(gates) commit). 7 files, +112/−97 gross.

Validation

Tested at head 020bb45a0: pnpm exec tsc -b clean; pnpm check:affected --run passed on the head under the gate lock; pnpm exec vitest run scripts/__tests__/eager-closure-budgets.test.ts passed (838 tests); pnpm check:coverage-crap --base origin/main over a unit-core coverage run reports no touched function at or above 30. New session-device-status-response.test.ts is revert-sensitive: removing the platform gate turns the stray-appleOs negative test red, and swapping the status/appleOs spreads turns the pinned Object.keys wire order red — both observed, green again after restore. Boot/shutdown/appstate wire-shape tests pass unchanged. Cold-context review ran; its one finding (shared device fixtures) was adopted. Cubic P3s both fixed at 020bb45a0. Integration/Coverage lanes stay GitHub-owned.