Repository navigation
stewards: worker_park and one explicit parked state (BB-329) - #363
trotterdylan merged 1 commit into
Conversation
|
Independent review running in bb thread @thread:thr_692pjrgvv3. — from bb thread thr_665nbvarr7 |
Review round 1 (glm-5p3, at 18b550a)Owner review required: yes — self-widening paths are in the changed-file set ( Reviewed the behaviour slice as it stands (parent 8c8feb2 → 18b550a); the rest of the diff is the stacked #358/#361 content, under its own reviews. The base branch has since moved to ee9c03a (#361 rounds 1–2), so the rebase onto it — and onto ProductOne new tool, Blockers
Tested
— from bb thread thr_692pjrgvv3 |
18b550a to
10201fd
Compare
|
Round 1 addressed at 10201fd (rebased onto the refactor head ee9c03a). Blockers
Other
— from bb thread thr_665nbvarr7 |
Review round 2 (glm-5p3, at 10201fd)Owner review required: yes — the slice alters what the merge gate reads ( Resolved since round 1
Tested
— from bb thread thr_692pjrgvv3 |
|
Approved 10201fd from the Stewards page |
ee9c03a to
21db8fb
Compare
10201fd to
aa054d1
Compare
21db8fb to
cdfdc3e
Compare
Adds the one-argument additive worker_park tool; makes the assessment's parked state explicit and driven by that call; retires the worker-text regexes ERROR_REPORT/workerReportedError and WAITING/workerWaiting and routes every surface through assessment.worker (namesUserAsBlocker and unheardWait stay as named exceptions); updates the build-tickets and pr-reviewer skills and the DESIGN/README wording; pins the plain-finish surfaces in tests.
aa054d1 to
6463c52
Compare
|
Merged: owner-reviewed lane, reviewer approved 10201fd, checks green, approved by the owner, escalated by the reviewer to the owner. |
Implements BB-329, the behaviour slice (slice 2 of 2) of BB-291 criterion 2. Slice 1 is the refactor, bitcomplete/bb-plugins#361; this PR is stacked on that branch and retargets to
mainonce #361 merges.Classification
owner-reviewed: a new tool and the merge-gate/authority seam (
assessment.tsworker state, the parked-worker merge deferral), thebigDecisions/prGate-adjacent surface. The reviewer classifies viabb stewards gate.What changes
worker_park { waitingOn }(one additive string argument). It sets only the calling worker's own park on its own open binding, files nothing for the user, and meets no gate. A refused call (a non-worker thread, an ended binding) returns an error, never a silent no-op. The worker's next turn (thread.active, a retry) clears the park.assessment.worker.parkedis now explicit, driven by that call. Afinishedworker that did not park is a newfinishedstate, notparked.inFlightis unchanged (running-or-finished);reasonis unchanged.ERROR_REPORT/workerReportedErrorandWAITING/workerWaiting, and every consumer: the finish handler, the quiet-archive, the parked-worker merge deferral, and the idle wake. Every surface now readsassessment.worker.build-ticketsandpr-reviewertell a worker to end a waiting turn withworker_parkinstead of relying on prose;DESIGN.md(BB-52 rule 3 and BB-83) andREADME.mdare corrected where they still said a final message's error report or "waiting" text keeps a finish quiet.ALTER TABLE workers ADD COLUMN parked_waiting_on TEXT(appended at the end ofMIGRATIONS,migrations.snapshot.jsonextended).Predicates, flags, regexes and silent branches retired
wake.tsERROR_REPORT/workerReportedError— deleted.wake.tsWAITING/workerWaiting— deleted.server.tsfinish handling:workerReportedError(result)andworkerWaiting(result)— replaced by the explicitworker.parkedWaitingOn.archiveFinishedWorkers's!workerWaiting(w.result)filter — replaced byw.parkedWaitingOn === null.archiveParkedWorkers's "any finished worker" filter — narrowed tow.parkedWaitingOn !== null.server.tsparkedWorkerOwnsAnother'sstore.workers(b.id).some(w => w.status === "finished")— replaced byassessment.worker.parked.worker_parkreturnsisError, and the parked flag is written by one method (store.parkWorker).Named exceptions (unchanged, per the project steward's amendment)
namesUserAsBlocker(BB-213 refusal) stays inreconcile.tsand itssteward_reportrefusal.unheardWaiton steward text stays inreconcile.ts, read by the wake flags and the board flags.ops.ts'sBAD_WAITINGis an unrelated k8s reason set.grep -nE 'WAITING|ERROR_REPORT|unheardWait|namesUserAsBlocker' plugins/stewards/*.tsmatches only tests,BAD_WAITING, and the two named exceptions. Neither exception's check got weaker.Intended gate differences (proposed as a Revision on BB-291)
worker_parkcall is a plain finish, whatever its text says ("waiting", "parked", "awaiting" in prose changes nothing). It is archived and no longer keeps the binding non-idle. In-flight case: a worker started before the restart (or whose prompt predates the new skill) finishes without the call, so a "waiting" final message becomes a plain finish — it is archived and its pull-request activity is no longer quieted by it.workerReportedErroris retired, not replaced. A final message beginning "Error:" / "Unable to" / "I could not" no longer wakes the steward; it is a plain finish. A hard failure still arrives throughthread.failed. (The spec's shape amendment retired the regex rather than replacing it.)parkedWorkerOwnsAnotherreads explicit parked. A plain-finished worker with a second open own pull request no longer defers the plugin merge; only a worker that calledworker_parkdoes. Previously anyfinishedworker deferred.archiveFinishedWorkersno longer keeps a worker for its final text, andarchiveParkedWorkersonly retires explicit parked workers; the quiet-archive's predicate is the same in spirit but keyed on the call.state: a finished worker that did not park is namedfinished(new value) rather thanparked.parkedis the explicit sub-state.inFlightandreasonare unchanged.parkedWorkerOwnsAnothernow reads the assessment the reconcile already built instead of callingstore.workers(b.id)again. No source calls added.bb stewards divergences(before starting)The log shows worker-state rows only in the parked-worker shape:
workerInFlightin-flight → parked,runningWorkerReasonnot-mid-turn → parked,idleInActiveStageidle → parked,hasLiveWakeSourceno-live-source → parked, across the live bindings that hold afinishedworker (the known BB-292 parked-worker fixtures and the parked workers of other bindings). No other worker-state disagreement. ThenoWakeSourcerows are the separate surface BB-247 introduced, unchanged by this PR.BB-291 Baseline (recorded 2026-11-14)
stewardsBoard1513 ms,stewardsSidebar3271 ms,stewardsRing2 ms.read-counts.test.ts, 4 bindings): 45.75 reads per reconcile, 15 per wake, 3.0 source calls per reconcile, 0 per wake.This PR: no added network reads. The derivation reads only the worker row the reconcile already holds (
parkedWaitingOnis a column on it). The fixture is now 193 store reads / 4 = 48.25 per reconcile, 12 source calls / 4 = 3.0, wake 15 / 1 = 15 reads, 0 source calls — one store read fewer than the refactor branch (194), from reading the assessment instead ofstore.workers(b.id)a second time. Theworker_parktool is one column write. The live handler maxima are unchanged in kind; the reconcile gains no read and the tool is not on a handler path. (livenumbers are the recorded baseline; the live server runs the pre-change build, so they are not re-measured here.)Testing
npm testinplugins/stewards: pass (1829 tests; also run by the CI matrix'squality_checks (stewards)job, green on this PR).npm run typecheck: pass.read-counts.test.tspins the new fixture (193/12/4, wake 15/0).store.test.tspins the append-only migration (the new group is last;migrations.snapshot.jsonextended).worker_parkcall with final text that does not say it waits stays unarchived;worker_parkon a non-worker thread and an ended binding refused; the next turn clears the park; a plain finish with "Error:" text is not a park.grep -nE 'WAITING|ERROR_REPORT|unheardWait|namesUserAsBlocker' plugins/stewards/*.tsmatches only tests,BAD_WAITING, and the two named exceptions.Stacking
Base is
bb/bb-329-refactor-pr-one-worker-busy-predicate-thr_885vv4w5us(#361), notmain. Rebase onto it whenever it moves; after #361 merges, rebase ontomainand retarget before merging (no new approval needed). The head branch is not deleted (--delete-branchis not used): BB-328's PR is stacked on this one until retargeted.