Skip to content

stewards: fixed choices on decide items and forwarded questions (BB-20) - #48

Merged
trotterdylan merged 2 commits into
mainfrom
bb/bb-20-choices-on-decide-items-and-questions-thr_7uki4b7iuy
Oct 20, 2026
Merged

trotterdylan merged 2 commits into
mainfrom
bb/bb-20-choices-on-decide-items-and-questions-thr_7uki4b7iuy

Conversation

@trotterdylan

Copy link
Copy Markdown
Collaborator

Implements BB-20.

A decide need and a forwarded decision escalation can now carry two to
six short choices, so the Stewards page shows a button per option instead
of asking the user to type a word the steward has to parse.

Merging this to bb-plugins main moves the pin and rebuilds the
bb-server image; every developer's server is staged for a restart. It
restarts when its owner presses Restart now, or in the quiet window
(03:00–05:00 US Eastern).

Classification

owner-reviewed: a store migration (new nullable choices columns on
escalations and questions) and new test-only dependencies (jsdom and
@testing-library, for the page render test).

What changes

  • steward_report { needs } takes an optional choices list (2–6 short,
    distinct labels) for a decide item; it is stored in the item's data
    and offered only to decide. steward_report { escalate } takes the
    same, stored on the escalation and copied to the question when the
    project steward forwards it.
  • The page renders one button per choice, a note field and Other…
    (which reveals the text box with Answer) for a decide item or a
    question with choices; a text-only one shows Answer, never Done.
    configure keeps Done.
  • stewardsNeedAction gains a choose action and stewardsAnswerQuestion
    a choice; choosing closes with "Chose: " plus the note, saves
    the choice and note as guidance on the binding, and wakes the steward
    with "The user chose for ". A forwarded escalation
    answered by a choice resolves with the choice as its guidance, like
    steward_update { guidance, resolve }.
  • bb stewards done <id> --choice <label> [--note …] does the same for
    need and question ids and refuses a label not among the choices;
    bb stewards needs, bb stewards show, the digest and every wake print
    the choices after the item.
  • The stewards skill, the wake's standing rules, DESIGN.md §18 and the
    README describe choices; the decide row says Answer or a choice.
  • Out of scope, as the ticket says: multi-select, and choices on
    approve-spec, approve-pr, merge, provide-secret or configure.

Testing

  • npm test in plugins/stewards: pass (254 tests, 12 files).
  • npm run typecheck in plugins/stewards: pass.
  • New server tests cover criteria 1, 2, 4 and 5: the decide item's
    buttons/closure/guidance/wake, the escalation→question carry and
    resolution, the CLI --choice refusal and recording, and the choices
    in needs/show/the digest.
  • New app.test.tsx render tests cover criterion 3: one button per
    choice plus Other… for a with-choices item/question, and Answer
    (not Done) for a text-only one, with configure still Done.

— from bb thread thr_7uki4b7iuy

A decide need or a forwarded decision escalation can carry two to six
short choices, stored on the need's data and on the escalation and the
question a forward makes. The page renders a button per choice, a note
field and Other..., and Answer instead of Done for a text-only item;
configure keeps Done. Choosing closes with "Chose: <label>", saves the
choice and note as guidance and wakes the steward; a forwarded
escalation resolves with the choice as guidance. bb stewards done takes
--choice/--note for need and question ids and refuses a label not among
the choices; needs, show, the digest and every wake print them.
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_cuk8cqdnxi.

— from bb thread thr_7uki4b7iuy

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (GLM 5.3, at eb607f8)

Owner review required: yes — a store migration (two new ALTER TABLE … ADD COLUMN choices entries appended to MIGRATIONS) and new dependencies (jsdom, @testing-library/react, @testing-library/dom, @types/react-dom, react-dom — test-only, but the trigger does not qualify by kind). @trotterdylan, this one needs your approval.

Suggestions

  • server.ts (steward_report → escalate schema): choices is accepted on every escalation kind (blocked, scope, conflict, stuck too), while the needs path refuses choices on any non-decide kind. Benign today — choices only surface when a forwarded escalation becomes a question, whatever its kind — but restricting to kind: "decision" (or a line in the describe text saying it is for decisions) would keep the two surfaces symmetric. Declinable as-is.
  • DESIGN.md has two sections numbered 18 ("Ops stewards" and "Needs you items and one-click actions") — pre-existing, not introduced here, but since this ticket is the one touching "§18", a docs-only renumbering would be a natural follow-up.
  • bb stewards done <qst> --note … without --choice still discards the note ("Closed from a thread."), pre-existing behaviour the new --choice/--note pairing sits beside. Not this ticket's problem.

Checked

  • Ran: npm install && npm run typecheck && npm test in plugins/stewards — pass (254 tests, 12 files, including the new jsdom app.test.tsx). The CI matrix does include stewards, and its run on this head is green; I ran the suite independently anyway.
  • Migration safety: the two new MIGRATIONS entries are appended, no existing entry edited; columns are nullable and toEscalation/toQuestion fall back to [] on NULL or bad JSON, so a previous build reads and writes these tables unchanged and a pin revert rolls back cleanly.
  • Correctness: the choose paths (page RPC and CLI) mirror the existing free-text close paths — answer/closeNeedByKey plus guidance, note, scheduleReconcile; store.answer gained a default 4th resolution argument so existing callers are unchanged; deduped re-reports update data and therefore the choices; idempotent on retry ("already closed"); no new caller surface (both RPCs still require experimental_caller.kind === "client").
  • Verified against ticket:
    • Criterion 1 (buttons per choice, closure, guidance, "The user chose " under What changed): met — server test + app.test.tsx.
    • Criterion 2 (choices carried escalation → forwarded question, same buttons, choice resolves the escalation with that guidance and wakes the escalating steward): met.
    • Criterion 3 (Answer, not Done, for a text-only decide item or question; configure keeps Done): met — app.test.tsx.
    • Criterion 4 (bb stewards done <id> --choice X behaves as the button and refuses a foreign label, exit 1): met for both need and question ids.
    • Criterion 5 (needs, show, digest/wakes print the choices): met.
    • Criterion 6 (skill, DESIGN.md §18, the decide table row now says Answer or a choice): met.
    • Out-of-scope list (multi-select, choices on approve-spec/approve-pr/merge/provide-secret/configure) respected; the needs path actively refuses non-decide choices.

— from bb thread thr_cuk8cqdnxi

Restrict an escalation's choices to a decision, as a decide need is,
and let bb stewards done --note without --choice keep the note as the
answer and guidance rather than discarding it.
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 1 addressed in 4cf6e48:

  • Suggestion (escalate choices on every kind): fixed. steward_report { escalate } now refuses choices unless kind: "decision", symmetric with the decide-only rule on needs; the parameter's description says "decision only". Added a test.
  • Suggestion (--note without --choice discarded): fixed. bb stewards done <id> --note … now keeps the note as the answer and guidance for a need or question, rather than closing with "Closed from a thread." Added a test.
  • Suggestion (two §18 sections in DESIGN.md): declined. Pre-existing and outside this ticket; renumbering would touch cross-references in other docs, so it is better as its own docs change.

npm run typecheck and npm test in plugins/stewards pass (255 tests, 12 files) on 4cf6e48.

— from bb thread thr_7uki4b7iuy

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 2 (GLM 5.3, at 4cf6e48)

Owner review required: yes — unchanged from round 1: a store migration (the two ALTER TABLE … ADD COLUMN choices entries) and new test dependencies. @trotterdylan, this one needs your approval; my round-1 approval was given on eb607f8 and this push only implements my suggestions, so per the approval rules it still stands — this marker repeats it on the new head.

Resolved since round 1

  • Suggestion 1 (escalate choices accepted on any escalation kind): resolved — steward_report now refuses with "choices are for a decision escalation" when escalate.choices is set on a non-decision kind, the describe text says "decision only", and a new test covers the refusal (no escalation filed).
  • Suggestion 3 (bb stewards done --note without --choice discarded the note): resolved — the note is now kept as the question's answer / the need's resolution, saved as guidance, and recorded in the binding note, for both the question path and the generic need path, with a new test. This also brings the CLI in line with the page, which already saved the note as guidance on these paths.
  • Suggestion 2 (the duplicate §18 numbering in DESIGN.md): declined as pre-existing and out of scope — reasonable.

Checked

  • Diff eb607f8 → 4cf6e48 reviewed in full: both changes are exactly the suggestions, plus their tests; nothing else moved (package-lock only).
  • Ran: npm run typecheck && npm test in plugins/stewards on 4cf6e48 — pass (255 tests, 12 files). CI on this head is green across the matrix (stewards included).
  • Re-classified: the fixes do not add or remove an owner-reviewed trigger; the lane is unchanged.

— from bb thread thr_cuk8cqdnxi

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

LGTM

@trotterdylan
trotterdylan merged commit 5cf25c1 into main Oct 20, 2026
18 checks passed
@trotterdylan
trotterdylan deleted the bb/bb-20-choices-on-decide-items-and-questions-thr_7uki4b7iuy branch October 20, 2026 16:27
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: owner-reviewed, reviewer approved 4cf6e48 (round 2), checks green, approved by trotterdylan on 4cf6e48 (comment 2026-10-20T16:26:42Z).

Squash-merged as 5cf25c1. Merging to bb-plugins main moves the pin and rebuilds the bb-server image; every developer's server is staged for a restart, which happens when its owner presses Restart now or in the quiet window (03:00–05:00 US Eastern).

— from bb thread thr_7uki4b7iuy

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