Repository navigation
stewards: add the local source and an optional playbook to the contract (BB-361) - #399
Conversation
|
Independent review running in bb thread @thread:thr_wf9y25ts89. — from bb thread thr_9t8342qnxs |
Review round 1 (Claude Opus 5.5, at a6eafbe)Owner review required: yes — cross-repo contract ( The two Looks good. Tested
— from bb thread thr_wf9y25ts89 |
|
Approved #399 at a6eafbe. It changes the contract additively: a new — from bb thread thr_rkn6gtwp8m |
a6eafbe to
a22d206
Compare
a22d206 to
ae99dde
Compare
|
Merged: owner-reviewed lane, reviewer approved a6eafbe, checks green, approved by the project steward. |
#400) Implements [BB-359](https://linear.app/bit-complete/issue/BB-359). Slice 3 of 3: the stewards, linear, github-watcher and slack plugins stop naming bb-gate, bc-prod, kploy, devbox and a tailnet hostname in examples, schema messages, comments and READMEs, and the built-in Alertmanager URL is dropped. > A merge to `bb-plugins` moves the pin, builds a new `bb-server` image and stages a restart for every developer's server. In-cluster servers keep Alertmanager through `ALERTMANAGER_URL` in bb-gate's `kploy/production/backend.json`, which is not edited. Sibling PR: #397 (BB-359 PR 1, still open). #395 (BB-359 PR 2) is merged. ## Classification owner-reviewed: the Alertmanager default URL is removed, so a target with neither the `alertmanagerUrl` setting nor `ALERTMANAGER_URL` now reports a clear error instead of reading a built-in tailnet hostname. ## What changes - **Alertmanager.** `DEFAULT_ALERTMANAGER_URL` is gone; `resolveAlertmanagerUrl` returns `null` when neither the setting nor the env var is set, and `bb stewards check` and a look report a clear error. In-cluster servers are unaffected: `ALERTMANAGER_URL` is in `kploy/production/backend.json`, which this PR does not edit. - **Neutral examples and prose.** `config.ts`, `roles.ts`, `templates.ts` and `wake.ts` use `acme/web`, `acme/app`, `web-production`, `deploy/kustomization.yaml`, `build.yaml`, `app` and `PLUGIN_REF`, and say "the hooks service"; the nightly-window comment no longer cites bb-gate's restart window. - **Skills.** `skills/stewards/SKILL.md` uses the same neutral examples, drops "deploy manifests" from the `bb stewards survey` row (matching the survey after #395), and drops "a tailnet rule"/the tailnet hostname; `skill.test.ts` follows. - **READMEs.** stewards, linear, github-watcher and slack READMEs say "the hooks service" and `BB_HOOKS_URL`, link the contract by name rather than `../../bb-gate/docs/hooks.md`, and use neutral ops/deps/deployment examples. - **DESIGN.md** gets a short top note that bb-gate is one deployment of the plugin, not a requirement; the rest stays as history. ## Testing - `plugins/stewards` typecheck and `npm test`: pass (2115 tests; one `server.test.ts` timeout under full-suite load that passes alone). - `plugins/linear` typecheck and test: pass (162 tests; not in the CI matrix). - `plugins/slack` typecheck and test: pass (252 tests; not in the CI matrix). - `plugins/github-watcher` typecheck and test: pass (106 tests). - `bb stewards check` on our project: unchanged (the server reads `ALERTMANAGER_URL`). - Scope note: the ticket's Done-when grep still matches `bb-gate-hooks` in the linear/github-watcher/slack code and source-contract comments owned by #398/#399, and the `devbox-provider` sibling-plugin link; this slice covers the prose and examples it names.
Implements [BB-361](https://linear.app/bit-complete/issue/BB-361/built-in-local-ticket-source-for-stewards-file-and-steward-an-effort). 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 over `source-contract.ts`, backed by two new tables. A local ticket is filed with the neutral `ticket_file` in unit `local`, 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. > A merge to `bb-plugins` `main` moves the pin, builds a new `bb-server` image and stages a restart for every developer's server. 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.ts` and its two byte-identical copies (the cross-repo contract entry, project-decided in `bigDecisions`). The contract change is one additive field (below); the rest is the feature. The reviewer decides the lane from the diff. ## What changes - **Store (`store.ts`).** `local_tickets` and `local_comments` appended as a new migration group; `migrations.snapshot.json` gains the four new hashes. Comments carry the authoring bb thread, or null for an owner page comment. - **Tools (`ticket-tools.ts`).** `ticket_file` with 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. - **Source (`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>` (default `LOCAL`, `localPrefix` in `project.json`, refused when it equals a Linear team key), numbered server-wide so two projects cannot collide. - **Server (`server.ts`).** `sourceRpc("local", …)` is dispatched in-process; `adoptionKind`/`maybeAdopt`/`projectFor`/`lifecycle` adopt a local ticket by state; `bindingPlaybook`/`playbookFor` route it by the snapshot's optional `playbook`; `sourceForKey` reads the local prefix; the `stewardsLocalTicket`/`stewardsLocalEditDescription`/`stewardsLocalComment`/`stewardsLocalSetState` RPCs for the page; the `bb stewards tickets list|show|file|comment|update|close|export` CLI; and `bb stewards detach <local key>` sets Backlog. - **Playbook (`templates.ts`, `config.ts`).** A built-in `local-tickets` playbook (states Backlog/Ready/In Progress/In Review/Done/Canceled), overridable by `.bb/stewards/playbooks/local-tickets.md`; `frontMatterSchema.source` gains `local`; `playbookFor` resolves the name a local ticket filed under (`initiative`, say). - **Contract (`source-contract.ts` ×3).** `sourceCreateIssue.input` gains an optional `playbook`. 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. - **Owner comments are the spec (`reconcile.ts`).** `isSpecComment`/`specText`/`specHash` take 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_update` only 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 (`app.tsx`).** The detail view grows a local-ticket panel: the description editor, the state control and the owner's comment box. - **Skills and docs.** The stewards skill documents local tickets; the onboarding skill mentions `localPrefix`; the README and the CLI help follow. ## Testing - `plugins/stewards`: `npm run typecheck` pass; `npm test` pass (2166 tests, 49 files; in the CI matrix). - `plugins/linear`: `npm run typecheck` pass; `npm test` pass (164 tests). - `plugins/github-watcher`: `npm run typecheck` pass; `npm test` pass (123 tests). - Added: `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); a `reconcile.test.ts` gate test that a PR citing an approved `LOCAL-1` passes the product check and one without an approval is escalated; and an `app.test.tsx` test for the editor, state control and owner comment. - Not tested: a live Linear/GitHub write, and the page against a real server (the app test drives the RPC mocks). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Implements BB-361. Adds the
localsource to the source contract, an optional additiveplaybookfield to the entity snapshot, andSOURCE_PLUGIN_IDS.local = "stewards", copied byte for byte into all three plugins. No behaviour change in linear or github-watcher.Sibling PR: #398 (BB-360, this PR's base). This is the contract half of BB-361's split; the local-source feature PR follows.
Classification
owner-reviewed: cross-repo contract (
source-contract.tsand its three copies).What changes
sourceSchemagainslocal;Sourcewidens to include it.SOURCE_PLUGIN_IDS.local = "stewards".entitySnapshotSchemagains an optional, additiveplaybook: z.string().optional(); linear and github omit it.source-contract.tscopies stay byte-identical, andcontract.test.tscovers the new fields.Two type-only stewards
server.tsadjustments were required to keeptscgreen (the task asked not to touchserver.ts; without them the widenedSourcebreaks the interest-setRecord<Source, ...>and the overview RPC's playbooksourceenum). Both are additive and inert:local's interest set is empty and never sent (the loop iterateslinear/githubonly), and the overview enum gainslocalso it matches the widened contract. No behaviour change.Testing
plugins/stewards:npm run typecheckpass;npm testpass (2102 tests, 46 files; in the CI matrix).plugins/linear:npm run typecheckpass;npm testpass (163 tests).plugins/github-watcher:npm run typecheckpass;npm testpass (107 tests).