Skip to content

stewards: lift scheduling holds by state and show pull request state in the schedule wake (BB-89) - #117

Merged
trotterdylan merged 2 commits into
mainfrom
bb/bb-89-lift-holds-by-state-pr-state-in-schedule-w-thr_wux63uavkd
Oct 27, 2026
Merged

trotterdylan merged 2 commits into
mainfrom
bb/bb-89-lift-holds-by-state-pr-state-in-schedule-w-thr_wux63uavkd

Conversation

@trotterdylan

@trotterdylan trotterdylan commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Implements BB-89. A scheduling hold behind work whose pull requests have all merged no longer waits for the deploy: on every reconcile of the waiter, the hold lifts once every target satisfies finished (every linked pull request merged and the binding ended, terminal, or reported noMorePulls). The schedule escalation now names each conflicting binding's pull request facts — how many are open and merged, and whether noMorePulls was reported — so the project steward can see merged-but-open work before deciding.

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

Classification

no-review: a tweak (a hold that already meant to lift now lifts by state) plus additive wake text; no existing behaviour removed, no contract, migration, secret or dependency.

What changes

  • server.ts: a level-triggered lift in reconcileOnce for any binding with a non-empty holdBehind, releasing through the existing releaseBehind when every target is finished; conflictsFresh carries the fresh GitHub read into the schedule wake, rendered by pullFacts and howFinished.
  • server.test.ts: the four BB-89 cases (hold placed after all PRs merged with noMorePulls true lifts; with noMorePulls null does not; empty holdBehind never lifted by this path; escalation text shows the PR counts).
  • DESIGN.md, skills/stewards/SKILL.md: the level-triggered lift and the wake text.

Testing

  • npm test in plugins/stewards: pass (688 tests; quality_checks (stewards) also runs this in CI).
  • npm run typecheck in plugins/stewards: pass.

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_ifjsjcszew.

— from bb thread thr_wux63uavkd

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (GLM 5.3, at 86f46ab)

Owner review required: no — none of the owner-reviewed triggers apply. The behaviour change is a tweak: a hold that already meant to lift once its targets were finished now lifts by state (level-triggered) instead of only on the merge edge; nothing that worked one way works another, and the wake text is strictly additive. No contract file touched (source-contract.ts untouched), no store migration (store.ts untouched), no secret, no dependency, and no bigDecisions path in .bb/stewards/project.json matches the four changed files (plugins/stewards/server.ts, server.test.ts, DESIGN.md, skills/stewards/SKILL.md).

Blockers

None.

Suggestions

  • server.ts:1098 — atWorkFresh now has no callers (both call sites go through atWorkWithRead); it survived the refactor as dead code. Delete it, or leave it — the typecheck passes either way.
  • server.ts:3810 (pullFacts) — when the fresh GitHub read is incomplete (a linked pull request failed to read, complete: false), the facts count only the pulls that were read, so an unread open pull request understates "open". The judgement errs correctly (the binding stays at work), and the steward checks the pull requests before deciding anyway, but the facts line could say "read incomplete" in that case so the steward knows to look twice. Optional.
  • The PR body's Testing section says the stewards suite is "not in the CI matrix" — it is (quality_checks (stewards) is in .github/workflows/plugins.yaml and is running on this PR). Worth a body edit for the record; no code impact.

Checked

  • Ran myself: npm install, npm run typecheck and npm test in plugins/stewards on the head — typecheck clean, 688/688 tests pass in 21 files (~59s). Stewards is in the CI matrix, so this doubles the green check rather than filling a gap.
  • Verified the four new tests do their job by reverting only server.ts to the parent and re-running them: "lifts a hold placed after its target merged and reported noMorePulls" fails without the change (the lift is new behaviour), "names the open and merged pull request counts in the schedule escalation" fails without it (the counts are new), and the two guards (noMorePulls unreported → no lift; empty holdBehind → never lifted by this path) pass either way, as guards should.
  • Verified against ticket:
    • AC 1 met — the level-triggered block in reconcileOnce releases only when every target satisfies the existing finished (all linked pull requests merged and ended/terminal/noMorePulls; pr bindings by merges alone), through releaseBehind, so the waiter wake, the binding note, the project note, the multi-target partial release ("your hold stays until …") and the first-by-priority-then-age re-hold of overlapping waiters are all the same path as today; empty holdBehind is untouched; unresolved target keys block the lift (no silent partial release).
    • AC 2 met — each conflict now reads KEY (phase; N open, M merged, no more pull requests: reported/not reported), facts only, and the question text beyond the parenthetical is unchanged, so the recommendation is still just the two existing options.
    • AC 3 met — all four required tests are present, plus the two pre-existing wake-text assertions updated for the new parenthetical.
    • AC 4 met — DESIGN.md ("Holds that wait behind other bindings lift by state…") and the plugin's stewards skill both describe the level-triggered lift and the wake facts.
  • Out of scope respected: atWork itself untouched, atWorkFresh's semantics preserved through the atWorkWithRead split (the null-read fallback recomputes runningWorker at the same point it is consumed), hold reason still one field, plugins/stewards only.
  • Restart safety: the lift is recomputed from store state on every reconcile, so it survives a server restart mid-hold; the same trust in a target's lastSnapshot that the existing edge path and atWork already rely on.

— from bb thread thr_ifjsjcszew

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 1 suggestions addressed at fc33547:

  • Dead atWorkFresh: removed; both call sites already go through atWorkWithRead.
  • Incomplete read in pullFacts: taken — atWorkWithRead/conflictsFresh now carry complete, and the facts line ends with (read incomplete) when a linked pull request could not be read. DESIGN.md updated to match.
  • PR body Testing line: corrected — quality_checks (stewards) does run the suite in CI.

Local npm run typecheck and npm test (688 tests) are green on fc33547.

— from bb thread thr_wux63uavkd

@trotterdylan
trotterdylan merged commit 6011781 into main Oct 27, 2026
20 checks passed
@trotterdylan
trotterdylan deleted the bb/bb-89-lift-holds-by-state-pr-state-in-schedule-w-thr_wux63uavkd branch October 27, 2026 17:45
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: no-review lane, reviewer approved 86f46ab (round 1), checks green. Since then: removed dead atWorkFresh, pullFacts reports (read incomplete) when a linked pull request could not be read, and the PR body Testing line was corrected — all three from the reviewer's round 1 suggestions. merge commit 6011781.

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

— from bb thread thr_wux63uavkd

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