From e75c0baf57d00a294e9cb4cd2114698c4a0b86a7 Mon Sep 17 00:00:00 2001 From: Dylan Trotter Date: Mon, 26 Oct 2026 18:54:49 +0000 Subject: [PATCH 1/2] stewards: bb stewards needs lists the needsYou set (BB-69) --- plugins/stewards/server.test.ts | 54 +++++++++++++++++++++++ plugins/stewards/server.ts | 32 +++++++------- plugins/stewards/skills/stewards/SKILL.md | 2 +- 3 files changed, 71 insertions(+), 17 deletions(-) diff --git a/plugins/stewards/server.test.ts b/plugins/stewards/server.test.ts index 56209fe8..478ff859 100644 --- a/plugins/stewards/server.test.ts +++ b/plugins/stewards/server.test.ts @@ -4077,6 +4077,60 @@ describe("needs you items", () => { }); }); +// BB-69: the CLI lists the same "waiting on you" set the Stewards page and the +// sidebar do, in the same order: open questions, with-user escalations, needs. +describe("bb stewards needs lists the needsYou set (BB-69)", () => { + type BoardView = { questions: Array<{ id: string }>; withUser: Array<{ id: string }>; needs: Array<{ id: string }> }; + + async function adopted() { + const t = await setup(); + t.entities.set("uuid-12", issue()); + await t.ring("linear", "uuid-12"); + const binding = () => t.hooks.store.find("ENG-12", "p1")!; + const board = async () => ((await t.harness.callRpc("stewardsBoard", { projectId: "p1" })) as { board: BoardView }).board; + const cli = async () => (await t.harness.behavior.runCli(["needs", "--project", "p1"])).stdout; + return { ...t, binding, board, cli }; + } + + it("prints an open question before a need, with its choices and the done command", async () => { + const t = await adopted(); + const b = t.binding(); + const question = t.hooks.store.ask({ projectId: "p1", bindingId: b.id, escalationId: null, question: "Merge or close?", context: null, choices: ["Merge", "Close"] }); + const need = t.hooks.store.fileNeed({ bindingId: b.id, kind: "configure", url: "", what: "Enable the flag", how: null }); + const out = await t.cli(); + expect(out).toContain(question.id); + expect(out).toContain(need.id); + // The question comes first. + expect(out.indexOf(question.id)).toBeLessThan(out.indexOf(need.id)); + expect(out).toMatch(new RegExp(`${question.id} — question, ENG-12: Merge or close\\? \\[choices: Merge, Close\\] — bb stewards done ${question.id} --choice "