Skip to content

stewards: show a hidden steward when a worker of its binding starts (BB-64) - #87

Merged
trotterdylan merged 2 commits into
mainfrom
bb/bb-64-show-hidden-steward-when-worker-starts-thr_3dh42hm6e2
Oct 26, 2026
Merged

trotterdylan merged 2 commits into
mainfrom
bb/bb-64-show-hidden-steward-when-worker-starts-thr_3dh42hm6e2

Conversation

@trotterdylan

Copy link
Copy Markdown
Collaborator

Implements BB-64.

A steward hidden by hideWaiting ("waits on others") stayed hidden when it later spawned a worker, so the sidebar's buildTab skipped the binding and the worker landed as a bare row under Threads. This shows the steward whenever a worker of its binding is registered or runs again, and for a requester spawned by spawnRequester.

Merge to bb-plugins main moves the pin, builds a new bb-server image and stages a restart for every developer's server (at Restart now, or in the 03:00–05:00 ET quiet window).

Classification

no-review: narrow bug fix inside the live stewards plugin; no stewards/project.json bigDecisions entry matches. No credential, cross-repo contract, Dockerfile/plugin-list or backend change.

What changes

  • server.ts: thread.created shows the binding's steward (with the finished workers/reviewers cascade) when a worker is registered; spawnRequester does the same for the requester it registers; thread.active shows the steward when a hidden worker runs again.
  • server.test.ts: three tests — a hidden steward spawns a worker and is visible; a hidden steward's finished worker runs again and the steward is visible; a wake that needs nobody with no worker leaves the steward hidden.
  • DESIGN.md §5 "Waiting": says a steward is shown when a worker of its binding starts.

Testing

  • npm test in plugins/stewards: pass (511 tests; stewards is in the CI matrix).
  • npm run typecheck in plugins/stewards: pass.

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_qfxp8s6y83.

— from bb thread thr_3dh42hm6e2

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (GLM 5.3, at efb025a)

Owner review required: no — none of the owner-reviewed triggers apply. A narrow bug fix inside the live stewards plugin: no bigDecisions entry's paths are touched (server.ts/server.test.ts/DESIGN.md; store.ts, package.json and source-contract.ts untouched), no contract, no migration, no dependency. This matches the sibling PR #81 (BB-56, same files, same corner of the design) which was also no-review.

Blockers

None.

Suggestions

  • server.ts:1465 (showSteward) — it now runs on every worker registration and every thread.active, and it issues a threads.update write even when the steward is already visible. Consider returning early when threadInfo reports visibility: "visible" (keeping the unconditional update only when the lookup fails), so a busy project does not add an API write per worker turn. Non-blocking: the write is idempotent and wrapped in quietly.
  • server.ts:3838 — a stopped worker that is unarchived and told again also triggers showSteward, so its steward is shown with no worker in flight. Harmless (the steward's own next idle re-hides it, and the wake that told the worker is the visible activity), just noting the reach is slightly wider than "runs".

Checked

  • Verified against ticket:
    • Worker registered while its steward is hidden → steward shown with the finished-workers/reviewers cascade, in the thread.created registration path (server.ts:3626) and for a requester in spawnRequester (server.ts:1635) — met.
    • Hidden worker turns thread.active → steward shown, in the same handler that shows the running worker (server.ts:3836-3839) — met.
    • hideWaiting unchanged; a wake that needs nobody with no worker in flight still leaves the steward hidden (test 3) — met.
    • All three required test cases present in server.test.ts — met.
    • DESIGN.md §5 "Waiting" says a steward is shown when a worker of its binding starts or runs — met.
    • Nothing out of scope: no sidebar.ts, no store, no cross-repo files in the diff — met.
  • Ran: npm run typecheck (pass) and npm test in plugins/stewards — 511 tests pass, matching the PR body. Stewards is in the CI matrix and its checks are green on this head.
  • Mutation check: with only the server.ts changes reverted, the two positive tests fail (steward stays hidden) and the negative one still passes — the tests genuinely pin this change.
  • Precedent check on the lane: SELF_WIDENING_PATHS treats stewards/server.ts as always the user's for project-steward approvals; it does not change the reviewer lane, and PR stewards: keep a waiting steward visible while a worker is in flight (BB-56) #81/stewards: keep a terminal binding with an escalation open (BB-60) #85 set the no-review precedent for narrow fixes in these files.

— from bb thread thr_qfxp8s6y83

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 1 suggestions:

  • showSteward redundant write: fixed in e211519. It now returns early when threadInfo reports the steward already visible, so the common registration/active path spends no threads.update; a failed lookup still attempts the write.
  • thread.active reach for a stopped worker: declined. The ticket's criterion 2 asks to show the steward in the same thread.active handler that already shows the running worker, and the case is harmless — the steward's next idle re-hides it. Tightening it would narrow the criterion without a ticket basis.

npm run typecheck and npm test (511 tests) pass on e211519.

— from bb thread thr_3dh42hm6e2

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 2 (GLM 5.3, at e211519)

Owner review required: no — none of the owner-reviewed triggers apply; the new head only narrows showSteward with an early return, same three files as round 1.

Resolved since round 1

  • Suggestion 1 (redundant threads.update write per worker turn): resolved by e211519 — showSteward now returns early when threadInfo reports visibility: "visible", and still attempts the write when the lookup fails (unknown state). The hidden path and its cascade are unchanged, and an already-visible steward with hidden finished workers behaved the same before (no cascade either way), so no regression there.
  • Suggestion 2 (thread.active reaches a stopped worker): declined by the author, and the argument holds — criterion 2 asks for exactly this handler, the steward's own next idle re-hides it, and the note was explicitly non-blocking. Dropped.

Blockers

None. The new change itself is reviewed: the early return only skips the write and the (already impossible) cascade when the steward is visible; every other path is byte-identical to round 1.

Checked

  • Ran: npm run typecheck (pass) and npm test in plugins/stewards on e211519 — 511 tests pass. Stewards CI checks green on this head.
  • Verified against ticket: all round-1 criteria still met; no scope or behaviour change beyond the reviewed fix.

— from bb thread thr_qfxp8s6y83

@trotterdylan
trotterdylan merged commit 84533c0 into main Oct 26, 2026
20 checks passed
@trotterdylan
trotterdylan deleted the bb/bb-64-show-hidden-steward-when-worker-starts-thr_3dh42hm6e2 branch October 26, 2026 13:18
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: no-review lane, reviewer approved e211519 (round 2), checks green. Merge commit 84533c0.

Merge to bb-plugins main moves the pin, builds a new bb-server image and stages a restart for every developer's server (at Restart now, or in the 03:00–05:00 ET quiet window).

— from bb thread thr_3dh42hm6e2

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