Skip to content

feat(ui): the console reads per page and marks data stale from events - #926

Merged
V3RON merged 16 commits into
task/913from
task/914
Oct 23, 2026
Merged

V3RON merged 16 commits into
task/913from
task/914

Conversation

@V3RON

@V3RON V3RON commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #914

Status

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

Done when

  • pnpm vitest run ui/src passes (queries.test.ts: polling, drop, event map, failures), and connection.test.ts has no 1 s poll test left: audit ran ui/src and the dispatcher test, 683 green; 52 of 55 probes went red, the other 3 equivalent.
  • pnpm lint passes (dependency-cruiser: no @tanstack/* under ui/src/data or ui/src/model): commit and push hooks passed; review R4 checked the rule at .dependency-cruiser.mjs:18, :240-249.
  • The console browser lane passes (e2e/console), specs that waited for a 1 s poll now return to the tab (e2e/console/tab.ts): CI console jobs; the one red spec, daemon-start-failure.spec.ts, fails on unrelated branches too and is flaky-test Flaky: daemon-start-failure.spec.ts port-conflict premise fails #933.

Assumptions

  • Assumption: where useRouteQuery lives — in ui/src/state/live.tsx beside the provider, because queries.ts importing the provider's context would make an import cycle; queries.ts holds the client, keys and times.
  • Assumption: one poll timer per key — kept by the layer, not TanStack's per-observer refetchInterval, so two pages on one key do not read twice.

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 3 blocking, 3 fixed, 0 notes. Claims review: 1 blocking, 1 fixed, 0 notes.
Rounds: 2. Tokens: 9.4M.
Runs: 10. Cost USD: 7.6708. Agent seconds: 4469.
Assessment: complete

Written by an agent.

@V3RON
V3RON added this pull request to stack #921 October 23, 2026 11:04
@V3RON

V3RON commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: d9faae1
Round 2: 3b61930

Runs: 10. Cost USD: 7.6708. Agent seconds: 4469.
Tokens input 476, output 182553, cache read 19387762, cache write 936407.
- build implementer: claude-sonnet-5-5 1817 s $2.7801
- audit implementer: claude-sonnet-5-5 438 s $0.363
- review 1 reviewer: claude-sonnet-5-5 620 s $0.2242
- review 1 reviewer spec: claude-sonnet-5-5 48 s $0.2714
- review 1 reviewer both: claude-opus-5-5 516 s $2.342
- review 1 reviewer claims: claude-sonnet-5-5 81 s $0.2218
- fix 1 implementer: claude-sonnet-5-5 494 s $0.3781
- review 2 reviewer: claude-sonnet-5-5 264 s $0.2259
- review 2 code-reviewer both: claude-opus-5-5 175 s $0.7871
- review 2 claims-reviewer: claude-sonnet-5-5 16 s $0.0772
Finding outcomes: {"fixed":4}. Classes: {"adr 0011 console libs are devDependencies":1,"false claim: tanstack allowed only in state":1,"hidden tab reads after burst flush":1,"timeout thrown as error after hidden start":1}.
{"findings":[
{"id":"R1","role":"code","class":"hidden tab reads after burst flush","outcome":"fixed","path":"ui/src/state/queries.ts","round":"1","fix":"3b619308f9612e9efe8d2c7b2223455376809b3f"},
{"id":"R2","role":"code","class":"timeout thrown as error after hidden start","outcome":"fixed","path":"ui/src/data/live/connection.ts","round":"1","fix":"3b619308f9612e9efe8d2c7b2223455376809b3f"},
{"id":"R3","role":"code","class":"adr 0011 console libs are devDependencies","outcome":"fixed","path":"package.json","round":"1","fix":"3b619308f9612e9efe8d2c7b2223455376809b3f"},
{"id":"R4","role":"claims","class":"false claim: tanstack allowed only in state","outcome":"fixed","path":"ui/AGENTS.md","round":"1","fix":"3b619308f9612e9efe8d2c7b2223455376809b3f"}
]}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 23, 2026 11:45
@V3RON
V3RON merged commit bf3ebee into main Oct 23, 2026
32 checks passed
@V3RON
V3RON deleted the task/914 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 console reads per page through a query cache, and events mark data stale

1 participant