Skip to content

feat(gateway): a phones-only platform through a gateway - #1657

Merged
V3RON merged 13 commits into
task/1598from
task/1599
Nov 17, 2026
Merged

V3RON merged 13 commits into
task/1598from
task/1599

Conversation

@V3RON

@V3RON V3RON commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1599

Done when

  • pnpm test:changed passes, with every Tests line above as a test. — B8 src/gateway/fleet-routing-phones-only.test.ts (one phones-only worker, with an emulator worker, with a worker without the field, an iOS-only worker beside a phones-only Android worker, no models, --physical), B9 src/gateway/aggregate-catalog.test.ts (both orders); src/gateway 840/840 at ee4dc82; the only other failures are src/daemon/lease-files.test.ts and src/daemon/relay-gateway-files.e2e.test.ts, which the open flaky-test issue flaky: lease-files and relay-gateway-files tests answer 422 instead of 201 on a clean base #1613 names.
  • pnpm check passes. — the pre-push hooks (fallow, protocol-bump, docs-surface, typecheck) passed on every push, the last at f8f66bb; CI green at f8f66bb.
  • The website build passes: pnpm --dir website install && pnpm --dir website build && node website/scripts/check-openapi.mjs. — CI job build (.github/workflows/website.yml: install, pnpm build, node scripts/check-openapi.mjs) passed at f8f66bb.

Completion conditions (#1588)

Status

Implement: done Review: round 2 + fix-checks passed (R1–R3 fixed, R4 note) Hardware: n/a Gate: waiting for the stack
Next: ADR 0084 to Accepted on this branch, then the gate on this PR for the stack #1592 → #1623 → #1657

Assumptions

none

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 3 blocking, 3 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 1 notes.
Rounds: 2. Tokens: 4.4M.
Runs: 17. Cost USD: 3.7725. Agent seconds: 1687.
Assessment: complete

Written by an agent.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 3970728d-1c93-4151-97bd-184f77fb983f
Commits

Reviewing files that changed from the base of the PR and between 72baba7 and 38c89ce.

Files selected for processing: 7

  • docs/internal/adr/0084-a-worker-may-serve-a-platforms-enrolled-phones-only.md
  • docs/internal/adr/README.md
  • src/gateway/aggregate-catalog.test.ts
  • src/gateway/aggregate.ts
  • src/gateway/fleet-routing-phones-only.test.ts
  • src/gateway/routing/serviceability.ts
  • website/src/content/docs/docs/gateway/routing.mdx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@V3RON
V3RON added this pull request to stack #1625 November 17, 2026 10:47
@V3RON

V3RON commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

Question. What does a gateway say when it refuses a plain lease because every worker with the platform serves phones only? #1588's Outcome and the session decision say "the same message" as the worker. Interface I3 spells out a different first clause.

Options, and what a user would see:

  1. I3's wording: Every worker with android serves only enrolled physical android devices (android.virtualDevices is false); ask for a physical device (--physical, or physical: true).
  2. The worker's wording, word for word: This worker serves only enrolled physical android devices …. Through a gateway that fronts several workers, "This worker" names none of them.

Taken: option 1. I3 is the spec's explicit interface, and it is accurate for a fleet. The code, the advice and the details stay identical to the worker's refusal, so only the first clause differs. The Tests line for B8 on #1599 now pins the wording.

Reverting it means changing one string in src/gateway/routing/serviceability.ts, the B8 test's expected message, and the routing manual line.

Written by an agent.

… tests pin the platform filter and the order of workers (#1599)
@V3RON

V3RON commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 143a4a6
Round 2: ee4dc82
Round fix-check: ee4dc82
Round fix-check: f8f66bb
Round fix-check: c303d75
Round fix-check: 38c89ce

Runs: 17. Cost USD: 3.7725. Agent seconds: 1687.
Tokens input 384, output 88852, cache read 7089309, cache write 610110.
- build implementer: claude-sonnet-5-5 199 s $0.5015
- audit implementer: claude-sonnet-5-5 141 s $0.1725
- review 1 reviewer: claude-sonnet-5-5 296 s $0.2885
- review 1 spec: claude-sonnet-5-5 18 s $0.1221
- review 1 code both: claude-opus-5-5 196 s $0.8976
- review 1 claims: claude-sonnet-5-5 25 s $0.1122
- fix 1 implementer: claude-sonnet-5-5 57 s $0.1475
- review 2 reviewer: claude-sonnet-5-5 81 s $0.155
- review fix-check reviewer: claude-sonnet-5-5 161 s $0.204
- review fix-check code both: claude-opus-5-5 86 s $0.3999
- review fix-check claims: claude-sonnet-5-5 31 s $0.1145
- fix fix-check implementer: claude-sonnet-5-5 43 s $0.1073
- fix fix-check implementer: claude-sonnet-5-5 49 s $0.1065
- review fix-check reviewer: claude-sonnet-5-5 53 s $0.1303
- fix fix-check implementer: claude-sonnet-5-5 24 s $0.0652
- fix fix-check implementer: claude-sonnet-5-5 64 s $0.1222
- review fix-check reviewer: claude-sonnet-5-5 163 s $0.1257
Finding outcomes: {"fixed":3,"nonblocking":1}. Classes: {"spec I3 message delivered differently":1,"testing 10":1,"testing 3":1,"why comment credits ADR with wording":1}.
{"findings":[{"id":"R1","role":"code","class":"spec I3 message delivered differently","outcome":"fixed","path":"src/gateway/routing/serviceability.ts","round":"1","fix":"ee4dc82f19f4fa089bf71d53a3ae444cc92a7b8f"},{"id":"R2","role":"code","class":"testing 3","outcome":"fixed","path":"src/gateway/fleet-routing-phones-only.test.ts","round":"1","fix":"ee4dc82f19f4fa089bf71d53a3ae444cc92a7b8f"},{"id":"R3","role":"code","class":"testing 10","outcome":"fixed","path":"src/gateway/aggregate-catalog.test.ts","round":"1","fix":"ee4dc82f19f4fa089bf71d53a3ae444cc92a7b8f"},{"id":"R4","role":"claims","class":"why comment credits ADR with wording","outcome":"nonblocking","path":"src/gateway/routing/serviceability.ts","round":"fix-check"}]}

Written by an agent.

@V3RON

V3RON commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 17, 2026 11:19
@V3RON
V3RON merged commit 9d0332a into main Nov 17, 2026
44 checks passed
@V3RON
V3RON deleted the task/1599 branch November 17, 2026 11:40
V3RON added a commit that referenced this pull request Nov 17, 2026
…ose virtualDevices is false (#1623)

Closes #1598

## Done when

- [x] `pnpm test:changed` passes, with every Tests line above as a test.
— B1 `config-platform-and-driver-settings.test.ts`; B2, B3, B6
(catalog.get) and B7 `dispatcher-virtual-devices-off.test.ts`; B6 (CLI)
`index-catalog-components.test.ts`; B5
`create-leasing-virtual-devices-off-startup.test.ts`; B4
`create-leasing-warm-pool-virtual-devices-off.test.ts`; B10
`doctor-warm-pool-targets.test.ts`; `docs-manuals.test.ts` 13/13 after
baeaf51.
- [x] `pnpm check` passes, the protocol-bump check included: `max` is
one above the value `main` holds when this lands (after #1595 and
#1596). — protocol range is { min: 89, max: 93 } after the stack merge
with main (`src/contract/protocol.ts:13`, d27a21a); the pre-push hooks
passed.
- [x] The website build passes: `pnpm --dir website install && pnpm
--dir website build && node website/scripts/check-openapi.mjs`. — 92
pages built, `check-openapi: 45 operations, 12 tags: ok`.
- [x] `docs/internal/EVENTS.md` and `reference/events.mdx` list
`virtual-devices-off` as an initiator of `device.shutdown` and
`device.deleted`. — read in both files.

### Status

Implement: done (stack merge d27a21a) Review: fix-check passed after
the stack merge (coordinator) Hardware: n/a Gate: waiting for the stack
Next: CI on d27a21a; stays in stack #1592 → #1623 → #1657

## Assumptions

- Assumption: the doctor's config slice — `DoctorConfig` is narrowed
with `Pick` to the two `virtualDevices` flags it reads, the smallest
change.
- Assumption: the startup delete's operation name — it logs as a cleanup
("Could not delete an idle device at start"), matching the existing
startup steps.
- Assumption: where the reserve is zeroed — in the warm-pool converger
and in doctor through `reserveOnVirtualPlatforms`, not inside the policy
view, so the policy stays pure.
- Assumption: B6 is proved at two seams — `catalog.get` through the
dispatcher and the CLI print through the CLI test, because the Tests
line names both.

## Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 1 blocking, 1
fixed, 0 notes. Claims review: 1 blocking, 1 fixed, 0 notes.
Rounds: 2. Tokens: 6.1M.
Runs: 19. Cost USD: 9.1982. Agent seconds: 2924.
Assessment: complete

*Written by an agent.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Through a gateway, a plain lease that only phones-only workers could serve gets the phones-only refusal

1 participant