Repository navigation
stewards: the built-in local ticket source (BB-361) - #407
Conversation
Implements BB-361: a third source, local, served by the stewards plugin itself in-process over source-contract.ts, backed by local_tickets and local_comments. A local ticket is filed with ticket_file in unit local, adopted by state rather than by label, and runs local-tickets (or the playbook it named at filing). Writes ring the reconcile loop in-process. - Store: the two tables and their migration, with the snapshot updated. - Source: create/snapshot/update/comment/adoptable/search, state-only adoption, owner page comments, and the prefix from project.json. - Server: sourceRpc dispatch for local, adoption by state, playbook routing by the snapshot field, the local-tickets built-in playbook, sourceForKey, the CLI and the detail-view RPCs. - Tools/skills/app: ticket_file's local unit and playbook, the CLI commands, the description editor and state control, and the docs. A merge to bb-plugins main moves the pin, builds a new bb-server image and stages a restart for every developer's server.
|
Independent review running in bb thread @thread:thr_g9s4u7htpy. — from bb thread thr_9zr73qxgcr |
Review round 1 (Claude Opus 5.5, at 1ec4937)Owner review required: yes — ProductAdds a third ticket source, Blockers
Tested
— from bb thread thr_g9s4u7htpy |
- The adoption guard is on every move out of Backlog or a terminal state into an adopted state, in the source's update, so the tool, the CLI and the page RPC all pass through it; stewardsLocalSetState is client-only. - A local comment is the owner's spec only when unsigned and authored by the viewer; a signed comment from any thread never counts, and the owner branch is not used for Linear or GitHub. - ticket_file with no unit files a local ticket, per the ticket, replacing the single-unit default. - Tests for the In Progress move, the user-thread-signed comment, the Linear/GitHub hash unchanged, and the default unit.
|
Round 1 addressed in 4e63cad. All four blockers fixed:
Also made the new — from bb thread thr_9zr73qxgcr |
Review round 2 (Claude Opus 5.5, at 4e63cad)Blockers
Resolved since round 1
Tested
— from bb thread thr_g9s4u7htpy |
…nd 2) For source=local, isSpecComment counts the steward's own signed spec comment (the plan and criteria an approval pins) as well as the owner's unsigned page comment; a signed comment from any other thread still does not count. Test updated.
|
Round 2 addressed in a894f81:
(The — from bb thread thr_9zr73qxgcr |
Review round 3 (Claude Opus 5.5, at a894f81)Owner review required: yes. Resolved since round 2
Tested
Looks good. — from bb thread thr_g9s4u7htpy |
|
Approved a894f81 from the Stewards page |
|
Merged: owner-reviewed lane, reviewer approved a894f81, checks green, approved by the owner, escalated by the reviewer to the owner. |
Implements BB-361. This is PR 3 of 3 (the feature); the contract PR (#399) is merged and deployed, and the gate-key PR was skipped because the gate already accepts
LOCAL-<n>.A third source,
local, is served by the stewards plugin itself in-process oversource-contract.ts, backed by two new tables. A local ticket is filed with the neutralticket_filein unitlocal, is adopted by state rather than by label (Backlog parked, Ready-or-later adopted), and from then on every ticket-binding consumer works unchanged. Writes ring the reconcile loop in-process: no webhook, no lease, no bb-gate-hooks.Sibling PR: none; this is the last half of BB-361. PR 1 (#399, contract) is merged.
Classification
owner-reviewed: a new migration and two store tables, and
source-contract.tsand its two byte-identical copies (the cross-repo contract entry, project-decided inbigDecisions). The contract change is one additive field (below); the rest is the feature. The reviewer decides the lane from the diff.What changes
store.ts).local_ticketsandlocal_commentsappended as a new migration group;migrations.snapshot.jsongains the four new hashes. Comments carry the authoring bb thread, or null for an owner page comment.ticket-tools.ts).ticket_filewith no unit now files a local ticket, per the ticket's "(or defaulted)"; this replaces the old "the only configured unit" default, so a project with one GitHub repo and no local unit named files local rather than that repo. The tool description names the change.local-source.ts).sourceSnapshot,sourceCreateIssue,sourceUpdateIssue(state and parent only; labels/priority/relations error),sourceComment(refuses an unsigned body),sourceAdoptable(by state),sourceSearchIssues, and the owner page comment / description edit / state control. Keys are<prefix>-<n>(defaultLOCAL,localPrefixinproject.json, refused when it equals a Linear team key), numbered server-wide so two projects cannot collide.server.ts).sourceRpc("local", …)is dispatched in-process;adoptionKind/maybeAdopt/projectFor/lifecycleadopt a local ticket by state;bindingPlaybook/playbookForroute it by the snapshot's optionalplaybook;sourceForKeyreads the local prefix; thestewardsLocalTicket/stewardsLocalEditDescription/stewardsLocalComment/stewardsLocalSetStateRPCs for the page; thebb stewards tickets list|show|file|comment|update|close|exportCLI; andbb stewards detach <local key>sets Backlog.templates.ts,config.ts). A built-inlocal-ticketsplaybook (states Backlog/Ready/In Progress/In Review/Done/Canceled), overridable by.bb/stewards/playbooks/local-tickets.md;frontMatterSchema.sourcegainslocal;playbookForresolves the name a local ticket filed under (initiative, say).source-contract.ts×3).sourceCreateIssue.inputgains an optionalplaybook. This is the one place the feature needed a contract field the first PR did not add: a local ticket names its playbook at filing, and the creation RPC had no field for it. Linear and github ignore it; the copies stay byte-identical.reconcile.ts).isSpecComment/specText/specHashtake an optional owner, so an unsigned comment authored by the viewer counts as the user's spec; an agent comment (signed by any thread) never does.ticket_updateonly moves a local ticket to Ready in a turn the owner started (a plain client turn); a plugin wake or a Slack participant's forward lands it in Backlog.app.tsx). The detail view grows a local-ticket panel: the description editor, the state control and the owner's comment box.localPrefix; the README and the CLI help follow.Testing
plugins/stewards:npm run typecheckpass;npm testpass (2166 tests, 49 files; in the CI matrix).plugins/linear:npm run typecheckpass;npm testpass (164 tests).plugins/github-watcher:npm run typecheckpass;npm testpass (123 tests).local-source.test.ts(the source's contract behaviour against a real in-memory SQLite);local-ticket.test.ts(ticket_file→tickets show, adoption/detach/resume, the non-owner adoption rule for Ready/In Progress, playbook routing, the owner-vs-agent comment rule, the default unit, the CLI); areconcile.test.tsgate test that a PR citing an approvedLOCAL-1passes the product check and one without an approval is escalated; and anapp.test.tsxtest for the editor, state control and owner comment.🤖 Generated with Claude Code