Skip to content

A worker's catalog names its default image tag, and a gateway ranks and shows it #1596

Closed

Description

@V3RON

Part of #1590.

Scope

A worker's Android catalog names its default image tag. A gateway uses it to rank workers by the warm devices a tagless Android lease would really get. simlock catalog prints the default, and through a gateway it prints it only when every Android worker reports the same one.

If this goes wrong, a user would notice tagless Android leases through a gateway going to a worker with no warm device while another had one, or simlock catalog showing a default that isn't set or hiding one that is.

Technical spec

Commit 5e639b4.

Rows

  • Behaviours: B6, B7, B8, B11
  • Interfaces: I4, I6
  • Existing code: X10, X11, X12, X13, X14, X19, X20

Facts

# Fact Source
F1 The iOS entry already gets defaultMode added in the worker's catalogGet handler; the Android entry passes through as built src/daemon/dispatcher-status.ts:14-23
F2 The merged catalog keeps a default only when every worker agrees, today for defaultRuntime src/gateway/aggregate.ts:365-366,410
F3 simlock catalog prints Runtimes: ... (default: ...) as the second line of each platform block src/cli/commands/catalog.ts:70-72
F4 The client parses every catalog.get answer through the output schema before the renderer sees it src/simlock-client/client-impl.ts:550-569

Modules touched

Searches: rg -n "defaultMode|defaultRuntime|agreedDefault|pairedRuntimesOf|deviceFit|formatCatalog" src -g '!*.test.ts'.

flowchart LR
  contract[contract platform catalog schema] --> daemon[daemon catalog.get]
  contract --> gateway[gateway aggregate and routing]
  contract --> cli[cli catalog]
  docs[website routing and runtimes pages]
Loading

Rules in play

  • ADR 0078 §3: the catalog carries the default; the gateway reads it per worker; the merged entry only on agreement.
  • ADR 0009 / gateway routing manual: stages read the view and the request only; assess and can-serve stay unchanged.
  • src/contract/AGENTS.md: the shape change bumps the protocol by one in this PR; min stays.
  • documentation rule 9: routing.mdx and runtimes-and-images.mdx change with the surface.

Tests

Seam: the worker dispatcher's catalog.get (model on src/daemon/dispatcher-leases-device-mode.test.ts), gateway routing over views (model on src/gateway/routing/stages/warm-hit.test.ts), the gateway merge (model on src/gateway/aggregate-catalog.test.ts), and the CLI (model on src/cli/index-catalog-components.test.ts).

  • B6: catalog.get on a worker: set → defaultImageTag on the Android entry only; unset → none; the field passes the schema and is bounded like an image tag.
  • B7: gateway ranking of a tagless Android lease: the worker with a ready tagged Pixel 9 on 36 wins over free capacity; an untagged 37 device on a defaulting worker is no warm hit; a worker without the field ranks as today; a tagged request ranks as today; a request that names a baseline ranks as today (decided in delivery, pending the maintainer); assess answers the same with and without the field.
  • B8: simlock catalog --platform android: set → the Default image tag line after the Runtimes line; unset → none; --json carries the field only when set.
  • B11: the gateway's merged Android entry: two workers agreeing → the field; one with and one without → none; two different tags → none; one worker → the field; no Android worker → no Android entry.

Done when

  • pnpm test:changed passes, with the B6, B7, B8 and B11 tests among the tests it runs.
  • pnpm --dir website install && pnpm --dir website build && node website/scripts/check-openapi.mjs passes.
  • PROTOCOL_VERSION_RANGE.max is one above Android leases that name no image tag get the worker's android.defaultImageTag where it fits #1595's, and min is unchanged.
  • routing.mdx says a gateway ranks a tagless Android lease by each worker's default tag. runtimes-and-images.mdx shows the catalog's Default image tag line and when a gateway prints it.

Out of scope

Depends on

Written by an agent.

Activity

  1. added
    task:draft
    platform:android
    on Nov 16, 2026
  2. added
    task:ready
    and removed
    task:draft
    on Nov 16, 2026
  3. self-assigned this
    on Nov 16, 2026
  4. V3RON commented on Nov 16, 2026

    @V3RON
    ContributorAuthor

    Handoff

    Done: PR #1615 (task/1596, head e5d03cc) is at the top of the #1590 stack (#1591 → #1609 → #1616 → #1615). B6, B7, B8 and B11 are built. Review fixed R1 to R4: the fallback when no model has the default tag, the API level, host-CPU images only, and routing.mdx. The B7 baseline case was decided in delivery and is pending you.

    Not done: the Done when checklist. The PR is a draft.

    Findings: R5 (code, raised at the fix-check) is open. Nothing tests that the newest level is taken from host-CPU images (request-match.ts:95), or that hostAbiOf maps a non-arm64 host (request-match.ts:135). Breaking either keeps all 25 warm-hit tests green. Note: R3's host-CPU counting is listed under #1596's Out of scope.

    Blocked on: the review round cap (rule 14). You decide whether R5 needs a fix run and whether host-CPU counting stays in scope. The stack merges only after that.

    Written by an agent.

  5. added
    task:blocked
    and removed
    task:ready
    on Nov 16, 2026
  6. removed their assignment
    on Nov 16, 2026
  7. added
    task:ready
    and removed
    task:blocked
    on Nov 16, 2026
  8. assigned and unassigned on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform:androidtask:ready

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions