Skip to content

stewards: wire a local unit as an ops filing target (BB-367) - #432

Merged
trotterdylan merged 4 commits into
mainfrom
bb/bb-367-wire-a-local-unit-as-an-ops-filing-target-thr_pqhk7v77fa
Nov 23, 2026
Merged

trotterdylan merged 4 commits into
mainfrom
bb/bb-367-wire-a-local-unit-as-an-ops-filing-target-thr_pqhk7v77fa

Conversation

@trotterdylan

@trotterdylan trotterdylan commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Implements BB-367. The stewards plugin already has a local ticket source and the ops schema already names "a local unit", but nothing wired it: filingTargetOf classified every non-repo target as Linear, filingLogin picked the Linear login, and the project-file schema rejected a local target not in linear.teams. This wires the local prefix through as an ops/deps filing target.

A merge to bb-plugins main moves the pin, builds a new bb-server image and stages a restart for every developer's server; the merge comment says so too.

Classification

owner-reviewed: the change touches plugins/stewards/roles.ts, the decide-list entry "The stewards plugin's roles parsing, ready gate and escalation routing" (decide: user), and the reviewer escalated it to the owner for the product reason (substantial, no approved spec). The rest of the files are the stewards plugin entry (decide: project), but the user entry wins.

What changes

  • config.ts: FilingTargetSource gains "local"; filingTargetOf(target, prefix) resolves the project's local prefix (default LOCAL, case-insensitive) to local, a repo to github, anything else to linear. opsTeam passes the project's prefix, and the project-file superRefine accepts the prefix as ops.team with no linear.teams entry.
  • roles.ts: roleOpsTeam passes the prefix, and filingTargetProblems accepts the local prefix for a role's ops.team while a non-local key still must be in linear.teams.
  • server.ts: filingLogin returns the server's GitHub login for a local target (never the Linear login; a local-only project reads no Linear login at all). dedupFingerprints searches the local source by the project id, its unit.
  • wake.ts: the ops/deps/Sentry/Alertmanager wakes file through ticket_file { unit: "local" }.
  • Adoption of a local ticket: the local source has no labels or priority, so autoAdopt never applies to it. A local deps ticket always raises the owner's decision, and the plugin moves the ticket itself (Ready on Adopt, Canceled on Dismiss) when the owner answers, on the page or with bb stewards done. A local ops ticket's escalation carries Adopt/Keep/Dismiss; the project steward forwards it, and the owner's answer moves the ticket the same way.
  • ops.team doc wording and the filingTargetOf/opsTeam/roleOpsTeam/filingTargetProblems comments updated.

Testing

  • npm run typecheck: pass.
  • npm test in plugins/stewards: pass (2361 tests; the plugin suite is not in the CI matrix for this repo).
  • Not tested: the deps-alerts look against a live Dependabot feed with a local target; the check test uses a k8s target and the dedup test files a local ticket directly.

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Independent review running in bb thread @thread:thr_bnmdddrfvc.

— from bb thread thr_pqhk7v77fa

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 1 (Claude Opus 5.5, at e9091b7)

Owner review required: yes. Two reasons: it touches plugins/stewards/roles.ts, which matches the decide-list entry "The stewards plugin's roles parsing, ready gate and escalation routing" (decide: user). It is also a product change: the diff is substantial (an owner-reviewed trigger), and BB-367's binding shows approval none. @trotterdylan, this one needs your approval. The escalation is binding: a project-steward bb-approval will not meet the gate, and your unsigned approval will.

Product

This adds a third filing target for the ops, deps-alerts, Sentry and Alertmanager watches: the project's local ticket source (BB-361), selected by ops.team: "LOCAL" or a custom localPrefix. The product already had the local source and ticket_file { unit: "local" }, and the schema's error text already named "a local unit", but no filing path used it. I searched README.md and skills/stewards/SKILL.md under plugins/stewards for ops.team/local filing and found no overlap. The scope matches the ticket. The blockers below are about what happens to a ticket after it is filed locally, which the ticket's criteria do not spell out.

Blockers

  1. wake.ts:855, server.ts:6594 and server.ts:13762: on a local target, tickets at an autoAdopt severity or priority end up with no one. deps.autoAdopt defaults to critical, high. For a local target the wake tells the steward to "file it in Backlog and raise no escalation for it". The plugin also skips the adoption decide item for any ticket whose rows are all autoAdopted. A local ticket in Backlog is parked (local-source.ts:182): no ticket steward adopts it, and nothing goes to the owner. So with the default config, a critical Dependabot alert on a LOCAL project is filed and then sits unseen, while a medium alert gets a decide item. Role ops.autoAdopt priorities have the same problem. The fix: on a local target, do not treat autoAdopt as adopted. Raise the adoption decide item, or the ops escalation, for every ticket. Add a test that files a critical deps ticket on a local target and gets a decide need.

  2. wake.ts:1038 and wake.ts:1746, deps.ts:253: the adoption paths that do reach someone cannot adopt a local ticket.

    • Deps: the owner answers Adopt in the decide item. The steward is then told "the owner moves it out of Backlog on the Stewards page", which the owner has already answered and is not told to do. The item's own help (adoptionHow) still says "the ticket is labelled and moved to Todo".
    • Ops: a non-autoAdopt local ticket is escalated to the project steward. The project steward is told to "add the label … and move it to Todo (ticket_update)". local-source.ts throws on any label, and its Backlog guard parks a move made on a turn that is not the owner's.

    Either way, Adopt does nothing and the ticket stays in Backlog. Make the owner's answer the act. For example, when the owner chooses Adopt or Dismiss on a local ticket's decision, the plugin moves the ticket itself (Ready, or Canceled), as the page RPC at server.ts:11672 does with ownerTurn: true. The ops escalation for a local ticket would then go to the owner rather than tell the project steward to label it. Add tests for both.

Tested

  • Ran: npm run typecheck and npm test in plugins/stewards (pass: 56 files, 2358 tests).

— from bb thread thr_bnmdddrfvc

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 1 addressed in c90a3c1.

Blocker 1 — a local ticket at an autoAdopt severity was stranded. Fixed: autoAdopted (server.ts) returns false when the filing target is local, so the plugin raises the owner's adoption decision for every local deps ticket whatever its severity; autoAdoptInstruction (wake.ts) no longer says "raise no escalation" — it says autoAdopt cannot adopt a local ticket, the plugin raises the decision for a dependency ticket, and an ops ticket is escalated as usual. Test: "raises the owner's decision for a local autoAdopt ticket and moves it when the owner adopts".

Blocker 2 — the adoption paths could not adopt a local ticket. Fixed both:

  • Deps: on the owner's Adopt or Dismiss answer the plugin now moves the local ticket itself (Ready, or Canceled) with ownerTurn: true, exactly as the page's owner-turn RPC does (reconcileDepsDecisions). adoptionHow (deps.ts) and the deps wake's Adopt/Dismiss/Keep lines now describe the plugin's move. The same test asserts LOCAL-1 reads Ready and the decision is resolved.
  • Ops: the project steward's wake now takes a localFiling flag (server.ts passes it; wake.ts renders a local variant) that says not to add a label or move the ticket, and to forward the decision to the owner (steward_update { binding, forward, resolution: "adopt-decline", ... }). Test: "tells the project steward to forward a local ops escalation to the owner".

npm run typecheck and npm test in plugins/stewards: pass (56 files, 2360 tests).

— from bb thread thr_pqhk7v77fa

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 2 (Claude Opus 5.5, at c90a3c1)

Blockers

  1. wake.ts:1754: the forward the project steward is told to make for a local ops escalation is refused. It gives resolution: "adopt-decline", but RESOLUTION_KINDS (store.ts:1470) is choice, text, approve-decline, secret, done. steward_update's z.enum(RESOLUTION_KINDS) (server.ts:14268) therefore rejects the call. The new test only checks the wake text, so it does not catch this. A test that makes the forward call as written would.
  2. Ops adoption on a local target still moves nothing (the ops half of round 1's blocker 2). With a valid kind, the owner's answer goes back through wakeProjectOnForwardedAnswer to the project steward. That turn is plugin-initiated, so ownerStartedTurn is false and localSource.update parks the ticket in Backlog again. The other option the wake offers, "resolve it with guidance saying the owner adopts it on the Stewards page", leaves the owner with no item to act on. What would fix it: do what the deps path now does. When the owner approves a forwarded ops escalation about a local ticket, the plugin moves the ticket to Ready itself, and to Canceled on decline. Add a test that the owner's answer moves the ticket.

Resolved since round 1

  • Blocker 1 (autoAdopt tickets stranded on a local target): resolved by c90a3c1. autoAdopted is false for local, so the decide item is raised and the wake no longer suppresses the escalation.
  • Blocker 2: partly resolved. The deps path is fixed: the owner's Adopt or Dismiss moves the local ticket, adoptionHow matches, and there is a test. The ops path is still open (blockers 1 and 2 above).

Tested

  • Ran: npm run typecheck and npm test in plugins/stewards (pass: 56 files, 2360 tests).

— from bb thread thr_bnmdddrfvc

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 2 addressed in 809d43e.

Blocker 1 — the forward resolution was refused. Fixed: the project steward's wake now says resolution: "choice" (not adopt-decline), and for a local target the ops escalation now carries the Adopt/Keep/Dismiss choices (ADOPTION_CHOICES) and the filed local ticket keys. So the forward's choice resolution has the 2-6 choices it needs. The test now makes the forward call and the owner's answer, so a refused call fails it.

Blocker 2 — the ops answer moved nothing. Fixed: when the ops steward files a local ticket and escalates, the plugin attaches the filed local ticket keys to the escalation (data.localTickets). When the owner answers the forwarded question with Adopt or Dismiss, the plugin moves the local ticket itself (Ready, or Canceled) with ownerTurn: true, exactly as the deps path does. The test forwards the escalation, answers Adopt, and asserts LOCAL-1 reads Ready.

npm run typecheck and npm test in plugins/stewards: pass (56 files, 2360 tests).

— from bb thread thr_pqhk7v77fa

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 3 (Claude Opus 5.5, at 809d43e)

Blockers

  1. server.ts:16839: the owner's Adopt on a forwarded local ops escalation moves the ticket only when answered on the Stewards page. The localTickets move was added to the page RPC at server.ts:12351. The other path for the owner's answer is bb stewards done qst_… --choice Adopt, which done describes as recording "the label the user gave in chat". That path resolves the same forwarded escalation and leaves the ticket in Backlog. The deps path in this PR moves the ticket for both the page and bb stewards done, so the two adoption flows behave differently. What would fix it: put the localTickets move in a helper and call it from both forwarded-answer paths. Extend the test with a done --choice Adopt case.

Suggestions

  • server.ts:13831: localTickets and the Adopt/Keep/Dismiss choices are attached to any escalation whose report also files a local ticket, whatever its kind. Suppose an ops steward files LOCAL-2 and escalates blocked ("kubectl is forbidden in web-production") in the same report. That question gets Adopt/Keep/Dismiss buttons in place of its free-text answer, and an answer moves LOCAL-2. Limit both to input.escalate.kind === "decision".

Resolved since round 2

  • Blocker 1 (invalid adopt-decline resolution): resolved by 809d43e. The wake now uses choice, and the test makes the forward call.
  • Blocker 2 (ops adoption moved nothing): partly resolved. Answering on the page moves the ticket. bb stewards done still does not (blocker 1 above).

Tested

  • Ran: npm run typecheck and npm test in plugins/stewards (pass: 56 files, 2360 tests).

— from bb thread thr_bnmdddrfvc

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Round 3 addressed in 8b45551.

Blocker 1 — bb stewards done left the ticket in Backlog. Fixed: the move is now a helper (moveLocalTickets) called from both forwarded-answer paths — stewardsAnswerQuestion (the page) and the done CLI's question/choice branch. Added the test "moves the local ticket when the owner answers a forwarded local ops escalation with bb stewards done", which forwards, answers via bb stewards done qst_… --choice Adopt, and asserts LOCAL-1 reads Ready.

Suggestion — choices on any escalation kind. Taken: the local ticket keys and the Adopt/Keep/Dismiss choices are attached only when input.escalate.kind === "decision", so a blocked escalation from the same report keeps its free-text answer.

npm run typecheck and npm test in plugins/stewards: pass (56 files, 2361 tests).

— from bb thread thr_pqhk7v77fa

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Review round 4 (Claude Opus 5.5, at 8b45551)

Owner review required: yes, for two reasons.

  • The PR touches plugins/stewards/roles.ts, which matches the decide-list entry "The stewards plugin's roles parsing, ready gate and escalation routing" (decide: user).
  • It is a product change: the diff is substantial, and BB-367's binding shows approval none. The Product section of round 1 still applies. Since then the PR has also changed how a local ops or deps ticket is adopted: the owner's Adopt or Dismiss answer moves the ticket itself (Ready or Canceled), because a local ticket has no labels.

@trotterdylan, this one needs your approval. The escalation is binding: a project-steward bb-approval will not meet the gate, and your unsigned approval will.

Resolved since round 3

  • Blocker 1 (bb stewards done did not move the ticket): resolved by 8b45551. moveLocalTickets is called from both forwarded-answer paths, and a test covers done.
  • Suggestion (choices attached to any escalation kind): taken. They are now limited to decision.

Tested

  • Ran: npm run typecheck and npm test in plugins/stewards (pass: 56 files, 2361 tests).

— from bb thread thr_bnmdddrfvc

@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Approved 8b45551 from the Stewards page

@trotterdylan
trotterdylan merged commit 2ab6043 into main Nov 23, 2026
36 of 37 checks passed
@trotterdylan
trotterdylan deleted the bb/bb-367-wire-a-local-unit-as-an-ops-filing-target-thr_pqhk7v77fa branch November 23, 2026 12:33
@trotterdylan

Copy link
Copy Markdown
Collaborator Author

Merged: owner-reviewed lane, reviewer approved 8b45551, checks green, approved by the owner, the owner acked the product.
merge commit 2ab6043
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