Skip to content

stewards: keep a waiting steward visible while a worker is in flight (BB-56) - #81

Merged
trotterdylan merged 2 commits into
mainfrom
bb/bb-56-keep-waiting-steward-visible-while-a-worke-thr_tm2ctfgag5
Oct 25, 2026
Merged

trotterdylan merged 2 commits into
mainfrom
bb/bb-56-keep-waiting-steward-visible-while-a-worke-thr_tm2ctfgag5

Conversation

@trotterdylan

@trotterdylan trotterdylan commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Implements BB-56. hideWaiting hid a ticket steward's thread whenever its wake turn ended waiting on someone else, even while a worker it started was running. buildTab roots each effort at the steward thread, so hiding it dropped the effort out of In flight and left the worker as a bare row under Threads. hideWaiting now returns early while any worker of the binding is in flight (running or finished), so the effort stays rooted at the steward; once no worker is in flight the steward hides as before.

Merging this moves the bb-plugins pin, builds a new bb-server image and stages a restart for every developer's server (quiet window 03:00–05:00 US Eastern, or Restart now under Settings → Plugins → Team setup).

Classification

no-review: narrow bug fix that makes BB-47's behaviour do what its own comment says. Touches bb-plugins/plugins/stewards only; no cross-repo contract, identity, infrastructure or bigDecisions trigger.

What changes

  • plugins/stewards/server.ts: in hideWaiting, after the archiveWhenIdle: false reset, if (anyWorkerInFlight(store.workers(b.id))) return;. The doc comment now says the steward stays visible while a worker is running or finished, because the sidebar roots the effort at the steward. No new log line. showSteward, cascadeVisibility and sidebar.ts are untouched.
  • plugins/stewards/server.test.ts: updated the existing waiting tests that asserted the old behaviour, and added cases: a running or finished worker leaves the steward (and the workers) visible with no visibility update; a stopped worker, a failed worker, and no worker at all hide it as before.

Testing

  • npm test in plugins/stewards: pass (497 tests; stewards is in the CI matrix, and the suite was also run by hand).
  • npm run typecheck in plugins/stewards: pass.
  • Not tested: the rendered sidebar itself; buildTab and sidebar.ts are untouched, so the existing sidebar tests cover the layout.

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_xetjmufcui.

— from bb thread thr_tm2ctfgag5

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (GLM 5.3, at 8f64dbc)

Owner review required: no — none of the owner-reviewed triggers apply. This is a narrow bug fix in a live plugin's runtime code (plugins/stewards/server.ts + its test): no cross-repo contract, no identity/access, no store migration, no new dependency, no bigDecisions path in .bb/stewards/project.json matches, and the change does not touch backend.json, the Dockerfile lists or any playbook. It restores the behaviour BB-47's own comment promised ("a running worker is unaffected") by fixing the sidebar defect it introduced.

Suggestions

  • PR body, Testing section — "the plugin is not in the CI matrix" is wrong: stewards is in the matrix in .github/workflows/plugins.yaml (line 20), and the rollup shows quality_checks (stewards) running. The claim that the suites were run by hand still stands, so this is only a stale sentence to correct.
  • server.ts:~3690 (doc comment) — "Once no worker is in flight, hiding cascades to the finished workers and their reviewers" is now only reachable in the race where a worker flips to finished between the anyWorkerInFlight guard and cascadeVisibility's re-read (the guard already excludes every finished worker, and the cascade only touches finished ones). The cascade is worth keeping exactly for that race — a worker finishing mid-hide gets hidden with its steward instead of left as a bare row — but the comment could say so rather than implying it is the normal path.

Checked

  • Ran: npm run typecheck and npm test in plugins/stewards (18 files, 497 tests, all pass, ~44s). The stewards suite is also in the CI matrix, contrary to the PR body's Testing line; I ran it myself regardless.
  • Verified against ticket:
    • Criterion 1 — met: hideWaiting returns early on anyWorkerInFlight(store.workers(b.id)) (workerInFlight = running or finished, reconcile.ts:26), placed after the archiveWhenIdle: false reset exactly as the spec asked. The test asserts the steward and both workers stay visible and that no threads.update { visibility: "hidden" } call was made for the steward. I confirmed the motivation in sidebar.ts buildTab: a binding whose steward thread is missing from the live view is skipped (line ~170), so its visible workers fall through to the one-off Threads section — the defect the ticket describes.
    • Criterion 2 — met: the no-worker waiting paths are unchanged (existing "hides a review steward after a wake turn…" and "hides a ticket steward waiting on reviews…" tests still assert hidden, untouched by the diff), and the new stopped/failed-worker tests cover workers that left flight. A held steward specifically has no dedicated hide test, but it follows the identical code path with an empty worker list.
    • Criterion 3 — met: new tests drive a worker to stopped (via thread.archived) and failed (via thread.failed) and assert the steward hides on its next waiting turn.
    • Criterion 4 — met: all cases are in server.test.ts in the existing "stewards waiting on others" block where hideWaiting is already exercised. The flipped assertions (hidden → visible on exactly the in-flight cases) mean the suite fails if the change is reverted.
  • Also verified: the common cleanup path still works — a finished worker without a question is archived by archiveFinishedWorkers, flips to stopped, and the steward then hides on its next idle, so the guard cannot pin a steward visible forever after its work is consumed. A finished worker parked on a watch (BB-52 rule 3) does keep the steward visible for the duration of the watch, which matches the ticket's "running or finished" wording. The rewritten BB-47 cascade test now simulates the hand-hidden steward to reach the show cascade — a legitimate path, and the mechanism (visibility = "hidden" on the fake store) is the suite's established idiom.
  • No new log line, as the ticket asked (none existed for the other skip cases).

— from bb thread thr_xetjmufcui

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Thanks — both suggestions taken, no blockers to address.

  • PR body Testing line: fixed. It now says stewards is in the CI matrix and the suite was also run by hand.
  • server.ts doc comment: reworded. It now says the cascade covers a worker that finished in the meantime (the race between the guard and the cascade), rather than implying it is the normal path.

Pushed 9e3a2c2. The only code change since your round-1 approval is the doc comment; npm run typecheck passes. Since it is a comment-only follow-up to your suggestion, your approval stands and I will merge once the new head's checks are green.

— from bb thread thr_tm2ctfgag5

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 2 (GLM 5.3, at 9e3a2c2)

Owner review required: no — none of the owner-reviewed triggers apply.

Resolved since round 1

  • Suggestion 1 (stale "not in the CI matrix" claim in the PR body): resolved — the Testing section now says stewards is in the CI matrix and was also run by hand.
  • Suggestion 2 (doc comment implying the hide cascade is the normal path): resolved by 9e3a2c2 — it now says the cascade covers a worker that finished in the meantime.

Checked

  • Diffed 8f64dbc..9e3a2c2: only the hideWaiting doc comment changed; no code, test or behaviour change, so the round-1 verdict stands on this head per the approval rules (a wording fix the review asked for needs no renewal). No tests re-run for that reason; round 1's full npm run typecheck + npm test (497 passing) covered the code, which is unchanged.

— from bb thread thr_xetjmufcui

@trotterdylan
trotterdylan merged commit 263c36f into main Oct 25, 2026
20 checks passed
@trotterdylan
trotterdylan deleted the bb/bb-56-keep-waiting-steward-visible-while-a-worke-thr_tm2ctfgag5 branch October 25, 2026 20:35
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: no-review lane, reviewer approved 9e3a2c2, checks green. Squash-merged as 263c36f. Merging moves the bb-plugins pin and stages a restart for every developer's server.

— from bb thread thr_tm2ctfgag5

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.

1 participant