From c03f161a0b539ee8970b4371e359a4eb0a6cec12 Mon Sep 17 00:00:00 2001 From: Dylan Trotter Date: Tue, 27 Oct 2026 15:59:04 +0000 Subject: [PATCH 1/2] stewards: wake a steward idle in an active stage (BB-83) --- plugins/stewards/DESIGN.md | 26 +++++- plugins/stewards/app.test.tsx | 4 + plugins/stewards/app.tsx | 10 ++- plugins/stewards/config.test.ts | 4 + plugins/stewards/config.ts | 9 +++ plugins/stewards/reconcile.test.ts | 54 ++++++++++++- plugins/stewards/reconcile.ts | 62 ++++++++++++++ plugins/stewards/server.test.ts | 111 ++++++++++++++++++++++++++ plugins/stewards/server.ts | 93 ++++++++++++++++++--- plugins/stewards/sidebar-app.test.tsx | 24 ++++++ plugins/stewards/sidebar.test.ts | 21 +++++ plugins/stewards/sidebar.ts | 60 +++++++++++--- plugins/stewards/store.test.ts | 16 ++-- plugins/stewards/store.ts | 26 +++++- 14 files changed, 487 insertions(+), 33 deletions(-) diff --git a/plugins/stewards/DESIGN.md b/plugins/stewards/DESIGN.md index dd285fa6..016dd182 100644 --- a/plugins/stewards/DESIGN.md +++ b/plugins/stewards/DESIGN.md @@ -362,6 +362,25 @@ Plugin code. No model turn. terminal state the steward's own last report already named ends the binding from the mechanical tier, with the wrap-up written from that report and no wrap-up wake; a terminal state someone else set still wakes. + Rule 3 has a missing premise, and BB-83 adds it: a quiet finish assumes a + louder event follows — a merge doorbell, a deployment, a terminal state. + When none exists the binding sits with nothing able to wake it, so the + plugin supplies the clock. A binding whose playbook stage is `build` or + `review`, which is not ending or held, with no worker running, no own pull + request open, no deployment watch `merged` or `deploying`, and no + escalation or need waiting on the user, is idle in an active stage. The + reconcile, the requeue tick and the sweep all evaluate that predicate; once + it has held for the playbook's `idle-grace` (15m by default), the steward is + woken with "Nothing is running and nothing is being waited on…" and the + idle clock restarts from that wake. A worker finish that leaves such a + binding is loud at once, without the grace, because the worker's final + message is what the steward must read; a finish that leaves an open pull + request, a pending deployment or a message that says it is waiting stays + quiet as before. The wake fires once per idle period, not once per grace: a + worker ending, an own pull request closing or a deployment watch changing + starts a new period, and a steward that waits on something the plugin + cannot observe is not woken every fifteen minutes. `idleInActiveStage` in + `reconcile.ts` is the whole rule. 4. Otherwise the snapshot is recorded and the ring ends. Most rings end here: the steward's own comments, label churn, its workers at work. What changed is kept as a quiet note and shown with the next turn something @@ -1511,8 +1530,11 @@ project steward footer row is the grey ring. else `on hold`; `stuck` for an open stuck escalation; `N worker(s) running` counting only workers whose worker-table status is `running` (a busy steward or reviewer with no running worker falls through, rather than reading `0 workers -running`); `waiting on ` when the status actor is `other` (an -external wait is not a block, so its colour follows the glyph); the newest +running`); `worker finished, next look