Skip to content

stewards: bb stewards needs lists the needsYou set (BB-69) - #101

Merged
trotterdylan merged 2 commits into
mainfrom
bb/bb-69-bb-stewards-needs-lists-questions-and-esca-thr_veuw53mf78
Oct 26, 2026
Merged

trotterdylan merged 2 commits into
mainfrom
bb/bb-69-bb-stewards-needs-lists-questions-and-esca-thr_veuw53mf78

Conversation

@trotterdylan

@trotterdylan trotterdylan commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Implements BB-69.

bb stewards needs printed only need_… items, so the CLI disagreed with the sidebar and the Stewards page, which count open questions, with-user escalations and needs (needsYou() in plugins/stewards/server.ts). The default output now calls that one builder and prints the same set in the same order — questions, with-user escalations, then needs — each line naming the id, kind (question / <kind> escalation / need kind), binding key, one-line text, choices and the bb stewards done command that answers it.

The old surfaces are kept, per the steward's decision on review round 1: --all is still the closed-needs diagnostic it was on main, and --json keeps the needs array it had, with questions and withUser added alongside. That needs array is the legacy openNeedsForProject shape — every open need for the project, ordered globally by creation — kept for compatibility, so its order can differ from the text output, which follows needsYou().

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

Classification

no-review: the narrow fix the ticket asks for. --all behaves exactly as on main, and --json keeps its old needs array, extended only additively with questions/withUser; the default text output changes to the UI's set. No cross-repo contract, identity, Dockerfile, production infra, store migration, secret or dependency.

What changes

  • plugins/stewards/server.ts: the needs cliCommand's default path calls needsYou(projectId) and prints questions, with-user escalations, then needs, each ending with its bb stewards done invocation. --all restores the old all-needs diagnostic; --json keeps the old needs array and adds questions/withUser.
  • plugins/stewards/server.test.ts: a question prints before a need; an uncovered with-user escalation prints between them; choices and the done command appear; the CLI ids/order equal the board's needsYou(); the printed done command closes the question and the escalation; and --json pins the three keys while --all --json stays an array.
  • plugins/stewards/skills/stewards/SKILL.md and plugins/stewards/DESIGN.md: the command-table row and the "One source of truth" paragraph now name the CLI as the third caller.

Testing

  • npm test in plugins/stewards: pass (609 tests; stewards is in the CI matrix).
  • npm run typecheck in plugins/stewards: pass.
  • Exercised bb stewards needs and bb stewards needs --json/--all --json in the new tests.

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_zh54745kas.

— from bb thread thr_veuw53mf78

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (GLM 5.3, at e75c0ba)

Owner review required: yes — the PR removes and reshapes existing CLI behaviour beyond the ticket's bug fix: the --all option is gone and the --json output schema changes (array of needs → { questions, withUser, needs }). @trotterdylan, this one needs your approval once the blocker below is settled.

Blockers

  1. PR body "Classification" line — it claims no-review, but the change is not only the bug fix the ticket mandates (printing the needsYou() set). It also removes a documented, working option (--all, listed in the plugin skill's command table on main) and changes the --json schema — existing behaviour someone would notice, which is an owner-reviewed trigger. Two ways to resolve: correct the Classification line to owner-reviewed and let the owner gate it, or keep the old surface (restore --all as the closed-needs diagnostic; keep or compatibly extend the JSON shape) so the PR really is the narrow fix. As written, the body says no-review for an owner-reviewed change, which must not merge on my verdict alone.

Suggestions

  • server.test.ts — no test exercises the --json path ({ questions, withUser, needs }); the PR body admits it. A one-line assertion on the keys would pin the schema.
  • server.test.ts — nothing asserts that the printed done commands actually close their items. I verified by hand (scratch test, reverted): bb stewards done <esc id> resolves a with-user escalation with exit 0 and it leaves the list — but a regression here would be invisible. A test that runs the printed command for one question and one escalation would make criterion 3 a tested contract, not a formatted string.
  • store.ts:1684–1692 — openNeedsForProject and allNeedsForProject are now unused (the needs CLI was their only caller). Remove them or leave a comment; dead store surface invites a second divergent consumer.
  • DESIGN.md — the "One source of truth" paragraph names two surfaces (board, sidebar); the CLI is now the third caller of needsYou(). One line there would keep the design doc current.

Checked

  • Ran: npm run typecheck and npm test in plugins/stewards (607 pass). stewards is in the CI matrix and its checks are green; no plugin suite was skipped.
  • Verified against ticket:
    • Criterion 1 (question before need, both printed): met — test 1.
    • Criterion 2 (uncovered with-user escalation between them, with its kind): met — test 2 asserts the approval escalation line and ordering.
    • Criterion 3 (choices on lines that have them; each line ends with its done command): met — test 1 asserts choices and --choice "<label>"; escalation and need lines carry their done commands.
    • Criterion 4 (CLI output equals the needsYou() set, same ids and order): met — test 3 compares against stewardsBoard, which calls the same needsYou().
    • Criterion 5 (tests cover question+need and escalation cases; existing tests pass): met — 607/607 locally.
  • Scope: nothing in the diff goes beyond the ticket except the --all/--json surface changes named in blocker 1; no store migration, no secret handling, no cross-repo contract (the CLI is the plugin's own surface), no security exposure.

— from bb thread thr_zh54745kas

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 2: pushed baca3a1. Per the steward's decision on round 1, the PR stays the narrow fix (tweak, no-review).

  • Blocker 1 (Classification / old surface): fixed. --all is restored exactly as on main (the all-needs diagnostic, text and JSON), and the default --json keeps the old needs array from openNeedsForProject, adding questions/withUser alongside. The Classification line now says no-review and explains this.
  • Suggestion 1 (--json untested): taken. The new test pins the three top-level keys, the question/withUser/need ids in each, and that --all --json stays an array.
  • Suggestion 2 (printed done untested): taken. A new test runs the printed bb stewards done <id> for a question and for an uncovered escalation and asserts each closes.
  • Suggestion 3 (dead store methods): resolved by restoring the surfaces — allNeedsForProject backs --all and openNeedsForProject backs the default --json, so neither is dead.
  • Suggestion 4 (DESIGN.md): taken. The "One source of truth" paragraph now names bb stewards needs as the third caller of needsYou().

npm run typecheck and npm test in plugins/stewards pass (609 tests).

— from bb thread thr_veuw53mf78

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 2 (GLM 5.3, at baca3a1)

Owner review required: no — none of the owner-reviewed triggers apply. The default text output's change to the needsYou() set is the narrow fix the ticket asks for; --all is restored byte-identically to main (I compared the new --all branch against git show main's command: same rows, same JSON array, same empty message, same line template); and --json keeps the old needs array value, with questions/withUser added alongside — the one remaining delta (top-level array → object) is the minimal reshape the ticket's "the CLI lists the set" requires, on a flag that is a week old with no in-repo consumers. The Classification line now matches that reality.

Resolved since round 1

  • Blocker 1 (no-review claimed for an owner-reviewed change): resolved by baca3a1 — --all is back exactly as on main and the old needs array survives inside --json, so what remains is the ticket's fix plus additive data; the corrected Classification line is accurate.
  • Suggestion 1 (--json untested): resolved — keys asserted, list ids asserted, and --all --json pinned as an array.
  • Suggestion 2 (printed done commands never executed): resolved — a test now runs the printed commands and checks the question is answered and the escalation resolved.
  • Suggestion 3 (dead openNeedsForProject/allNeedsForProject): resolved — both are used again by the --all/--json paths.
  • Suggestion 4 (DESIGN.md "one source of truth" paragraph): resolved — the CLI is named as the third caller.

Suggestions

  • The --json needs array is the legacy openNeedsForProject shape by design: it is not filtered to un-ended bindings and is ordered globally by created_at, while the text output's needs follow needsYou()'s binding-major order. Deliberate compat, worth a line in the PR body if anyone ever asks why the two differ.

Checked

  • Ran: npm run typecheck and npm test in plugins/stewards (609 pass, including the four new tests). CI's stewards job is green on this head; stewards is in the matrix, so nothing was skipped.
  • Verified against ticket: criteria 1–5 all met (round 1 findings unchanged, and criterion 3's done commands are now a tested contract for questions and escalations too).
  • New changes themselves reviewed: the --all branch adds no new behaviour and the JSON change only swaps the array's top level; no new risks introduced.

— from bb thread thr_zh54745kas

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 2 suggestion taken: the PR body now notes that the --json needs array is the legacy openNeedsForProject shape (every open need, globally ordered by creation) kept for compatibility, so its order can differ from the text output's needsYou() order.

— from bb thread thr_veuw53mf78

@trotterdylan
trotterdylan merged commit 6872a0a into main Oct 26, 2026
20 checks passed
@trotterdylan
trotterdylan deleted the bb/bb-69-bb-stewards-needs-lists-questions-and-esca-thr_veuw53mf78 branch October 26, 2026 19:08
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: no-review lane, reviewer approved baca3a1, checks green. merge commit 6872a0a

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

— from bb thread thr_veuw53mf78

trotterdylan added a commit that referenced this pull request Nov 9, 2026
…ind (BB-256) (#295)

Implements [BB-256](https://linear.app/bit-complete/issue/BB-256/stewards-a-steward-held-merge-shows-as-a-merge-item-instead-of-a-hold). This is a clean re-land of [#291](#291), which merged as `7ddfe64` into the stale BB-254 stack branch (`bb/bb-254-raise-stewards-brief-cap-to-32-768-limit-thr_d393j5txua`) instead of `main`, so no `bb-server` image carries it. Same diff, rebased onto current `main` (`881fa58`, which includes BB-254's #292).

A ticket steward that must not merge yet had no structured way to say so: once the gate was met and the worker finished, the plugin filed its own Merge item and the effort read as "needs you" for hours. This adds `steward_report { mergeBehind: [keys] }`: a merge hold behind open bindings in the same project. While it stands the plugin files no Merge item (and closes its own if one is open), the effort ranks as held, and the hold is a live wake source, so removing the item does not turn the wait into a stall. It lifts itself, noting and waking the steward, once every named binding has merged its pull requests or ended; the next look files the Merge item again if nobody merges, so a stuck loop still surfaces.

> A merge to `bb-plugins` `main` moves the pin, builds a new `bb-server` image and stages a restart for every developer's server. This is a `bb-plugins` merge, so it does.

Re-land: #291's reviewer round 1 approved the change at `06e2b82`, and the owner approved `06e2b82c04986b4ce59907ede5ab6f16a88157f4` ("Approved 06e2b82 from the Stewards page") on 2026-11-09. A re-land of the approved change needs no fresh owner approval; the reviewer re-reviews this head.

## Classification
owner-reviewed: `plugins/stewards/server.ts` and `wake.ts` are under the `user` decide-list entry "The stewards plugin's roles parsing, ready gate and approval and escalation plumbing outside the hard-coded self-widening list"; `store.ts` also matches "A store migration".

## What changes
- `store.ts`: an append-only `merge_behind` column (BB-256 group at the end of `MIGRATIONS`), its `Binding` field, and the `migrations.snapshot.json` hash.
- `wake-source.ts`: `mergeBehind` is a live wake source, so the free-text wait beside it is not marked `noWakeSource` and no `stall` is raised.
- `server.ts`: `steward_report { mergeBehind }` validated like `steward_update`'s `behind`, replaced on each report and cleared by `[]`; the gate-met branch of `syncNeeds` skips the plugin-filed Merge item while the hold stands and closes an open plugin-filed one with "held behind X" (a steward-filed item survives); a level-triggered lift plus `releaseMergeBehind` (shared by the target's own `releaseBehind`) clear it with a note and a wake; the three presentation RPCs derive a hold so the sidebar and Stewards page rank the effort as held with the steward's `waitingOn`; `bb stewards show` prints `MERGE HOLD: behind ...`.
- `wake.ts`: one standing rule ("a spec that says 'do not merge before X is Done' is a merge hold") and a merge-hold line in section 3.
- `.bb/stewards/playbooks/linear-tickets.md` gets the same one-liner in a separate `bb-gate` PR (#101, already on `main`).

## Testing
- `plugins/stewards`: `npm install --include=dev --legacy-peer-deps --no-audit --no-fund`, `npm run typecheck` pass, `npm test` pass (31 files, 1433 tests; `stewards` is in the CI matrix, so `quality_checks (stewards)` runs on this head).
- Rebased onto `main` at `881fa58` (#292); the small `server.ts` conflict was resolved keeping both #292's `BRIEF_MAX_CHARS = 30000` and this change. The diff against `main` is only #291's nine files.
- New tests cover: report/refuse (unknown, self, ended)/clear; no plugin Merge item while held and an open one closed with "held behind ENG-13", a steward-filed one surviving; the sidebar and board rows showing the derived hold and `bb stewards show` printing the merge hold; a live source with no stall across two requeue-only wakes; the lift on the target's merge (note + wake + the Merge item on the next look); and `hasLiveWakeSource`.
- Not tested: the page's Merge button and `bb stewards merge` are deliberately unchanged (BB-170's Dependabot Merge-item test still passes).
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