Repository navigation
Description
Part of #1588.
Scope
Through a gateway, a lease without --physical on a platform that only phones-only workers have gets the same clear refusal as on the worker itself. In a mixed fleet it goes to a worker that still makes simulators or emulators, and a --physical lease still reaches the phones-only worker. simlock catalog through the gateway says virtual devices are off for a platform only when every worker reporting it says so.
A user would notice: a plain lease through the gateway that waits or names the wrong fix, a --physical lease no longer routed to a phones-only worker, or a gateway catalog that says "off" while some worker still serves emulators.
Technical spec
Commit 5e639b4.
Rows
Behaviours: B8, B9
Interfaces: I3; uses I1, I4, I5, I7
Existing code: X11, X12, X13, X17 (the gateway routing page)
Facts
| # | Fact | Source |
|---|---|---|
| F1 | assessLeading checks, in order: no taker, NO_DRIVER, the physical branch, UNKNOWN_MODEL "listed by any worker in the fleet", RUNTIME_MISSING; I3 goes after NO_DRIVER and is checked for a plain request before the generic model row |
src/gateway/routing/serviceability.ts:197-235 |
| F2 | can-serve and assess must give the same reason (the routing manual); a phones-only worker's empty entry already makes can-serve answer unknown-model, so can-serve needs no change |
src/gateway/routing/AGENTS.md (Serviceability), src/gateway/routing/stages/can-serve.ts:4-14 |
| F3 | The merged catalog entry is built by addCatalogEntry and renderPlatform; #1596 changes the same bucket and the same routing page first |
src/gateway/aggregate.ts:247-275, :365-375; #1596 F2 |
Modules touched
src/gateway/routing/serviceability.ts, src/gateway/aggregate.ts, src/gateway/routing/AGENTS.md, and the website page gateway/routing.mdx. Searches: assessLeading, unknownModel(, addCatalogEntry, renderPlatform, virtualDevices.
Rules in play
- ADR 0084 §3: the gateway refuses with the phones-only message only when every known worker that has the platform reports
virtualDevices: false. - ADR 0009 §4: the first check that applies wins; I3 sits after
NO_DRIVER. src/gateway/routing/AGENTS.md: stages andassessread views only, no I/O.- Documentation rule 9: the gateway routing page changes in this PR.
Tests
Seam: assess and select over fake worker views (model: src/gateway/routing/serviceability.test.ts), the gateway dispatcher with fake links for the end-to-end case, and aggregateCatalog (model: src/gateway/aggregate-catalog.test.ts).
- B8: a plain lease through a gateway: one phones-only worker (I3, its message word for word:
Every worker with android serves only enrolled physical android devices (android.virtualDevices is false); ask for a physical device (--physical, or physical: true), not the worker'sThis worker serves only…; decided in delivery, pending the maintainer); phones-only plus an emulator worker (routed to the emulator worker); phones-only plus a worker without the field (routed to the second); one worker without the field and no models (today'sUNKNOWN_MODEL);--physicalto the phones-only worker (granted) - B9: the merged catalog: two phones-only workers (
virtualDevices: false); one phones-only and one emulator worker (field absent, the emulator worker's lists)
Done when
pnpm test:changedpasses, with every Tests line above as a test.pnpm checkpasses.- The website build passes:
pnpm --dir website install && pnpm --dir website build && node website/scripts/check-openapi.mjs.
Out of scope
- The worker side (the key, the refusal, the catalog field): A worker serves only enrolled devices on a platform whose virtualDevices is false #1598.
Depends on
- A worker serves only enrolled devices on a platform whose virtualDevices is false #1598
- A worker's catalog names its default image tag, and a gateway ranks and shows it #1596
Written by an agent.
Activity
test: the gateway catalog says virtualDevices false only when every w…
feat(gateway): the merged catalog says virtualDevices false only when…
fix(gateway): the gateway's phones-only refusal reads as I3 words it;…
docs(gateway): the phones-only references name ADR 0084 (#1599)
docs(gateway): the routing manual drops the phones-only line the code…
docs(adr): 0084 is Accepted (#1599)
refactor(gateway): the catalog bucket's names and empty start are the…
feat(gateway): a phones-only platform through a gateway (#1657)