Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions plugins/stewards/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -537,11 +537,14 @@ hard stop is the runaway guard (§12).
- **Questions to you are records.** Whatever the project steward asks you is
a row in the `questions` table, not just a sentence in its reply, so a
compaction cannot lose it and an answer given elsewhere cannot leave it
listed as open. A row is made two ways: when it forwards an escalation to
you (`steward_update { forward }` with the route reaching `me`), bound to
that escalation and its binding; and when it asks you something itself
with `steward_update { ask: { question, context } }`, bound to a binding
when it names one. It closes when the project steward records your answer
listed as open. A row is made when the project steward asks you something
itself with `steward_update { ask: { question, context } }`, bound to a
binding when it names one; and when it forwards a non-approval escalation
to you (`steward_update { forward }` with the route reaching `me`), bound
to that escalation and its binding. A forwarded `approval` escalation is
not a question: it becomes an `approve-spec` need with Approve/Decline
(§18), and the escalation stays open, linked to it. A question closes when
the project steward records your answer
(`steward_update { resolve: "<question id>", answer }`) or when you close
it on the stewards page, with or without an answer. A question made by
forwarding and its escalation close together, in one transaction, from
Expand Down Expand Up @@ -830,7 +833,7 @@ listed under "Waiting on you" on the Stewards page, in the digest, and by

| kind | filed by | link | done when | one-click action |
| -- | -- | -- | -- | -- |
| `approve-spec` | plugin, when the ready gate waits and the playbook's approver is `me` | the ticket | gate approval recorded | **Approve** / **Decline** (with an optional note); Approve records the approval on the gate, as BB-13 does from any surface |
| `approve-spec` | plugin, when the ready gate waits and the playbook's approver is `me`, or when the project steward forwards an `approval` escalation to the user | the ticket | gate approval recorded | **Approve** / **Decline** (with an optional note); Approve records the approval on the gate, as BB-13 does from any surface |
| `approve-pr` | plugin, when a linked pull request is in the owner-reviewed lane, the reviewer's latest marker is `approved`, checks are green, and no owner approval exists | the pull request | owner approval seen in the snapshot | **Approve**: posts the unsigned comment "Approved <sha> from the Stewards page" as the connected user |
| `merge` | plugin, when the lane gate is met and no worker is running, or by a steward whose worker reported a refused merge | the pull request | the pull request merged | **Merge**: the server re-checks the gate itself, squash-merges through the server's `gh` login, posts the "Merged: …" comment, and wakes the steward |
| `decide` | project steward (today's forwarded question) | the entity | answered | **Answer** (the question record's text box) |
Expand Down Expand Up @@ -862,6 +865,15 @@ The rules that hold:
changed", and the wake lists the binding's open items and says not to ask the
user about them in prose. Closing an item from the page or with
`bb stewards done <id>` does the same.
- **A forwarded approval is a need.** When the project steward forwards an
`approval` escalation to the user, the plugin files an `approve-spec` need
on the binding and keeps the escalation open, linked to it
(`data.escalationId`), instead of a free-text question: the binding is
waiting on the user's approval exactly as `approval: me` would be. The
page's Approve and Decline, and `bb stewards done` for Approve, record the
gate verdict and resolve the open `approval` escalations in the same step,
so the project steward is not left holding the request. A forwarded
`decision` escalation stays a question, answered in prose.
- **Dedupe.** A need is keyed by (binding, kind, url) while open: a steward
that re-reports updates the wording rather than adding a row. The store
enforces it with a partial unique index.
Expand Down
6 changes: 5 additions & 1 deletion plugins/stewards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ bb. [DESIGN.md](DESIGN.md) is the design; this is how it is built and run.
escalation with the project steward, or an `approve-spec` item on the
Stewards page when the approver is the user (`approval: me`), whatever
the steward's report says, and closes it once approved or no longer
needed. An approval is recorded from the approver's
needed. When the project steward forwards an `approval` escalation to
you, the plugin files the same `approve-spec` item and keeps the
escalation open, linked to it, so a forwarded approval is answered with
Approve/Decline exactly as `approval: me` is; a forwarded `decision`
stays a question. An approval is recorded from the approver's
words wherever they are: the project steward's guidance that resolves the
request, the user's answer on the Stewards page, their message in the
steward's thread, or their unsigned approving comment on the entity. A
Expand Down
9 changes: 7 additions & 2 deletions plugins/stewards/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,12 @@ function BoardPage({ subPath }: { subPath: string }) {

function ProjectBoard({ board: b, refetch }: { board: Board; refetch: () => void }) {
const now = Date.now();
const waiting = b.questions.length + b.withUser.length + b.needs.length;
// An escalation a need answers is shown as that need's row, not as the raw
// escalation: a forwarded approval is answered with Approve/Decline, not by
// "approve or decline in its steward's thread".
const covered = new Set(b.needs.map((n) => n.escalationId).filter((id): id is string => id !== null));
const withUser = b.withUser.filter((x) => !covered.has(x.id));
const waiting = b.questions.length + withUser.length + b.needs.length;
return (
<>
<div className="flex flex-wrap items-baseline justify-between gap-2">
Expand All @@ -412,7 +417,7 @@ function ProjectBoard({ board: b, refetch }: { board: Board; refetch: () => void
{b.questions.map((q) => (
<QuestionRow key={q.id} question={q} now={now} onClosed={refetch} />
))}
{b.withUser.map((x) => (
{withUser.map((x) => (
<li key={x.id} className="flex flex-col gap-1 p-3">
<p className="flex flex-wrap items-center gap-2">
<EntityLink entityKey={x.key} url={x.url} />
Expand Down
Loading
Loading