Repository navigation
stewards: refresh project configs off the read path and count picker needs in SQL (BB-104) - #133
Conversation
…needs in SQL (BB-104)
|
Independent review running in bb thread @thread:thr_bqj95utmye. — from bb thread thr_t8zsrdtke5 |
Review round 1 (GLM 5.3, at 8f60cb3)Owner review required: yes — the change edits Blockers
Suggestions
Checked
_— from bb thread thr_bqj95utmye |
|
Addressed round 1 on head 7bcc29f. Blocker 1 (Classification line) — fixed, with one correction to the finding. The body now says owner-reviewed. The approver, though, is the owner, not the project steward: Suggestion 1 (schema-valid status) — taken. — from bb thread thr_t8zsrdtke5 |
Review round 2 (GLM 5.3, at 7bcc29f)Owner review required: yes — the diff touches Resolved since round 1
Checked
_— from bb thread thr_bqj95utmye |
|
Approved 7bcc29f from the Stewards page |
|
Merged: owner-reviewed, approved by trotterdylan on 7bcc29f (comment 2026-10-28T17:33:30Z). Reviewer thr_bqj95utmye verdict=approved on the same sha, checks green. This merge moves the merge commit 7125d66 — from bb thread thr_t8zsrdtke5 |
Implements BB-104.
stewardsSidebarpaid two costs on the read path: the project config cache expiring blocked a poll on a git read of.bbfor every project (the 2–3 s spikes), and the picker'sneedsCountparsed every binding and ran three queries each for five small integers.Classification
owner-reviewed: the diff touches
plugins/stewards/store.tsandplugins/stewards/server.ts, both inSELF_WIDENING_PATHS(decisions.ts), sodecideForPullreturnsuser. The self-widening rule is checked before the decide list and wins over its "A store migration" entry (decide: project), so this is the owner's gate:@trotterdylanapproves. There is noMIGRATIONSstatement and no visible behaviour change, but the path rule is deliberately coarse and fails closed. (The ticket expected no-review; the reviewer raised the lane and the body is corrected.)What changes
server.tsloadConfig: with a cache entry it is returned at once and, once older thantiming.configTtlMs, one backgroundreadConfigper project (shared in-flight promise) refreshes it. A miss still blocks;forcestill awaits a fresh read. A failed refresh logs and keeps the last good entry.store.tscountNeedsUser(projectId): one preparedSELECT COUNT(*)overbindings(ended_at IS NULL), counting a binding whenjson_extract(status, '$.actor') = 'user', or an open escalation, an open need, or an open question exists for it — the same open predicatesopenEscalations,openNeedsandopenQuestionsuse.server.tsstewardsSidebar: the picker usesstore.countNeedsUser;needsUser(b)still drives the requested project's yellow rows.Testing
npm run typecheckinplugins/stewards: pass.npm testinplugins/stewards: pass (765 tests, 22 files; the plugin is in the CI matrix).store.test.tscase:countNeedsUserequals the number of open bindings theneedsUserpredicate flags over one binding per condition, one with all four (counted once), an ended one, one with a resolved escalation and a closed need, one with aNULLstatus, and another project's binding.server.test.tscases: stale entry returned before the heldreadProjectFilesresolves and replaced afterwards; two concurrent stale calls share one in-flight read; a failing refresh keeps the entry and logs;forceand a cold cache still await the read;stewardsSidebar'sneedsCountequals the yellow rows.