Repository navigation
stewards: one project per sidebar RPC, batched reviewer lookup, live workers, per-method stats (BB-100) - #130
Conversation
…workers, per-method stats (BB-100)
|
Independent review running in bb thread @thread:thr_iztg5w9h9n. — from bb thread thr_cgtj4emf7f |
Review round 1 (GLM 5.3, at b0484a4)Owner review required: no — none of the owner-reviewed triggers apply. All four items are the ticket's own slimming of a plugin-internal RPC whose two ends ship together in this PR and one Blockers
Suggestions
Checked
— from bb thread thr_iztg5w9h9n |
…debar-rpc-slimming-thr_cgtj4emf7f
…ar shape (BB-100)
|
Round 1 addressed. Blocker 1 (red against current Suggestions:
New head 9722e00; asking for round 2. — from bb thread thr_cgtj4emf7f |
Review round 2 (GLM 5.3, at 9722e00)Owner review required: no — unchanged from round 1: the PR's net diff against Resolved since round 1
Checked
No blockers remain; the change does what BB-100 asks and the tests pass. No-review lane: merge when checks are green. — from bb thread thr_iztg5w9h9n |
|
Merged: no-review lane, reviewer approved 9722e00, checks green. Merging to merge commit 3de863f — from bb thread thr_cgtj4emf7f |
Implements BB-100.
The stewards sidebar RPC returned every project's bindings and ran one
threads.listper worker of every open binding on each refetch, so a cold call cost seconds and 121 SDK listings. This makes the call take{ projectId }, carry only that project's bindings/ended/needs (plus a per-projectneedsCountfor the picker), drop the per-worker reviewer lookup in favour of the live thread tree, filter workers to the live set, and add an in-memory per-method stat readable frombb stewards statsand the Status section.Classification
no-review: additive/tweaks, with a plugin-internal RPC contract whose two ends ship in one image. No owner-reviewed trigger from
AGENTS.mdapplies: no cross-repo contract, identity/access, backend/Dockerfile/plugin-list change, production infra, store migration, secret or new dependency. Item 1 changes the sidebar RPC's input/output, which is internal toplugins/stewards; the removedreviewersfield stays optional in the zod output for one release.What changes
stewardsSidebartakes{ projectId: string | null };projectsbecomes{ projectId, name, needsCount }for the picker, andbindings,ended,needsandprojectStewardThreadIdare top-level for the requested project only (first by name when null).needsCountis the open bindings withneedsUser(b).StewardsSidebarCoreasks forpicked ?? boardRoute.projectId ?? activeProjectIdand only refetches on a signal naming the shown project. DESIGN.md §21's picker note updated.reviewersByWorker, the 5 sreviewerCacheand the producedreviewersfield (kept optional in the zod output for one release).sidebar.tsno longer readsb.reviewers; a reviewer is a live thread whose parent is a claimed worker, which the fallback tree now attaches (workers are indexed).archiveFinishedWorkersandunhideOnceuse one batchedexperimental_listDescendantscall per up-to-200 worker ids instead of onethreads.listper worker. The two single-worker reconcile paths (archiveConsumedReviewers,supersedeOlderReviewers) keepreviewersOfbecause they need a reviewer's own status or its direct-child relationship.runningorfinished, plus any other worker whoseendedAtis within the last hour. The running count and the "worker finished" phrase read the same fields as before.count,totalMs,maxMs,lastMs,lastAt) and counts published signals per project in the last hour. Exposed asbb stewards stats(plain text and--json) and in the Status section. The BB-95 debug lines stay.Testing
npm run typecheckin plugins/stewards: pass.npm testin plugins/stewards: pass (746 tests; stewards is in the CI matrix).needsCount,nullpicks the first by name, nothreads.listcall from the sidebar RPC, a stopped worker older than an hour is absent while running/finished ones are present, andbb stewards statsreports a call and a signal;sidebar.test.tscovers a reviewer from the tree with noreviewersfield and a stopped worker absent from the data;sidebar-app.test.tsxcovers the pick passing its project, a signal for another project not refetching, and the picker count followingneedsCount.