Skip to content

feat(inbox): the daemon says what needs the operator: GET /v1/inbox - #937

Merged
V3RON merged 20 commits into
task/914from
task/915
Oct 23, 2026
Merged

V3RON merged 20 commits into
task/914from
task/915

Conversation

@V3RON

@V3RON V3RON commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #915

Status

Implement: done (3/3 green) Review: round 1 + fix-check passed, 2 fixed Hardware: n/a Gate: waiting for the stack

Done when

  • pnpm vitest run src/contract src/http ui/src passes; ui/src/model/inbox.ts has no inboxItems: audit ran them and probed 24/24 tests red. Rules: src/contract/inbox.ts (test src/contract/inbox.test.ts); route: src/http/admin-declarations.ts inboxRoute + app.ts (test src/http/app.test.ts "GET /v1/inbox"); dispatchers: src/gateway/dispatcher.ts and src/daemon/dispatcher.ts #inboxGet (their dispatcher tests); console: ui/src/model/inbox.ts, ui/src/state/{inbox,shell,overview}.ts (tests ui/src/model/inbox.test.ts, ui/src/state/queries.test.ts).
  • The boundaries and protocol bump checks pass (commit and push hooks): .dependency-cruiser.mjs lets the console import src/contract/inbox.ts by path; protocol 58 to 59.
  • The console browser lane passes in Chromium, with the specs of F13 stubbing GET /v1/inbox (e2e/console/inbox-stub.ts) and the "Could not check" cases removed; the one red test, "a worker is drained from Fleet with no dialog, and Undo undrains it", fails the same on the base branch and is Console e2e: a worker is drained from Fleet with no dialog, and Undo undrains it fails on the row's drained text #886.

Assumptions

  • Assumption: the route test's gateway and worker cases — they run in the dispatcher tests of each mode (src/gateway/dispatcher.test.ts, src/daemon/dispatcher.test.ts) and the agent 403 in e2e/single-host-fleet.test.ts, because src/http/app.test.ts uses a fake dispatcher that cannot answer by mode or role; app.test.ts proves the route dispatches inbox.get.
  • Assumption: the contract's requestedDevice(spec) helper is named describeRequestedDevice — the contract index already exports a requestedDevice for lease requests.
  • Assumption: the Overview keeps reading /v1/lease-requests and /v1/leases for its Waiting and Ending soon tiles; only Needs you and the sidebar count come from /v1/inbox. A refused /v1/inbox shows the page's refusal.
  • Assumption: "keys observed" is proved in the browser lane (e2e/console/shell.spec.ts, requests on Usage), since the unit lane has no DOM to mount pages in.
  • Assumption: the worker subject omits only catalog, devices, downloads and leases, as the spec says, so it still carries waiting, warmPool and installs.

Review

Spec review: 1 blocking, 1 fixed, 0 notes. Code review: 0 blocking, 0 fixed, 0 notes. Claims review: 1 blocking, 1 fixed, 0 notes.
Rounds: 1. Tokens: 17.4M.
Runs: 9. Cost USD: 11.6148. Agent seconds: 5408.
Assessment: complete

Written by an agent.

@V3RON
V3RON added this pull request to stack #921 October 23, 2026 12:54
@V3RON

V3RON commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

Question. #915's Tests line says the keys observed on "Overview's Needs you" include no leases, tokens or lease-requests. The Overview page's Waiting and Ending soon tiles still read /v1/lease-requests and /v1/leases. Does the line mean the Needs you panel, or the whole Overview page?

Options.

  • A: the Needs you panel only. The panel reads /v1/inbox and /v1/workers; the two tiles keep their reads. A user sees no change on the Overview.
  • B: the whole page. The Waiting and Ending soon tiles would have to get their numbers from /v1/inbox or drop them. That changes what the Overview shows, which The console stays smooth and light on a big fleet #905 excludes ("No change to what any page shows").

Taken: A. It is what the code does, and B would contradict #905's non-goal. Folded into #915's Tests line, marked pending the maintainer; the fix run pins the panel's reads in a test.

To revert: a new task to move the tiles onto /v1/inbox.

Written by an agent.

@V3RON

V3RON commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 55c5789
Round fix-check: 0153b16

Fix-check: both hunks (a manual line, one model test) verified by coordinator, no lens.

Runs: 9. Cost USD: 11.6148. Agent seconds: 5408.
Tokens input 730, output 212863, cache read 49224566, cache write 1153486.
- build implementer: claude-sonnet-5-5 2305 s $5.5421
- audit implementer: claude-sonnet-5-5 1476 s $1.2891
- review 1 reviewer: claude-sonnet-5-5 549 s $0.4199
- review 1 spec: claude-sonnet-5-5 41 s $0.4053
- review 1 code behaviour: claude-opus-5-5 382 s $1.7158
- review 1 code tests: claude-opus-5-5 410 s $1.6414
- review 1 claims: claude-sonnet-5-5 65 s $0.3064
- fix 1 implementer: claude-sonnet-5-5 114 s $0.202
- review fix-check reviewer: claude-sonnet-5-5 66 s $0.0928
Finding outcomes: {"fixed":2}. Classes: {"acceptance: Overview Needs you reads untested":1,"manual states stale protocol version":1}.
{"findings":[
{"id":"R1","role":"claims","class":"manual states stale protocol version","outcome":"fixed","path":"src/daemon/AGENTS.md","round":"1","fix":"0153b165e"},
{"id":"R2","role":"spec","class":"acceptance: Overview Needs you reads untested","outcome":"fixed","path":"ui/src/model/overview.test.ts","round":"1","fix":"0153b165e"}
]}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 23, 2026 13:34
@V3RON

V3RON commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Fix-check (stack merge): 49a4d05 — merge of task/914 (main's #886 drain-test fix) resolved in the import block of e2e/console/actions.spec.ts, both sides kept; verified by coordinator, mechanical.

Written by an agent.

@V3RON
V3RON merged commit 02d4aab into main Oct 23, 2026
32 checks passed
@V3RON
V3RON deleted the task/915 branch October 23, 2026 16:59
V3RON added a commit that referenced this pull request Oct 23, 2026
…quests a minute (#918) (#940)

Closes #918

### Status
Implement: done (1/1 green) Review: round 1 passed, no blocking findings
Hardware: n/a Gate: waiting for the stack

- [x] The console browser lane passes with `big-fleet.spec.ts`: audit
ran it with `long-lists.spec.ts` on Chromium, 24 green; CI console lane.
- [x] Setting the intervals in `ui/src/state/queries.ts` back to 1 s
makes it fail: audit set all six to 1 s, every page failed the ceiling
(Overview 295, Queue 237, Activity 239, Leases 182, Inbox 120, Fleet
118, Usage 120 in 60 s).

#905 Completion conditions:

- [x] Idle tab ≤ 40 `/v1` requests in 60 s on each of the seven pages,
50 workers / 500 devices: `big-fleet.spec.ts` (this PR).
- [x] A lease granted through the gateway shows on Leases within about a
second: event map and burst window, #926 (#914)
`ui/src/state/queries.test.ts`.
- [x] Leaving a page stops its reads; coming back within a minute shows
kept data: #926 (#914) polling and drop tests.
- [x] A second read of an unchanged list answers 304: #920 (#919)
`src/http/app.test.ts`; the console sends the tag, #927 (#916).
- [x] Sidebar count reads only `GET /v1/inbox`; Inbox and Needs you read
it plus `/v1/workers`: #937 (#915) `e2e/console/shell.spec.ts` and
`ui/src/model/overview.test.ts`.

## Assumptions
- Assumption: the stub builder is typed by `WorkerView`, derived in
`big-fleet.spec.ts` as `z.infer<typeof workerViewSchema>` from the
contract's exported schema; `src/contract/` is unchanged.
- Assumption: `leases` and `pad` builders moved to `stub-answers.ts`
with `answer`, so both specs share them.

## Review

Spec review: 0 blocking, 0 fixed, 1 notes. Code review: 0 blocking, 0
fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 1. Tokens: 23.5M.
Runs: 7. Cost USD: 1.8082. Agent seconds: 2527.
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.

The daemon says what needs the operator: GET /v1/inbox

1 participant