Skip to content

feat(stream): stream any running device by worker and device id - #923

Merged
V3RON merged 24 commits into
feature/906-adrfrom
task/909
Oct 23, 2026
Merged

V3RON merged 24 commits into
feature/906-adrfrom
task/909

Conversation

@V3RON

@V3RON V3RON commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #909

Status

Implement: done (5/5 green) Review: fix-check passed Hardware: pass Gate: waiting for the stack

  • pnpm test and pnpm test:e2e src/daemon/stream-gateway.e2e.test.ts pass, with the first four Tests lines. Checked: audit run, 5/5 green; CI green.
  • Slow lane: scripts/slow-e2e.sh e2e/slow-ios-stream.test.ts e2e/slow-android-stream.test.ts passes on this machine. Checked: slow lane after fix 355ae8c (H1: the stream helper read id instead of instanceId; the Android status check read an endless body); fix-check verified.
  • rg -l stream/leases e2e/slow-*.test.ts finds nothing. Checked: audit stale-reference sweep.
  • The OpenAPI document lists GET /v1/stream/workers/{workerId}/devices/{deviceId} with its statuses. Checked: openapi.test.ts and check-openapi.mjs.
  • watching-the-screen.mdx documents the device route, for operator tokens. Checked: claims review, round 1.

Assumptions

  • Assumption: how the link names its target — a plain lease id stays a string and a device is an object (StreamTarget), so the lease route's code and tests are untouched until Console: watch a device from its drawer's Screen tab; the lease stream route goes #910 removes them.

  • Assumption: the refusal when a hook or a device event stops a device capture while it opens — 409 DEVICE_NOT_RUNNING with the message "The device stopped before its picture started"; the spec fixes the code, not the text.

  • Assumption: the warm simulator in the new slow test is iPhone 16, the model other iOS lanes lease; not run here.

Review

Spec review: 1 blocking, 0 fixed, 0 notes. Code review: 1 blocking, 1 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 2. Tokens: 4.5M.
Runs: 11. Cost USD: 5.8767. Agent seconds: 3168.

Assessment: complete

Rejected:

  • spec: "relayed → 200 frames" proven twice, at create.test.ts:929 and stream-gateway.e2e.test.ts:184 — [intentional] the Seam line names both seams, and the e2e runs the real gateway and worker.

Written by an agent.

V3RON added 17 commits October 23, 2026 12:19
@V3RON
V3RON added this pull request to stack #925 October 23, 2026 10:37
@V3RON

V3RON commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 8151aa8
Round 2: b1aa159

Runs: 11. Cost USD: 5.8767. Agent seconds: 3168.
Tokens input 430, output 129421, cache read 17002812, cache write 714288.
- build implementer: claude-sonnet-5-5 1171 s $2.1021
- audit implementer: claude-sonnet-5-5 345 s $0.3795
- review 1 reviewer: claude-sonnet-5-5 691 s $0.3488
- review 1 spec: claude-sonnet-5-5 45 s $0.2918
- review 1 code both: claude-opus-5-5 574 s $1.9537
- review 1 claims: claude-sonnet-5-5 41 s $0.2024
- fix 1 implementer: claude-sonnet-5-5 62 s $0.0689
- review 2 reviewer: claude-sonnet-5-5 147 s $0.1557
- review 2 code-reviewer tests: claude-opus-5-5 48 s $0.2378
- review 2 claims-reviewer: claude-sonnet-5-5 20 s $0.0754
- hardware hardware-verifier: claude-sonnet-5-5 24 s $0.0606
Finding outcomes: {"fixed":1,"intentional":1}. Classes: {"testing 10, a failure also satisfies":1,"testing 7":1}.
{"findings":[
{"id":"R1","role":"code","class":"testing 10, a failure also satisfies","outcome":"fixed","path":"e2e/slow-ios-stream.test.ts","round":"1","fix":"b1aa159d9ffdbd63c60e3f1855961d00519650b7"},
{"id":"R2","role":"spec","class":"testing 7","outcome":"intentional","path":"src/daemon/stream-gateway.e2e.test.ts","round":"1"}
]}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 23, 2026 11:01
@V3RON V3RON added the needs-hardware PR parked: a Done when line needs a real simulator or emulator run. label Oct 23, 2026
@V3RON V3RON removed the needs-hardware PR parked: a Done when line needs a real simulator or emulator run. label Oct 23, 2026
@V3RON

V3RON commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Slow lane passed on this machine after fix 355ae8c (H1, test-side: the stream helper read id instead of instanceId from instance.json, and the Android status check awaited an endless body on 200). Fix-check verified; no assertion weakened. needs-hardware removed.

Written by an agent.

@V3RON
V3RON merged commit 34d65a3 into main Oct 23, 2026
32 checks passed
@V3RON
V3RON deleted the task/909 branch October 23, 2026 19:37
V3RON added a commit that referenced this pull request Oct 23, 2026
…ry (#943)

Closes #911

### Status
Implement: done (4/4 green) Review: round 2 passed, 1 fixed Hardware:
n/a Gate: waiting for the stack

## Done when

- [x] `pnpm test`, `pnpm test:e2e e2e/gateway-event-relay.test.ts` and
`pnpm test:console` pass, with the four Tests lines:
`e2e/gateway-event-relay.test.ts` "a gateway pages its events by
worker…"; `src/http/app.test.ts` (`GET /v1/events?worker=` rows and the
`before`/`limit`/`worker` dispatch); `src/history/history.test.ts`
"reads a worker's events without the database or the index…";
`e2e/console/workers.spec.ts:784`. Checked: audit runs, 7/7 tests probed
red; review R1 fix added `ui/src/state/worker-events.test.tsx`.
- [x] `events.mdx` documents `worker`; `console.mdx` lists the worker
page's four tabs. Checked: claims review, rounds 1 and 2.
- [x] The OpenAPI document lists `worker` on `GET /v1/events`. Checked:
`src/http/openapi.test.ts`.

#906 Completion conditions:

- [x] An operator opens a `ready` unleased device, picks Screen and sees
its picture, on a gateway and a single worker: #923 (#909) slow lane
`slow-ios-stream` / `slow-android-stream` passed; #928 (#910)
`screen.spec.ts`.
- [x] The picture keeps running when an agent leases the device, and
stops before the device resets after the lease ends: #923 (#909)
`stream-gateway.e2e.test.ts` and slow lane.
- [x] An agent token gets 404 `UNKNOWN_DEVICE` from the stream route:
#923 (#909) Tests lines.
- [x] `GET /v1/stream/leases/{id}` answers 404 and the lease drawer has
no Screen tab: #928 (#910) `openapi.test.ts`, `leases.spec.ts`.
- [x] The ⓘ button shows the stream numbers, not under the picture: #928
(#910) `screen.spec.ts:387`.
- [x] The Events tab fills the page and scrolls back to the worker's
oldest kept event or the cap: this PR, `workers.spec.ts:784`,
`gateway-event-relay.test.ts`.
- [x] The layout checks pass in the browser lane: #924 (#912)
`layout.spec.ts`.

## Assumptions

- Assumption: protocol bumped 59 to 60.

## Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 1 blocking, 1
fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 2. Tokens: 31.8M.
Runs: 10. Cost USD: 6.4136. Agent seconds: 5202.
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.

Stream any running device to an operator by worker and device id

1 participant