Skip to content

stewards: stand-up resolves a gate item's pull request key and briefs its substance (BB-309) - #342

Merged
trotterdylan merged 2 commits into
mainfrom
bb/bb-309-stand-up-pr-key-resolution-and-brief-thr_5mmpk2y384
Nov 12, 2026
Merged

trotterdylan merged 2 commits into
mainfrom
bb/bb-309-stand-up-pr-key-resolution-and-brief-thr_5mmpk2y384

Conversation

@trotterdylan

Copy link
Copy Markdown
Collaborator

Implements BB-309.

The stand-up brief named a gate item by its what text and the read tools only resolved a binding's own key, so the owner/repo#N the brief showed answered "No steward" and a spoken approval could not bind. This makes that key usable in every stand-up read tool and gate note, and carries the pull request's substance into the brief so a gate item needs no lookup to describe.

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

Classification

no-review: the stand-up's key reader and brief gain a pull-request key path and render data the binding already holds; no gate, approval or identity code changes, no contract or schema change, and no bigDecisions user path.

What changes

  • standup.ts:
    • samePullRef matches an owner/repo#N key and a pull URL by parsePullRef; gateNeed accepts it for need.
    • decisionLines gives an approve-pr/merge need its pull title, the steward's status summary and the last bb-review verdict with lane and approver, read from binding.lastSnapshot.pulls, status.summary and latestReviewMarker — no source call.
    • entity_snapshot renders a ticket's linked pull requests with title and state from the binding's own snapshot; a pull key or URL that resolved to the ticket renders the pull's own snapshot (title, state, author, body clipped, last comments) instead of the ticket or a "No steward" line.
    • askThreadTool strips leftover Markdown (headings, bullets, bold, code fences, inline code) from a delegate answer before returning and logging it; stripMarkdown is exported and tested.
    • buildStandupInstructions tells the model that a gate note's binding is the ticket key before the colon and need is the pull request named on it.
  • server.ts: the stewardsStandupTool binding reader resolves a pull key or URL to the open binding holding an open approve-pr or merge need for it when no binding has that key itself; a ticket key resolves as before. STANDUP_DELEGATE_PREAMBLE asks for plain prose with no Markdown.
  • standup.test.ts / server.test.ts: key resolution by PR key and URL, gateNeed matching, the decision line's title/summary/verdict, linked-PR rendering and body clipping, Markdown stripping, and the resolver end to end.

Testing

  • npm run typecheck in plugins/stewards: pass.
  • npm test in plugins/stewards: pass (1722 tests, 36 files).
  • Not tested: the live voice session; the changed code is the pure instruction/tool builders and the server's injected reader the unit tests cover.

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_qdun53dz3g.

— from bb thread thr_5mmpk2y384

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (Claude Opus 5.5, at 895a367)

Owner review required: no — none of the owner-reviewed triggers apply.

Blockers

  1. plugins/stewards/server.ts:1735 — a gate note taken by pull key is recorded but can never be applied. applyStandupNote still resolves note.binding with store.find, and the note stores the raw key the model passed (binding: "acme/web#7"). I added a probe to the new server test that confirms the note: stewardsStandupConfirm returns {"ok":false,"applied":false,"message":"No steward for acme/web#7 in this project."} and the need stays open. end_standup goes through the same path, so the spoken approval from the ticket still fails, just at the end of the stand-up instead of the start. Fix: in takeNote, store the resolved binding.entityKey as note.binding (the need already pins the item), or resolve with the same reader in applyStandupNote. Then extend the server test to confirm the note and assert the need is done.
  2. plugins/stewards/standup.ts:522-524 — when binding is a pull key and no need is given, gateNeed ignores which pull the key named. Probe: a ticket holding approve-pr for acme/web#7 and merge for acme/web#8, then take_note { type: gate, binding: "acme/web#8", action: approve }, binds to need_7 ("Approve acme/web#7 on GitHub"). The server resolver accepts thread-briefs, multi-repo: move to plugin SDK 0.6.15 #8 through its merge need, and gateKinds("approve") then picks the only approve candidate. A ticket with two approve-pr needs throws "several open gate items" instead, which fails the first criterion for a ticket with two pull requests. Fix: when bindingKey differs from binding.entityKey and parses as a pull reference, use it as wanted unless need is given. Add unit tests for both cases.

Suggestions

  • standup.ts gateNeedFacts: the status summary goes into the brief line unclipped. summary allows up to 600 characters and can contain newlines, and the ticket asks for one line. Use clipText(summary, …) so it cannot break the decision line.
  • standup.ts:307: the new 1 000-character clip applies to every entity, including a ticket body. The ticket asked for the pull's body to be clipped. A ticket spec longer than that (BB-309's is about 4 000 characters) is now cut short in entity_snapshot("<ticket key>"). Clip only the pull snapshot, or say why tickets should be clipped too.

Tested

  • Ran: npm run typecheck and npm test in plugins/stewards at 895a367 (pass, 1722 tests), plus the two probes above (scratch only, reverted).
  • CI: quality_checks (thread-briefs) failed on the push run (app.test.tsx › "goes away the moment you send a message", a timing assertion this PR does not touch) and passed on the pull_request run. Re-run the failed job so the gate reads green checks.

— from bb thread thr_qdun53dz3g

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 2 requested at 4b8e27e.

  • Blocker 1 (a gate note taken by pull key can never be applied): fixed in 4b8e27e. takeNote now records the resolved binding's own key (binding.entityKey), and applyStandupNote resolves a note's binding with the same stand-up key reader (standupBindingFor), so guidance notes by pull key resolve too. Extended the server test to confirm the note and assert the need is done.
  • Blocker 2 (a pull-key binding ignored which pull it named): fixed in 4b8e27e. When the binding key differs from the binding's entity key and parses as a pull reference, takeNote passes it to gateNeed as the wanted item unless an explicit need is given. Added unit tests: the mismatched action refuses instead of binding the first of the kind, the matching merge item binds, and a ticket key with two items of the kind is still ambiguous.
  • Suggestion (unclipped status summary): taken. gateNeedFacts clips the summary with clipText(summary, STANDUP_CONTEXT_MAX_CHARS), with a test.
  • Suggestion (ticket body clipped): taken. The body clip now applies only to a pull snapshot; a ticket body renders as written, with a test.

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

— from bb thread thr_5mmpk2y384

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 2 (Claude Opus 5.5, at 4b8e27e)

Owner review required: no — none of the owner-reviewed triggers apply.

Resolved since round 1

Tested

  • Ran: npm run typecheck and npm test in plugins/stewards at 4b8e27e (pass, 1726 tests). All CI checks are green.

— from bb thread thr_qdun53dz3g

@trotterdylan
trotterdylan merged commit a39e3e5 into main Nov 12, 2026
22 checks passed
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: no-review lane, reviewer approved 4b8e27e, checks green.
merge commit a39e3e5
Note: merging this moves the pin and stages a restart for every developer's server (Restart now, or in the 03:00–05:00 ET quiet window).
dispatched bb-server.yaml on bitcomplete/bb-gate@main

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