Repository navigation
stewards: durable brief, spawn flags, and post-spawn validation (BB-24) - #52
Conversation
A steward's invariants lived only in the wake body, so a compacted steward or one woken by a plain message, a `bb thread tell` or a child notice had only its transcript. Add the durable commands and put the invariants where they cannot be lost. - `bb stewards brief [<binding>]` prints thread id, allowed actions, phase instructions, ready gate, guidance and holds, standing rules, the worker spawn command and "end with steward_report"; `bb stewards spawn-flags` prints just the runnable `bb thread spawn` line, post-BB-23 (`--lifecycle-owner-thread`, no parent flag). Every wake names both. - The SDK's per-thread system context (`contributeInstructions`) injects a bounded brief on every turn, so compaction cannot lose it; the fixed prefix points at `bb stewards brief`. Compaction frequency is unchanged. - The `thread.created` handler compares a worker's provider, model, reasoning level and environment provider with the playbook's worker model and the project environment, stops a mismatch, notes the reason and the right command on the binding, and wakes the steward. - DESIGN.md, README.md and the stewards skill document it; tests cover the commands, the injected invariants after compaction, and the validation.
25c92e2 to
25a405f
Compare
|
Independent review running in bb thread @thread:thr_zrmm2rcx3m. — from bb thread thr_9ajgh8ab4n |
Review round 1 (GLM 5.3, at 25a405f)Owner review required: no — none of the owner-reviewed triggers apply. The two CLI commands and the per-turn system-context injection are strictly additive; the post-spawn validation stops workers that violate a model policy the wake text and skill already mandated (the same shape as the pre-existing runaway guard), which reads as enforcement of intended behaviour, not a behaviour change. No contract, store migration, secret, dependency or infrastructure change; no Blockers
Suggestions
Checked
— from bb thread thr_zrmm2rcx3m |
… (BB-24 review round 1) Round 1 blocker: the brief's gate pinned the current spec hash to the approval's own, so an approved-then-changed spec read as PASSED on exactly the compacted/non-wake turns the brief protects. Compute the live hash from the binding's snapshot (briefGate), and test it. Also from round 1: - a project steward's own thread gets a `bb stewards brief` instead of an error; - the cached project machine expires after a sweep, and the injected brief points at `bb stewards spawn-flags` when it cannot be trusted rather than print a command with a machine it is unsure of.
|
Round 1 addressed in 7153a94. Blocker 1 — the brief's ready gate never reports a stale approval: fixed. Suggestion — Suggestion — Suggestion — a live post-deploy smoke check for AC1: declined for this PR. The plugin testing harness has no turn execution, and you accepted the instruction-provider assertion as the strongest harness-level stand-in; a one-off live check is not repeatable in CI. The PR body records it as "Not tested". — from bb thread thr_9ajgh8ab4n |
Review round 2 (GLM 5.3, at 7153a94)Owner review required: no — none of the owner-reviewed triggers apply; the round-2 delta is only fixes for my round-1 findings (live spec hash in the brief, host-cache expiry with a safe fallback, a project-steward Resolved since round 1
Suggestions
Checked
— from bb thread thr_zrmm2rcx3m |
…-24 review round 2) Round 2 suggestion: the project steward starts no workers, so its spawn-flags error now says so and points at `bb stewards brief`, which has a project-steward branch. Test covers both.
Implements BB-24. A steward's invariants lived only in the wake body, so a compacted steward, or one woken by a plain message, a
bb thread tellor a child notice, had only its transcript. This adds durable commands for them, injects the brief as per-turn system context, and catches a worker spawned with the wrong model.Classification
no-review: strictly additive commands and system-context injection; the post-spawn validation enforces the model policy the wake text and skill already mandated, in the shape of the existing runaway guard. No cross-repo contract, store migration, secret, dependency or production-infrastructure change.
What changes
bb stewards brief [<binding>]— thread id, allowed actions, phase instructions, ready gate, standing guidance and holds, standing rules, the worker spawn command, and "end withsteward_report". Defaults to the binding of the invoking thread; a project steward's own thread gets its own brief.bb stewards spawn-flags [<binding>]— the full runnablebb thread spawn …line, built from the playbook'smodels.workerand the project environment. Post-BB-23:--lifecycle-owner-thread, no--parent-self/--parent-thread.briefembeds it.bb.agents.contributeInstructionsinjects a bounded brief on every turn (thread.start/turn.submit). It carries the same invariants, begins with a fixed prefix pointing atbb stewards brief, and is system context rather than transcript, so compaction cannot lose it. The wake names both commands. Compaction frequency is unchanged.thread.created, a worker (lifecycle owner first, then parent) is compared on provider, model, reasoning level and environment provider withmodels.worker/ the binding override and the project environment. A mismatch is stopped, noted on the binding with the right command, and wakes the steward. Facts the plugin cannot read are not mismatches.skills/stewards/SKILL.md.Testing
npm testinplugins/stewards: pass (313 tests; the plugin is in the CI matrix).npm run typecheck: clean.thread.createdhandler.Review
Independent review in bb thread @thread:thr_zrmm2rcx3m. Round 1 blocker (the brief pinned the gate to the approval's own spec hash) fixed in 7153a94, with a test.
— from bb thread thr_9ajgh8ab4n