diff --git a/plugins/stewards/config.test.ts b/plugins/stewards/config.test.ts index 23215f51..13c21104 100644 --- a/plugins/stewards/config.test.ts +++ b/plugins/stewards/config.test.ts @@ -263,6 +263,14 @@ describe("playbooks", () => { expect(phaseInstructions(linear.value, "In Progress")).toMatch(/writeEnv/u); expect(phaseInstructions(linear.value, "In Progress")).toMatch(/changes what the ticket needs/u); expect(phaseInstructions(linear.value, "In Progress")).toMatch(/escalated as a `decision`/u); + // BB-267: a by-hand configure step outside the repos is an escalation too. + expect(phaseInstructions(linear.value, "In Progress")).toMatch(/a `configure` escalation raised in the spec turn/u); + expect(phaseInstructions(linear.value, "In Progress")).toMatch(/kind: "decision"/u); + expect(phaseInstructions(linear.value, "In Progress")).toMatch(/resolution: "done"/u); + expect(phaseInstructions(linear.value, "In Progress")).toMatch(/never a README line or a closing-comment follow-up/u); + expect(phaseInstructions(linear.value, "In Progress")).toMatch(/raise that step again/u); + expect(phaseInstructions(linear.value, "In Progress")).toMatch(/the user's to grant/u); + expect(phaseInstructions(linear.value, "In Progress")).toMatch(/followThrough/u); expect(phaseInstructions(linear.value, "In Review")).toMatch(/escalated as a `decision`/u); const prs = parsePlaybook(GITHUB_PRS, "github-prs"); if (!prs.ok) throw new Error(prs.error); diff --git a/plugins/stewards/server.test.ts b/plugins/stewards/server.test.ts index 9dbd54a1..cabd838f 100644 --- a/plugins/stewards/server.test.ts +++ b/plugins/stewards/server.test.ts @@ -12227,7 +12227,15 @@ describe("deployment watching (BB-53)", () => { expect(reported.error).toBe(false); await t.flush(); expect(t.hooks.store.find("ENG-12")!.deployments["acme/web#7"]).toMatchObject({ state: "deployed" }); - expect(t.sends.filter((s) => s.threadId === steward).at(-1)!.text).toMatch(/Every pull request is merged and deployed/u); + const wrap = t.sends.filter((s) => s.threadId === steward).at(-1)!.text; + expect(wrap).toMatch(/Every pull request is merged and deployed/u); + // BB-267: a by-hand configure step is an escalation with followThrough, not + // folded into the closing comment; an "unchanged" provide-secret reopens it. + expect(wrap).toMatch(/A by-hand step outside the repos that the feature needs to work/u); + expect(wrap).toMatch(/kind: "decision"/u); + expect(wrap).toMatch(/resolution: "done"/u); + expect(wrap).toMatch(/keep the binding open with followThrough until its `configure` escalation is done/u); + expect(wrap).toMatch(/"unchanged" has not provided the value: raise that step again/u); }); it("keeps the pull request awaiting when the steward reports the deployment does not carry the merge", async () => { diff --git a/plugins/stewards/skill.test.ts b/plugins/stewards/skill.test.ts index 2884a454..6434c6c4 100644 --- a/plugins/stewards/skill.test.ts +++ b/plugins/stewards/skill.test.ts @@ -85,3 +85,22 @@ describe("the shipped skills' stacked-PR rule (BB-264)", () => { expect(stewardsSkill).toContain("Never answer a schedule escalation by telling a stacked ticket"); }); }); + +// BB-267: a by-hand step outside the repos that a feature needs (an app scope, +// a webhook, a registry entry, a tailnet rule) is a configure escalation, and +// the project steward fails item 5 on a spec that leaves it as a README line +// or a follow-up. +describe("the shipped stewards skill's by-hand configure step (BB-267)", () => { + it("raises it as an escalation, not a README line, and fails item 5 when a spec leaves it undocumented", () => { + expect(stewardsSkill).toContain("A by-hand step outside the repos the feature needs to work"); + expect(stewardsSkill).toMatch(/an app scope, a webhook, a registry entry, a tailnet rule/u); + expect(stewardsSkill).toMatch(/a `configure`\s+escalation raised in the spec turn/u); + expect(stewardsSkill).toMatch(/kind:\s+"decision"/u); + expect(stewardsSkill).toMatch(/never a README\s+line or a closing-comment follow-up/u); + expect(stewardsSkill).toMatch(/raise that step again/u); + expect(stewardsSkill).toMatch(/the user's to grant/u); + expect(stewardsSkill).toMatch(/never decides it itself/u); + expect(stewardsSkill).toMatch(/Fail checklist item 5/u); + expect(stewardsSkill).toMatch(/must be raised again\s+rather than settling/u); + }); +}); diff --git a/plugins/stewards/skills/stewards/SKILL.md b/plugins/stewards/skills/stewards/SKILL.md index 7487289c..2eea2e04 100644 --- a/plugins/stewards/skills/stewards/SKILL.md +++ b/plugins/stewards/skills/stewards/SKILL.md @@ -136,8 +136,20 @@ Two tools are yours; everything else you do with the tools every thread has. bb's secure form in its first turn. `secret` is the only resolution for a credential, even when the ticket or spec says the owner produces or seals it by hand; such spec wording is corrected at spec approval, never - followed. Never paste a secret, and never route the user to a script to - run. + followed. A by-hand step outside the repos the feature needs to work — an + app scope, a webhook, a registry entry, a tailnet rule — is a `configure` + escalation raised in the spec turn (`steward_report { escalate: { kind: + "decision", … } }`, which the project steward forwards with `resolution: + "done"`), never a README line or a closing-comment follow-up; at wrap-up a + step still open keeps the binding open with `followThrough`, and a + provide-secret whose form answer is "unchanged" has not provided the + value: raise that step again with `steward_report { escalate: { kind: + "decision", … } }` rather than settling it. A step that adds or + widens an app scope, a token or a tailnet rule is the user's to grant: the + project steward forwards it under the "Granting a new credential, token or + cluster access to any server or agent, or widening what an existing one + can reach" decision, and never decides it itself. Never paste a secret, and + never route the user to a script to run. - **A build-time blocker is a `decision` the same turn.** A worker's finding that would stop the feature working once it ships, or that changes what the ticket needs (a credential, an access, a contract), is escalated as a @@ -544,7 +556,16 @@ transcripts. Turn the user's focus ("hold everything touching billing") into `steward_update` calls. A substantial spec whose checklist is met reaches you as an `approval` escalation the plugin files: approve it with `steward_update { binding, approve: true }`, which closes it, or decline -with `guidance` + `resolve` saying what must change. Your approval wake +with `guidance` + `resolve` saying what must change. Fail checklist item 5 +when the spec leaves a by-hand step outside the repos the feature needs — +an app scope, a webhook, a registry entry, a tailnet rule — as a README line +or a follow-up rather than a `configure` escalation raised in the spec +turn, and decline until it is one; a provide-secret whose form answer is +"unchanged" has not provided the value, so the step must be raised again +rather than settling. When that step adds or widens an app scope, a token or a tailnet +rule, forward it to the user under the "Granting a new credential, token or +cluster access to any server or agent, or widening what an existing one can +reach" decision; never decide it yourself. Your approval wake shows the project's `standingRules` from `.bb/stewards/project.json`; add only the limits the change needs that they do not cover, in at most three points, or approve with none. A decline's objections go to the ticket diff --git a/plugins/stewards/templates.ts b/plugins/stewards/templates.ts index cfdae58d..8668c2ad 100644 --- a/plugins/stewards/templates.ts +++ b/plugins/stewards/templates.ts @@ -10,7 +10,7 @@ import { DEFAULT_BIG_DECISIONS, defaultDecideList } from "./decisions.js"; * user sees. */ const SECRET_REQUEST = - "A credential the work needs is a decision escalation, not a worker's job to prompt: raise it with `steward_report { escalate: { kind: \"decision\", question, context, meanwhile } }`, naming the variable and what it is for in `context`. The question is one line, as the sidebar row shows it; the evidence and reasoning go in `context`, and a question longer than 240 characters is refused. The project steward forwards it with `resolution: \"secret\"` and either the `writeEnv` dotenv path (or `worker`) for a worker's machine, or the `setting` for one of the stewards plugin's own secret settings; the plugin then opens bb's secure form in a requester thread. `secret` is the only resolution for a credential, even when the ticket or spec says the owner produces or seals it by hand; such spec wording is corrected at spec approval, never followed. Never paste the secret, and never a script for the user to run."; + "A credential the work needs is a decision escalation, not a worker's job to prompt: raise it with `steward_report { escalate: { kind: \"decision\", question, context, meanwhile } }`, naming the variable and what it is for in `context`. The question is one line, as the sidebar row shows it; the evidence and reasoning go in `context`, and a question longer than 240 characters is refused. The project steward forwards it with `resolution: \"secret\"` and either the `writeEnv` dotenv path (or `worker`) for a worker's machine, or the `setting` for one of the stewards plugin's own secret settings; the plugin then opens bb's secure form in a requester thread. `secret` is the only resolution for a credential, even when the ticket or spec says the owner produces or seals it by hand; such spec wording is corrected at spec approval, never followed. A by-hand step outside the repos the feature needs to work — an app scope, a webhook, a registry entry, a tailnet rule — is a `configure` escalation raised in the spec turn (`steward_report { escalate: { kind: \"decision\", … } }`; the project steward forwards it with `resolution: \"done\"`), never a README line or a closing-comment follow-up; a step that adds or widens an app scope, a token or a tailnet rule is the user's to grant, forwarded under the project's \"new credential, token or access, or widening what an existing one can reach\" decision, never the project steward's; at wrap-up a still-open step keeps the binding open with `followThrough`, and a provide-secret whose form answer is \"unchanged\" has not provided the value: raise that step again with `steward_report { escalate: { kind: \"decision\", … } }` rather than settling it. Never paste the secret, and never a script for the user to run."; /** * Every playbook that can start a worker carries this, next to its other diff --git a/plugins/stewards/wake.ts b/plugins/stewards/wake.ts index b8dab59f..704d63bf 100644 --- a/plugins/stewards/wake.ts +++ b/plugins/stewards/wake.ts @@ -272,6 +272,7 @@ function deploymentInstructions(input: WakeInput): string | undefined { if (settled) { return ( `Every pull request is merged and deployed (${where}). This is the last turn of the work: post one closing comment saying it is live and move the ticket to its terminal state, then end with steward_report without followThrough. ` + + `A by-hand step outside the repos that the feature needs to work — an app scope, a webhook, a registry entry, a tailnet rule — is not folded into the closing comment: keep the binding open with followThrough until its \`configure\` escalation is done, and if the spec turn never raised one, raise it now with \`steward_report { escalate: { kind: "decision", … } }\` for the project steward to forward with \`resolution: "done"\`. A provide-secret whose form answer is "unchanged" has not provided the value: raise that step again with \`steward_report { escalate: { kind: "decision", … } }\` rather than settling it. ` + `If a playbook says otherwise, keep it open with followThrough as usual.` ); }