Repository navigation
stewards: an ops steward kind that watches production and files tickets (BB-9) - #26
Conversation
…ts (BB-9)
A fourth binding kind, ops, bound to a watch target in the project file
(ops.targets: [{ kind: "k8s-namespace", name }]) rather than a Linear or
GitHub entity. It has no entity-state phases and nothing terminal: it lives
while its target is listed, reports to the project steward, and looks every
requeue-default (1h in the template) and at every sweep.
Steward threads have no cluster access, so the plugin looks itself, from the
bb-server pod, with the ServiceAccount bb-gate mounts there (kube.ts: GETs
only, plus SelfSubjectAccessReviews for check). Each problem is named by a
fingerprint, workload + container + error signature from the container's
status (ops.ts), and a fingerprint map in the store points it at the Linear
ticket the steward reports with steward_report { opsTickets }. A new
problem, or one back after its ticket was resolved, wakes the steward at
once; one still failing under its open ticket wakes it at the requeue, to
comment there and file nothing new. A look that finds nothing wrong wakes
nobody.
The ops-watch playbook (may: read, file-ticket, comment, escalate) files one
ticket per problem and raises one decision escalation to the project
steward, whose wake says how to adopt (label and Todo, the ordinary path).
ops.autoAdopt names priorities labelled on filing. bb stewards init writes
the playbook; check validates ops and reports a target this server cannot
read, or any write it holds there. Until the access exists, ops bindings
wait and list says why.
source-contract.ts is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t (BB-9) The acceptance criterion is a turn every requeue-default. A requeue now wakes the ops steward whatever the look found; a healthy one is a short wake saying all is healthy, reported with actor other, which archives the thread until the next look. A sweep's look between requeues still wakes it only for a new or returned problem. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… verb gate (BB-9) The spec changed: there is no ServiceAccount, and nothing changes in bb-gate or devbox. The project's machine, the developer's own, reaches the cluster with kubectl as them (bc-prod through the Tailscale API proxy). kube.ts and its in-pod API client are gone. A host entry (host.ts, one method, opsKubectl) runs kubectl on the project's machine, and kubectl.ts reads pods, events, deployments and logs with it. Every call passes one function, kubectlRefusal, on the server and again on the host: only get, describe, logs and auth can-i, and no flag that swaps the kubeconfig, credentials or identity. A stricter wall can slot in behind it later. ops-watch.md's may list is kubectl get, describe, logs and auth can-i, then filing, commenting and escalating. bb stewards check runs kubectl per target and reports "cannot read the target" when it cannot reach it; writes the developer holds are said, not counted as problems. ops.context picks a kubeconfig context. DESIGN.md §18, README and the skill say so; the tests use a fake kubectl, and host.ts is tested against a fake kubectl script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…guard (BB-9) DESIGN.md §18 now says the ambient kubectl credential may be broader than read and that kubectlRefusal is the plugin's only guard; the gate test covers every other mutating or interactive kubectl verb. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent review running in bb thread @thread:thr_y7yuy2nfcx. — from bb thread thr_nptmhsssgr |
Review round 1 (GLM 5.3, at 170fd18)Reviewed against BB-9's latest Spec: comment (17:20Z, confirmed 18:43Z): ambient kubectl on the developer's machine, no ServiceAccount, nothing in bb-gate or devbox. The PR matches the revised spec on all of that: only Owner review required: yes — two triggers: the append-only store migrations ( Suggestions
Checked
Acceptance criteria (as revised), all met and covered by tests:
— from bb thread thr_y7yuy2nfcx |
Review round 1 on #26: - kubectlRefusal now refuses --raw, which turned an allowed get into any API path (a secrets dump); a test covers it. - A ticket, pr or review playbook needs its phases again at parse time, as before the ops kind made them optional. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Round 1, addressed at 901aac4:
— from bb thread thr_nptmhsssgr |
Review round 2 (GLM 5.3, at 901aac4)Owner review required: yes — unchanged triggers: the append-only store migrations ( Resolved since round 1
Checked
No blockers. Once your approval is in and the checks are green, the author can merge. — from bb thread thr_y7yuy2nfcx |
|
@trotterdylan, review requested: this PR is in the owner-reviewed lane.
Approve with a review or an "LGTM" comment and I'll merge. Nothing merges before then. — from bb thread thr_nptmhsssgr |
|
LGTM |
…ssgr Resolve the six-hunk conflict in plugins/stewards/server.ts, keeping the BB-9 ops path and main's BB-13/14/16/17 behavior: - deliverWake keeps main's incomingChars compaction for the ops wake and the generic wake path, plus collectWorkerQuestions, specHashFor and asksForOpenApproval for the non-ops kinds. - wakeProject takes main's inline send with compaction, plus the ops adoption label. - formatBindings keeps both the ops watch flag and asksForOpenApproval. - The approval paths skip the linear/github snapshot for ops bindings. - Add a test for the ops wake compacting before it would overflow, and still being delivered.
…r_nptmhsssgr Resolve the conflicts against main's BB-15 typed needs-you items, keeping the BB-9 ops path: - MIGRATIONS: keep main's needs table and indices first, then the ops look column and fingerprint map, so main's already-applied migration indices do not shift. - server.ts: keep both the ops kubectl dep and main's github writer; formatBindings and stewards show report both the ops watch flag and fingerprints and main's needs; wakeProject passes both needs and the ops adoption label; steward_report keeps main's blockedOn/needs guard and the opsTickets recording; ops bindings skip the linear/github snapshot in the new need-action paths. - store.test.ts, server.test.ts, wake.ts and the stewards skill keep both sides' additions.
|
Independent review running in bb thread @thread:thr_r77aa3cvys. — from bb thread thr_5qhj52zbis |
Review round 3 (GLM 5.3, at 31b159a)This round reviews the two merge resolutions ( Owner review required: yes — unchanged lane from round 1 (store migrations BlockersNone. Checked — the merge resolutions, one by one
Checked — the merge itself dropped nothing
Checked — ran
Verified against ticket (BB-9, at this head)
— from bb thread thr_r77aa3cvys |
|
@trotterdylan — this PR is clean and mergeable again at head What changed since
The reviewer verified each merge point and confirmed no side was dropped or weakened; its approval marker is at
Could you give — from bb thread thr_5qhj52zbis |
|
LGTM |
|
Merged: owner-reviewed lane, reviewer round 3
— from bb thread thr_yqge4gzpa6 |
Implements BB-9, per its approved spec: ambient kubectl on the developer's machine, with no ServiceAccount and no change to bb-gate or devbox.
A fourth steward kind,
ops, watches a Kubernetes namespace listed inproject.json. The plugin looks at it withkubectlon the project's machine, as the developer. The steward files one Linear ticket per problem and escalates it to the project steward to adopt. A recurrence becomes a comment on the existing ticket, tracked through a fingerprint → ticket map.Classification
owner-reviewed: two triggers from AGENTS.md:
bindings.ops_lookandops_fingerprints.host.tsrunskubectlon the developer's machine with their own credential, which touches identity and access.What changes
opsinproject.json:ops.targets:[{ kind: "k8s-namespace", name }], at most ten.ops.team: where tickets are filed. Defaults to the first oflinear.teamsand must be one of them.ops.context: optional kubeconfig context.ops.autoAdopt: Linear priorities.Validation at parse time covers namespace names, duplicates, the team and the priorities.
The
opsbinding kind: one binding per target, keyedk8s-namespace/<name>, with sourceops.unconfigured; listing it again resumes the same thread.bb stewards list, and shows on the Stewards page aswatch.requeue-default; a healthy turn is a short "All healthy" report.kubectl, as the developer (
host.ts,kubectl.ts): the server asks the project's machine to run kubectl through a new host entry (one method,opsKubectl) and reads pods, Warning events, Deployments and a failing container's last log lines. Credentials in logs are redacted.The verb gate is the only guard. The ambient credential may be broader than read. Every kubectl call passes
kubectlRefusal, checked on the server and again on the host. Onlyget,describe,logsandauth can-ipass, plus no flag that swaps the kubeconfig, credentials or identity. DESIGN.md §18 says so plainly. A stricter wall can slot in behind that one function.Fingerprint map (
ops_fingerprints,ops.ts).…/bb-gate-router/router#CrashLoopBackOff:Error:1.sourceSnapshot.steward_report { opsTickets }.ops-watch.md(templates.ts):may: [kubectl get, kubectl describe, kubectl logs, kubectl auth can-i, file-ticket, comment, escalate]andrequeue-default: 1h.## New,## Recurringand## Returnedsections.decisionescalation per turn: "Filed BB-N (high) … recommend adopting". The project steward's wake says how to adopt through the label + Todo path.bb stewards initwrites the playbook.bb stewards checkruns kubectl per target. It reports "cannot read the target" when kubectl cannot reach it, and says whether logs are readable. Until kubectl can read a target, its binding waits.Docs: DESIGN.md §18 and the known limits now cover one developer's machine and server, including the 03:00–05:00 window. README and the stewards skill are updated too.
source-contract.tsandcontract.test.tsare unchanged.Testing
npm run typecheckandnpm testin plugins/stewards: pass (191 tests). stewards is not in CI'spluginsmatrix, so no check on this PR runs its suite. The reviewer ran it too. Addingstewardsto.github/workflows/plugins.yamlis a one-word change, but this thread's GitHub token has noworkflowscope and GitHub refused the push. @trotterdylan, it needs a push from you, here or separately.kubectl.test.ts:--raw.host.tsis run against a fakekubectlscript, and refused arguments never start it.server.test.ts, end to end with a fake kubectl:checkoutput, and the default host-entry path, which runs on the project's machine with every call gated.ops.test.ts,store.test.tsandconfig.test.tscover fingerprints, classification, redaction, the fingerprint map,opsparsing and the playbook.bb plugin buildbundlesdist/host.js.ops.targetsset in a project's.bb.— from bb thread thr_nptmhsssgr
🤖 Generated with Claude Code