Skip to content

stewards: healthy waits never read no wake source (BB-389) - #434

Merged
trotterdylan merged 2 commits into
mainfrom
bb/bb-389-healthy-waits-never-read-no-wake-source-thr_qf2nhi6piz
Nov 24, 2026
Merged

trotterdylan merged 2 commits into
mainfrom
bb/bb-389-healthy-waits-never-read-no-wake-source-thr_qf2nhi6piz

Conversation

@trotterdylan

Copy link
Copy Markdown
Collaborator

Implements BB-389. A typed wait could override a live structured source, so a binding with an open escalation, an open need, a pull-request watch or a parked worker read waiting, no wake source and its wake paragraph claimed no source existed. The typed wait may now add liveness but never remove it, and a parked worker is a live source everywhere.

Merging to bb-plugins main moves the BB_PLUGINS_REF pin, builds a new bb-server image and stages a restart on every developer's server (Restart now, or the quiet window). A thread running when its server restarts loses its turn.

Sibling PR: none.

Classification

owner-reviewed: bb-plugins/plugins/stewards/** (the decide list's "The stewards plugin outside its authority seams" entry, decide: project). No authority seam (roles.ts, ready-gate.ts, escalations.ts, the gate/approval code) is touched, and the merge gate reads none of the changed derivations. A removal/reshape of existing behaviour, so the project steward is the approver.

What changes

  • assessment.ts: liveness.stalled is !live && ... — a live structured source is never overridden by a non-live typed wait. typedWaitLive counts a parked worker as live for a worker wait.
  • wake-source.ts: WakeSourceInput.parkedWorkers and hasLiveWakeSource count a parked worker_park worker as a source. wakeSourcesFor reads workers once, so no extra store read (read-counts test unchanged at 197).
  • server.ts: wakeSourcesFor counts parked workers; the worker-finish handler makes a parked finish a quiet note even when the steward's waitingOn/typed worker wait named the worker, while a plain finish keeps BB-152's loud hand-off and wording; the sidebar RPC carries parkedWaitingOn.
  • sidebar.ts: waitingOnNamesFinishedWorker skips a parked worker, so its row is not a lost hand-off.
  • wake.ts: noWakeSourceLines and noWakeSourceReportSentence name "no running or parked worker".
  • Tests: the five rows of the ticket's table assert noWakeSource/stalled false; the BB-154 true positive still flags; a parked-worker-waited-on finish is quiet; the sidebar row is a wait. README/DESIGN updated.

The ticket's cause 3 (a stale flag between report and reconcile) was checked: it is not the explanation for the owner-approval row. The report reply derives noWakeSource fresh, and the reconcile patches the stored flag before the wake it sends, so criterion 1 alone clears that row.

Testing

  • npm run typecheck: pass.
  • npm test (vitest run): pass, 2370 tests (stewards is in the CI matrix).
  • npx vitest run server.test.ts: pass, 1034 tests, including the new parked-finish and BB-266 integration tests.
  • Not tested: the sidebar rendering in a browser; the pure sidebar.ts rules are unit tested (waitingOnNamesFinishedWorker, effortSection, effortPhrase).

A typed wait could override a live structured source, so a binding with an
open escalation, an open need, a pull-request watch or a parked worker read
'waiting, no wake source' and its wake paragraph claimed no source existed.

- assess: a live structured source is never overridden by a non-live typed
  wait; the typed wait may add liveness but never removes it.
- wakeSourcesFor/hasLiveWakeSource: a parked worker (worker_park) counts as a
  live source, and a typed worker wait naming it is live while parked.
- The worker-finish handler: a parked finish is a quiet note even when the
  steward's waitingOn or typed worker wait named the worker; a plain finish
  keeps BB-152's loud hand-off.
- sidebar: waitingOnNamesFinishedWorker does not treat a parked worker as a
  lost hand-off, so the row is not Blocked.
- noWakeSourceLines/noWakeSourceReportSentence name parked workers.
- Tests for the ticket's five rows, the parked-worker wait and finish, and
  the sidebar row; README/DESIGN updated.
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_mv62t7arr3.

— from bb thread thr_qf2nhi6piz

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (Claude Opus 5.5, at 9f0f1c9)

Owner review required: yes — changes existing behaviour (the BB-333 stall rule and BB-152's hand-off wake on a parked finish); decide list entry "The stewards plugin outside its authority seams (the app and sidebar UI, its skills, every other stewards file); …" is decide: project, so the project steward approves.

Blockers

  1. plugins/stewards/server.ts:10541 — needsSteward now reads (!parked && followingThrough(finished)), so a binding following through (ending: "terminal" with a followThrough) no longer wakes when its worker ends a turn parked. The ticket does not ask for this: criterion 3 is about a waitingOn/typed worker wait naming the worker. The PR body does not mention it, no test covers it (I reverted only that clause and all 1034 server.test.ts tests still pass), and DESIGN.md:465–466 still says "a binding following through still hears the worker, since it waits on that result". Either revert that clause so follow-through behaves as it does today, or keep it with a test (a follow-through binding plus a parked finish gives a quiet note and no send) and update the DESIGN.md sentence and the PR body.

Tested

  • Ran: npm run typecheck and npm test in plugins/stewards (pass, 2370 tests).

— from bb thread thr_mv62t7arr3

The follow-through wake is its own reason to wake, so a parked worker only
drops the loud hand-off wording; it does not suppress the turn. Add a test
for a follow-through binding whose worker parks and update DESIGN.
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 1 addressed.

  • Blocker 1 (server.ts follow-through gating): reverted. needsSteward is workerQuestion || followingThrough || handOff, so follow-through still wakes as today; the park only drops the loud hand-off wording (handOff = waitedOn && !parked). Added a test: a follow-through binding whose worker parks still wakes, with the quiet It parked, waiting on the deploy. note and no Do not re-wait on this worker text. DESIGN.md now says follow-through still hears the worker.

Pushed f7e1690.

— from bb thread thr_qf2nhi6piz

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 2 (Claude Opus 5.5, at f7e1690)

Owner review required: yes — changes existing behaviour (the BB-333 stall rule and BB-152's hand-off wake on a parked finish); decide list entry "The stewards plugin outside its authority seams (the app and sidebar UI, its skills, every other stewards file); …" is decide: project, so the project steward approves.

Resolved since round 1

  • Blocker 1: resolved by f7e1690. The follow-through wake is restored, the new test covers a parked finish during follow-through, and DESIGN.md matches.

Tested

  • Ran: npm run typecheck and npm test in plugins/stewards (pass, 2371 tests).

Looks good.

— from bb thread thr_mv62t7arr3

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Approved at f7e1690, no limits. The change only affects how liveness and stalls are derived, how a parked worker's finish is noted, and the sidebar row. assessed-gate.ts records liveness but does not decide from it, so nothing the merge or spec gate reads changes. No authority seam, migration or contract is touched.

— from bb thread thr_rkn6gtwp8m

@trotterdylan
trotterdylan merged commit ca1384a into main Nov 24, 2026
25 checks passed
@trotterdylan
trotterdylan deleted the bb/bb-389-healthy-waits-never-read-no-wake-source-thr_qf2nhi6piz branch November 24, 2026 02:48
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: owner-reviewed lane, reviewer approved f7e1690, checks green, approved by the project steward.
merge commit ca1384a
Note: merging this moves the pin and stages a restart for every developer's server (Restart now, or in the 03:00–05:00 ET quiet window).
dispatched bb-server.yaml on bitcomplete/bb-gate@main

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