# Change 2 — Add `"desktop"` DeviceType > **DRAFT.** Conforms to `_GROUND-TRUTH.md`. ## VERDICT: already done. This change is a NO-OP against current source. The brief assumed `"desktop"` was missing from `DeviceType` and that the type "likely" lives in `src/shared/types.ts`. **Both assumptions are wrong against the ground-truth source:** 1. `DeviceType` is defined in **`src/shared/sync-types.ts:11`**, not `types.ts` (`types.ts` has no `DeviceType` symbol). `chirp-handshake.ts:29` and `paired-devices.ts:23` both import device types from `./sync-types`. 2. `"desktop"` is **already a member**: ```ts // src/shared/sync-types.ts:11 export type DeviceType = "extension" | "android" | "ios" | "desktop"; ``` 3. The full desktop plumbing already exists: - `DEVICE_TYPE_DESKTOP = 0x04` chirp byte tag (`sync-types.ts:19`) - `DeviceTypeByte` includes it (`sync-types.ts:25`) - `deviceTypeFromByte(0x04) → "desktop"` (`sync-types.ts:36`) - `deviceTypeToByte("desktop") → 0x04` (`sync-types.ts:45`) - `chirp-payload.ts` accepts byte `0x04` on the wire (`chirp-payload.ts:5,89`) 4. peach-sync announces exactly this string: `.device_type = "desktop"` (`peach-sync/src/pairing.zig:177`), which lands on the existing union member. **No edit to the type union is required.** If a downstream pass "adds" it again it will be a redundant no-op. --- ## What ACTUALLY needs verifying: the storage gate (`paired-devices.ts`) The real question is whether the paired-device registry rejects a `"desktop"` device. **It does not — there is no enum gate.** `upsertPairedDevice` (`src/background/paired-devices.ts:56-70`) validates only *presence*, never membership against the `DeviceType` union: ```ts // paired-devices.ts:60 if (!device.deviceType) throw new Error("device.deviceType is required"); ``` It checks the field is truthy, not that it equals a known literal. `"desktop"` (or any non-empty string) passes. Storage round-trips it verbatim (`isPairedDevice`, `paired-devices.ts:174-180`, only checks `deviceId` is a non-empty string and `pairedAt` is a number — `deviceType` is not gated). `PairedDevice.deviceType` is `DeviceType | undefined` (`sync-types.ts:89`), so `"desktop"` is statically valid; nothing to extend. ### Conclusion / action for implementer - **No code change for Change 2.** Optionally, add a regression test asserting a `"desktop"` device upserts and round-trips through `paired-devices.ts` (kept minimal; the registry already supports it). - If the brief's reviewer insists on a literal "edit", the only honest one is a doc/comment — there is no missing union member and no gate to widen. ## Discrepancy summary (for the report) - Brief said: add `"desktop"` to `DeviceType` in `src/shared/types.ts`. - Source truth: `"desktop"` already present in `src/shared/sync-types.ts:11`; `types.ts` is the wrong file; the storage layer already accepts it. **Change is unnecessary.**