Skip to content

The catalog names each model's class #332

Closed

Description

@V3RON

Part of #326.

Scope

After this PR the catalog says, for every model whose tooling reports one, which class it is: phone, tablet, watch, tv, vision, auto or desktop. simlock catalog lists models under their class, and a gateway's catalog carries the union over its workers. Nothing about leasing changes.

Technical spec

File and line references are to main at 82fd554. ADR 0015 §3 is the rule.

Modules touched

  • src/contract/schemas.ts: deviceClassSchema, a z.enum of the seven names, and its DeviceClass type, beside platformSchema (:22). platformCatalogSchema (:445-493) gains required modelClasses: z.record(z.string().max(CATALOG_NAME_MAX), deviceClassSchema).
  • src/contract/protocol.ts (:47): raise the range by one, with its history line.
  • src/core/driver.ts (DriverCatalogEntry, :143-151): required modelClasses. The core carries it and reads nothing from it in this task.
  • src/drivers/ios/index.ts: DeviceType (:258-265) gains productFamily: string | undefined; parseDeviceType (:1998-2011) reads it. listCatalog (:1267-1283) maps iPhone, iPad, Apple Watch, Apple TV and Apple Vision to their class and lists no entry for any other family. The mapping is one table in this module.
  • src/drivers/android/device-profile-source.ts: AvdmanagerDeviceProfile (:217-222) gains tag; parseAvdmanagerDeviceProfiles (:228-262) reads the Tag : line. The builtin variant of DeviceProfile (:19-32) gains deviceClass; the properties variant (a devices.xml profile) is phone. DeviceProfileRegistry.catalog() (:89-115) returns modelClasses keyed by the listed name. The tag table is one table in this module: android-tv is tv, android-wear is watch, every android-automotive* tag is auto, android-desktop is desktop, no tag is phone, and any other tag lists no entry. src/drivers/android/index.ts (listCatalog, :1164-1181) passes it through.
  • src/core/fake-driver.ts (listCatalog, :508) and e2e/fake-driver/fake-driver.ts (:465) with e2e/fake-driver/types.ts: the script's modelClasses, {} when unset.
  • src/gateway/aggregate.ts: CatalogBucket (:212-225) and addCatalogEntry (:244-266) collect modelClasses; renderPlatform (:315-357) emits the union. When two workers class one model differently, the first worker in id order wins.
  • src/gateway/test-support.ts (catalogFixture, :109-122): modelClasses defaults to {}.
  • src/cli/index.ts (formatCatalog, :2365-2400): models grouped under a line per class, in the order of the enum, then a (no class) group; each model line keeps its pairings and other names. src/mcp/server.ts (:147): the list_devices description names modelClasses.
  • Docs: docs/CLI.md (simlock catalog, :1223), docs/HTTP-API.md (GET /v1/catalog, :252), docs/CLIENT.md (getCatalog, :234), docs/internal/ARCHITECTURE.md (aggregated reads, :821).

Contract and event changes

  • catalog.get output gains required modelClasses on every platform entry. Protocol version as above.
  • No event changes.

Rules in play

  • ADR 0015 §3. ADR 0008 §1, §3 and §4.
  • architecture.md rule 1: the class names live in the contract and the core; which family or tag is which class lives in the driver that reads it.
  • documentation.md: the catalog sections of the four end-user docs change with this PR.
  • testing.md rules 1 to 3.

Tests

  • The iOS catalog classes a device type by its product family: iPhone is phone, iPad is tablet, Apple Watch is watch, Apple TV is tv, Apple Vision is vision.
  • A device type with no product family, or one outside those five, stays in models and has no modelClasses entry.
  • The Android catalog classes a profile by its tag: android-tv is tv, android-wear is watch, android-automotive, android-automotive-playstore and android-automotive-distantdisplay are auto, android-desktop is desktop.
  • An untagged avdmanager profile and a devices.xml profile are phone.
  • parseAvdmanagerDeviceProfiles keeps the Tag : line of the entry it belongs to and reads none before the first id:.
  • platformCatalogSchema rejects an entry without modelClasses and one whose class is not one of the seven.
  • The gateway catalog's modelClasses is the union over connected workers, and a name two workers class differently keeps the class of the first worker in id order.
  • simlock catalog prints each model under its class and an unclassed model under (no class); --json carries modelClasses as received.
  • The fake driver's catalog carries the script's modelClasses.

Done when

  • Every test above passes and pnpm check is green.
  • The catalog assertions in src/gateway/aggregate.test.ts (:331 on), src/http/app.test.ts (:216-260) and the CLI catalog cases (src/cli/index.test.ts, :1881 on) are extended to the new field, not loosened.
  • On a Mac with Xcode installed: simlock catalog lists iPhone 17 under phone and Apple Watch Series 11 (46mm) under watch. On a machine with the Android SDK: Pixel 8 is under phone and Television (1080p) under tv.

Out of scope

  • A default model per class: the next task.
  • Reading a class in a lease request.

Depends on

Approval

  • Approved for delivery

Written by an agent.

Activity

  1. added
    task:draft
    on Oct 4, 2026
  2. added
    task:ready
    and removed
    task:draft
    on Oct 4, 2026
  3. github-actions commented on Oct 4, 2026

    @github-actions
    Contributor

    Now task:ready: approved, technical spec present.

  4. self-assigned this
    on Oct 5, 2026
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