Repository navigation
Description
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]
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;
assessandcan-servestay unchanged. - src/contract/AGENTS.md: the shape change bumps the protocol by one in this PR;
minstays. - documentation rule 9:
routing.mdxandruntimes-and-images.mdxchange 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.geton a worker: set →defaultImageTagon 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);
assessanswers the same with and without the field. - B8:
simlock catalog --platform android: set → theDefault image tagline after the Runtimes line; unset → none;--jsoncarries 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:changedpasses, 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.mjspasses.PROTOCOL_VERSION_RANGE.maxis one above Android leases that name no image tag get the worker's android.defaultImageTag where it fits #1595's, andminis unchanged.routing.mdxsays a gateway ranks a tagless Android lease by each worker's default tag.runtimes-and-images.mdxshows the catalog'sDefault image tagline and when a gateway prints it.
Out of scope
- Counting only the host CPU's images in the gateway (an accepted gap of Android leases that name no image tag can get a Play Store emulator #1590).
Depends on
Written by an agent.
Activity
test: the gateway's merged Android entry names the default image tag …
feat(gateway): the merged Android catalog entry names the default ima…
test: a tagless Android lease ranks by the worker's default image tag (…
feat(gateway): a tagless Android request is warm on a ready device wi…
test: simlock catalog prints the Android default image tag after the …
feat(cli): simlock catalog prints the default image tag when the entr…
docs: routing and runtimes-and-images describe the default image tag …
test(gateway): a baseline-naming Android request ranks without the de…
fix(gateway): a tagless Android request ranks by the default tag on t…
fix(gateway): the default image tag counts only images built for the …
V3RON commentedon Nov 16, 2026
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, androuting.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 thathostAbiOfmaps 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.
test(gateway): the default image tag's host-CPU newest level, a non-a…
docs(adr): 0078 is Accepted (#1596)
feat(leasing): an Android worker tries its default image tag first (#…
feat(catalog): a worker's catalog names its default image tag and a g…
feat(leasing): a worker serves only enrolled devices on a platform wh…