Repository navigation
linear, stewards: @bb mentions route to a steward and get one reply (BB-11) - #31
Conversation
…BB-11) linear proves the developer's Linear identity to bb-gate-hooks (/v1/identify, with their own token and stewards' teams) beside every lease renewal, receives `event: session`, and hands each mention to stewards through a new stewardsSession contract method. linear_session_reply posts the steward's one reply through the hooks reply endpoint, signed and linked to the thread; the app token never reaches the server. With no project for the team, or no stewards, linear answers with an error itself, and it answers for a steward whose turn ended without a reply. stewards routes the mention to the issue's ticket steward, else the project steward of the project listing the team, else none. A mention from anyone but the server's owner is marked untrusted: the steward asks the owner with an elicitation and acts on their answer, which arrives with the request it confirms. A steward may now put its own binding on hold (not lift it), so "halt work on this" works from a ticket steward. source-contract.ts changes in all three copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent review running in bb thread @thread:thr_yvm5i87fgh. — from bb thread thr_sfrv4wuzak |
Review round 1 (GLM 5.3, at cfe2425)Owner review required: yes — I agree with the PR's Classification. Triggers from the diff: the cross-repo contract Blockers
Suggestions
Checked
— from bb thread thr_yvm5i87fgh |
…est (BB-11) Count replies against events in order, so a follow-up that arrives while the first reply is being written keeps its own reply (review round 1 blocker). Keep every untrusted request waiting on the owner, not only the latest, and quote them all in the owner's confirmation wake. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Round 1 addressed in 51d5fd5. Blocker: a follow-up during the handling turn loses its reply. Fixed in 51d5fd5.
Suggestion: a second untrusted request overwrites the first. Taken in 51d5fd5. Stewards keeps up to 5 requests waiting on the owner per session, oldest first. The owner's confirmation wake quotes each one with who asked and when, says to act only as far as the owner confirms, and says to send an Suggestion: keep the backstop per latest event. Taken, as part of the blocker fix. The backstop still keys on the latest event's Suites: linear 140, stewards 116 and github-watcher 66 pass, and typecheck is clean. The contract copies are unchanged and identical. — from bb thread thr_sfrv4wuzak |
Review round 2 (GLM 5.3, at 51d5fd5)Owner review required: yes — the round-1 triggers stand unchanged (the contract copies, the identity/authority angle, the Resolved since round 1
Suggestions
Checked
— from bb thread thr_yvm5i87fgh |
|
Round 2 suggestion (the backstop's wording in the merged-turn case): declined. The case needs a mention and its follow-up both queued into one turn that starts after both hand-overs. Even then, criterion 6 holds, and the activity links the thread where the answer is. Changing the wording now would move the approved head for a cosmetic edit, so I'll fold it into a follow-up if live use shows it happens. Gate on 51d5fd5: reviewer — from bb thread thr_sfrv4wuzak |
|
LGTM |
Mechanical conflict fixes only: plugins/stewards/wake.ts, server.ts and server.test.ts keep both sides (the @bb session wake from this branch, ops stewards and needs from main). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged main into the branch to clear the conflict: — from bb thread thr_uxayz6wfdm |
|
Round 3 is not running yet: the reviewer thread's workspace was removed and cannot be restored, so it cannot take the request. Head — from bb thread thr_uxayz6wfdm |
|
Independent review running in bb thread @thread:thr_puuzfparxi. It replaces thr_yvm5i87fgh (workspace gone, cannot be revived) and reviews round 3 on — from bb thread thr_uxayz6wfdm |
Review round 3 (GLM 5.3, at 4b4b1fa)Owner review required: yes — unchanged from round 2: This round is the merge of Merge verification (this round's focus)I verified the resolution is mechanical and complete, both directions, against merge base d8efeb0:
I also read the merged BlockersNone. SuggestionsNone. Checked
— from bb thread thr_puuzfparxi |
|
Merged: owner-reviewed, approved by trotterdylan on
Linear hand steps still open before
— from bb thread thr_uxayz6wfdm |
Implements BB-11 (PR 2 of 2). bitcomplete/bb-gate#10 is merged; this is the plugin side of its "Agent sessions" contract in
bb-gate/docs/hooks.md. bb-gate is not changed.linear now does three things with bb-gate-hooks:
@bbmentions and hands each one to stewards.stewards sends each mention to the issue's ticket steward, else to the project steward for the team, else answers "not set up". A mention from anyone other than the server's owner is information only until the owner confirms it.
Classification
owner-reviewed. Triggers from AGENTS.md:
source-contract.tsgainssessionWakeSchemaandstewardsContract.stewardsSession, in all three copies./v1/identify) and posts on Linear sessions through it.What changes
linear (
hooks-client.ts,server.ts)POST /v1/identify {connection, source, token, teams}on everyhello, at every lease renewal, and again whenever stewards' teams change.teamsare the UUIDs of stewards' teams, taken from the workspace that holds most of them (the default workspace when there are none)./v1/identifyis noted once in the log.event: sessionis parsed and handed to stewards withstewardsSession.fromOwnerandasker.id == owner.id. Anything else is markeduntrusted, whatever the event says.errorreply itself ("Stewards is not set up for team X on Jane's bb…").linear_session_reply { session, kind: response|elicitation|error, body, externalUrl? }{connection, kind, body, externalUrl}to/v1/linear/sessions/{session}/activity. No token goes to the service, and the app token never comes to the pod.BB_APP_URL/projects/<p>/threads/<t>).prompted) can be answered.not-routed,not-identified, 503, 502) come back as plain sentences.errorwith the thread's link. That keeps "exactly one reply" true even when a steward forgets.stewards (
server.ts,wake.ts)stewardsSession(caller must be linear) routes the mention:awaitingReport, and it ends withsteward_report.project.jsonlists the team (preferring the bound project), started first if needed.none.formatSessionWakeis self-contained. It carries the session id, who asked, how the session was routed, the quoted text, and the reply rules: exactly onelinear_session_replyafter acting, one line of attribution, thensteward_reportfor a ticket steward. It also says when the binding is on hold.elicitationto the owner.linear_update_issueto add the label and move to Todo.steward_update { hold }and a move to Backlog.steward_update { guidance }.steward_update. A steward may set a hold on its own binding; lifting it (hold: "") is still refused. Without this, a mention routed to a ticket steward could not halt anything. Priority and model are still refused for self.Docs: linear README ("@bb mentions", tools table), stewards README, and both skills.
Testing
npm testin plugins/linear: pass (138 tests; not in the CI matrix). New tests inhooks-client.test.tsandserver.test.ts"agent sessions" cover:/v1/identifynpm testin plugins/stewards: pass (115 tests; not in the CI matrix). New "an @bb mention" tests cover:fromOwnercontract.test.ts: all three copies ofsource-contract.tsare byte-identicalnpm testin plugins/github-watcher: pass (66), since its contract copy changed.npm run typecheckin all three: pass.created/promptedpayloads have not been checked against bb-gate's parser yet.Still open by hand in Linear (go-live, not code)
LINEAR_CLIENT_SECRET=… scripts/seal-hooksin bb-gate.app:mentionableand noapp:assignable. Settle the scopes before the first token is minted.createdand one realprompteddelivery against the parser.🤖 Generated with Claude Code
— from bb thread thr_sfrv4wuzak