Repository navigation
stewards: add the sourceCreateIssue RPC to the source contract (BB-360) - #398
Conversation
Add an optional, additive sourceCreateIssue RPC (unit, title, signed description, labels, priority, parent, assignee) to source-contract.ts, copied byte for byte into linear and github-watcher, and implement it in both: linear resolves the team, labels, priority, parent and its own user; github-watcher files through REST with labels, the viewer as the only assignee, and a same-repo sub-issue parent, refusing a priority it has no concept of. Both refuse an unsigned description and any assignee but this server's own user. contract.test.ts snapshots the new RPC and keeps the three copies identical.
|
Independent review running in bb thread @thread:thr_kh8mndms7g. — from bb thread thr_t4tapuxxjg |
Review round 1 (Claude Opus 5.5, at 4520b42)Owner review required: yes. It changes a cross-repo contract ( Blockers
Tested
— from bb thread thr_kh8mndms7g |
- github-watcher reads a sub-issue parent before the create, refusing a missing or pull-request parent, and names the filed key and URL when the link itself fails so a retry cannot silently duplicate the issue. - github-watcher accepts me/@me/the viewer as the assignee, so one value means this server's own user on both sources. - linear tests cover the bad label, team and parent refusals, each asserting no issueCreate was sent.
|
Round 1 addressed at c9e0646. Blocker 1 — GitHub parent read and link failure. Fixed in c9e0646: Blocker 2 — Blocker 3 — Linear refusal tests. Fixed in c9e0646: the Linear test now covers an unknown label, an unknown team, a nonexistent parent and a parent in another team, each asserting no All three suites pass: linear 163, github-watcher 108, stewards 2101; typecheck clean. — from bb thread thr_t4tapuxxjg |
Review round 2 (Claude Opus 5.5, at c9e0646)Owner review required: yes. It changes a cross-repo contract ( Resolved since round 1
Tested
Looks good. — from bb thread thr_kh8mndms7g |
|
Approved #398 at c9e0646. It adds an optional — from bb thread thr_rkn6gtwp8m |
|
Merged: owner-reviewed lane, reviewer approved c9e0646, checks green, approved by the project steward. |
…ct (BB-361) (#399) Implements [BB-361](https://linear.app/bit-complete/issue/BB-361/built-in-local-ticket-source-for-stewards-file-and-steward-an-effort). Adds the `local` source to the source contract, an optional additive `playbook` field to the entity snapshot, and `SOURCE_PLUGIN_IDS.local = "stewards"`, copied byte for byte into all three plugins. No behaviour change in linear or github-watcher. > 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: #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.ts` and its three copies). ## What changes - `sourceSchema` gains `local`; `Source` widens to include it. - `SOURCE_PLUGIN_IDS.local = "stewards"`. - `entitySnapshotSchema` gains an optional, additive `playbook: z.string().optional()`; linear and github omit it. - The three `source-contract.ts` copies stay byte-identical, and `contract.test.ts` covers the new fields. Two type-only stewards `server.ts` adjustments were required to keep `tsc` green (the task asked not to touch `server.ts`; without them the widened `Source` breaks the interest-set `Record<Source, ...>` and the overview RPC's playbook `source` enum). Both are additive and inert: `local`'s interest set is empty and never sent (the loop iterates `linear`/`github` only), and the overview enum gains `local` so it matches the widened contract. No behaviour change. ## Testing - `plugins/stewards`: `npm run typecheck` pass; `npm test` pass (2102 tests, 46 files; in the CI matrix). - `plugins/linear`: `npm run typecheck` pass; `npm test` pass (163 tests). - `plugins/github-watcher`: `npm run typecheck` pass; `npm test` pass (107 tests). - Not tested: no UI/CLI surface changes in this contract-only PR.
#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-360](https://linear.app/bit-complete/issue/BB-360/source-neutral-ticket-tools-for-stewards-and-workers-ticket-over-the). Stewards registers `ticket_file`, `ticket_read`, `ticket_search`, `ticket_comment`, `ticket_update` and `ticket_watch` for steward and worker threads, each a thin dispatch over `source-contract.ts` by key shape (`BB-123` is Linear, `owner/repo#N` is GitHub). The stewards, build-tickets and pr-reviewer skills take every ticket step through them; `gh` stays for pull requests, and `linear_*` and `github_watch` are unchanged. `ticket_file` resolves a unit against the project's teams and repos, and refuses without one when several are configured. > 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: #398 (BB-360 PR 1, the `sourceCreateIssue` contract) is merged and deployed. This PR was stacked on #404 (BB-363 PR 1) and is now rebased onto `main` after #404 merged. ## Classification owner-reviewed: `source-contract.ts` and its three copies (the cross-repo contract entry, project-decided) plus `plugins/github-watcher/server.ts` and `plugins/linear/server.ts`, which implement the new `sourceUpdateIssue` fields. The tools and skills themselves are additive. ## What changes - **Contract.** `sourceUpdateIssue` gains the optional `state` and `assignee` fields `ticket_update` needs; the three copies stay byte-identical and `contract.test.ts` covers them. This is the second half of the contract seam PR 1 opened; `sourceCreateIssue` is already on `main`. - **Tools (`plugins/stewards/ticket-tools.ts`).** Six tools registered for steward and worker threads. Key parsing (`BB-123` / `owner/repo#N` / a GitHub issue or pull URL), `ticket_file`'s unit rule, `ticket_search`'s per-source fan-out, signed descriptions and comments, and the assignee rule (this server's own login or none). `ticket_watch` records a KV row per watcher and the existing `stewardsRing` path wakes the thread; watched ids join `sourceSetInterest`, so the source leases them. No new contract RPC for the watch. - **Sources.** Linear's `sourceUpdateIssue` sets the workflow state by name and the assignee (self or none), refusing anyone else. GitHub's serves labels and the `open`/`closed`/`status:<phase>` state and refuses priority, assignee and relations. - **Skills.** stewards, build-tickets and pr-reviewer use the neutral names; the GitHub child step is `ticket_file { parent }`, state moves are `ticket_update { state }`, and `skill.test.ts` pins that no shipped skill names a `linear_*` tool or `gh issue` for a ticket step (`linear_session_reply` stays; it has no neutral equivalent). `templates.ts` (the stamped playbooks) and the README follow. - `.bb` is untouched. The playbooks `deps-alerts.md`, `initiative.md` and `ops-watch.md` still name `linear_*` tools and keep working because those tools stay; their tool-name rewrite is a separate later `.bb` change, after this PR's image is staged on the owner's server. ## Testing - `plugins/stewards`: `npm run typecheck` pass; `npm test` pass (2140 tests, 47 files). - `plugins/linear`: `npm run typecheck` pass; `npm test` pass (164 tests; not in the CI matrix). - `plugins/github-watcher`: `npm run typecheck` pass; `npm test` pass (120 tests). - Tests added: one stewards test per tool for dispatch by key shape and the `ticket_file` unit rule; the pure key/unit/watch tests in `ticket-tools.test.ts`; the contract snapshot for the new `sourceUpdateIssue` fields; the linear and github implementations on their existing harnesses; and a test that a `ticket_comment` body is signed so `gate.ts` never reads it as the owner's approval. - Not tested: a live Linear or GitHub write (the harnesses script the endpoints). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Implements BB-360. This is PR 1 of 2: the contract edit, landed on its own per "Splitting the decision from the feature". It adds the optional
sourceCreateIssueRPC (unit, title, description, labels, priority, parent, assignee) tosource-contract.ts, byte for byte inplugins/stewards,plugins/linearandplugins/github-watcher, and implements it in linear and github-watcher with tests on their existing harnesses.Sibling PR: PR 2 (the
ticket_*tools and skills) is branched frommainafter this merges; it is not open yet.Classification
owner-reviewed: a cross-repo contract other repos implement (
source-contract.tsand its copies), the decide list's "A cross-repo contract other repos implement" entry. Additive only: a new optional RPC and its two implementations; no existing behavior, default or tool changes. Merging moves thebb-serverpin and stages a restart for every developer's server.What changes
source-contract.ts: a new optionalsourceCreateIssueRPC. LikesourceUpdateIssue, a source that does not serve it is unavailable to the caller.descriptionis handed in already carrying the contract'ssignatureLine(exactly assourceComment's body is), and the source refuses an unsigned one.priorityis a source capability;parentis the parent issue's key;assigneenames only this server's own login, or none. Output is{ id, key, url }.plugins/linear/server.ts: files through the existingissueCreatemutation, resolving the team, labels, priority, parent and the assignee. The assignee is accepted only asme, this server's own name/email, or a value that resolves to the connected user; anyone else is refused before the write.plugins/github-watcher: files throughPOST /repos/{owner}/{repo}/issueswith labels and the viewer as the only assignee, and links a same-repo parent as a sub-issue. GitHub has no issue priority, so a priority is refused; a bad parent is refused before anything is filed.contract.test.tssnapshots the new RPC and keeps the three copies identical;linear/server.test.tsandgithub-watcher/server.test.tscover the happy path, the unsigned-description refusal, the assignee restriction, priority (refused on GitHub), the parent, and the bad-unit/bad-parent errors.Limits from the spec approval. (1) Every description
sourceCreateIssuewrites carries the contract'ssignatureLine: the source refuses an unsigned description, so a bug in the caller cannot file an unsigned issue. (2)assigneeis enforced in the source implementations (linear and github-watcher) and documented in the contract, not deferred to PR 2: only this server's own login or none is accepted. (3).bbis untouched, and noplugins/linear/README.mdline is added because BB-359 is rewriting that README; if a README line is wanted, PR 2 can add it.Testing
plugins/linear:npm run typecheckandnpm testpass (163 tests; not in the CI matrix).plugins/github-watcher:npm run typecheckandnpm testpass (107 tests; in the CI matrix).plugins/stewards:npm run typecheckandnpm testpass (2101 tests; in the CI matrix).