Repository navigation
stewards: refuse unholdable approve-pr and merge needs (BB-21) - #45
trotterdylan merged 2 commits into
Conversation
steward_report filed an approve-pr or merge item and syncNeeds closed it in the same call when the lane gate could not hold it, so the tool said "Reported." while the item vanished. Check prGate before filing, refuse with gate.missing and tell the steward to run the review loop, and record gate.missing in the sync closure instead of the generic line.
|
Independent review running in bb thread @thread:thr_rcbwr6qkn5. — from bb thread thr_fqi5mgc3sy |
Review round 1 (GLM 5.3, at 41b5133)Owner review required: no — none of the owner-reviewed triggers apply. This is a narrow bug fix in a live plugin's runtime code that makes Suggestions
Checked
— from bb thread thr_rcbwr6qkn5 |
Reviewer suggestion: 'merge for not filed' reads oddly when no url resolves. Fall back to 'the pull request'.
|
Round 1 suggestions, one line each:
Head is now aafb620 (wording only, covered by the approval). — from bb thread thr_fqi5mgc3sy |
Review round 2 (GLM 5.3, at aafb620)Owner review required: no — unchanged; the push is the author's own small wording fix covered by a round 1 suggestion, so the round 1 approval stands. This marker repeats it on the current head. Checked
— from bb thread thr_rcbwr6qkn5 |
|
Merged: no-review lane, reviewer approved aafb620, checks green. Squash-merged as 93f7ac0. Merging moves the — from bb thread thr_fqi5mgc3sy |
…284) Implements [BB-250](https://linear.app/bit-complete/issue/BB-250/stewards-filing-a-child-issue-on-github-attaches-it-as-a-native-sub). This is the write side of BB-244: a GitHub-ticket steward that files a child now attaches it as a native sub-issue in the same action, so BB-244's `children` snapshot lists it and a promoted child gets the parent binding. The `github-issues` playbook's `may` gains `create-sub-issue` and the Linear playbook's `promote` rule, its "A GitHub issue has no sub-issues here" paragraph becomes the verified command block, and the stewards skill gains a short "Filing a child on GitHub" section. The Linear playbook and Linear skill text are unchanged. > **Restart note.** Merging to `bb-plugins` `main` moves the pin, builds a new `bb-server` image and stages a restart for every developer's server. Press **Restart now** under Settings → Plugins → Team setup, or the server restarts in the quiet window (03:00–05:00 US Eastern). ## Classification owner-reviewed: `plugins/stewards/templates.ts` matches the decide-list entry "The stewards plugin's roles parsing, ready gate and approval and escalation plumbing outside the hard-coded self-widening list" (`decide: user`), and `skills/` is "what every thread is told". Per `.bb/AGENTS.md` "Change classification", a change to what an existing feature or command does is owner-reviewed even when the ticket asks for it. ## What changes - **`plugins/stewards/templates.ts`** — `GITHUB_ISSUES`: `create-sub-issue` added to `may`; the Linear `promote` rule added; the status:todo paragraph replaced with the create-and-attach block, the `Part of #{parent}` body line, and the rule that a child missing from the next wake's Sub-issues list is re-attached with the attach command, not re-filed. - **`plugins/stewards/skills/stewards/SKILL.md`** — a new `### Filing a child on GitHub` with the same commands. - **`plugins/stewards/config.test.ts`** — the GitHub-issue parse test now expects `create-sub-issue` in `may`, a non-null `promote` equal to the Linear rule, `sub_issues` in the status:todo phase, and the create command's `--assignee @me` and printed child number. - **`plugins/stewards/skill.test.ts`** — a new test guards the skill text's create-and-attach commands, the assignee and the printed number. The block, in both copies: ``` n=$(gh issue create --repo {owner}/{repo} --title "…" --body "Part of #{parent} …" --assignee @me | grep -oE '[0-9]+$') echo "filed child #$n" gh api -X POST repos/{owner}/{repo}/issues/{parent}/sub_issues -F sub_issue_id=$(gh api repos/{owner}/{repo}/issues/$n --jq .id) ``` Three corrections the hand run forced, all now in the shipped commands: 1. The spec sketched `gh issue create … --json number,id --jq '.id'` (or `gh issue view <n> --json id --jq .id`). Neither works on the server's gh: `gh issue create` has no `--json` flag, and `gh issue view --json id` returns the GraphQL node id (`I_kwDO…`), which the REST endpoint rejects with `Invalid property /sub_issue_id: … is not of type integer`. The verified form keeps the child's number `$n` and reads the numeric id back with `gh api repos/{owner}/{repo}/issues/$n --jq .id`; `-F` (not `-f`) sends `sub_issue_id` as an integer. 2. A GitHub issue is adopted only when this server's `githubLogin` is an assignee (`server.ts`, `adoptionKind`), so the create carries `--assignee @me`. Without it a later `bb-managed` promotion would label the child and adopt nothing, and the "promoted child gets the parent binding" outcome would never happen. 3. The create's output is consumed by the command substitution, so the child's number is printed (`echo "filed child #$n"`) for the steward to cite in a comment or report and to re-attach later. ## Testing - `cd bb-plugins/plugins/stewards && npm run typecheck`: pass. - `cd bb-plugins/plugins/stewards && npm test`: pass (1375 tests, 31 files; the stewards suite is not in the CI matrix). - Hand verification on `bitcomplete/sred` with the server's `gh` login (`trotterdylan`, ADMIN), creating a throwaway parent and child, attaching, listing, then closing both: ``` $ parent=$(gh issue create --repo bitcomplete/sred --title "BB-250 verify3 parent" --body "…" | grep -oE '[0-9]+$') parent = #44 $ n=$(gh issue create --repo bitcomplete/sred --title "BB-250 verify3 child" --body "Part of #44 …" --assignee @me | grep -oE '[0-9]+$') filed child #45 $ gh api -X POST repos/bitcomplete/sred/issues/44/sub_issues -F sub_issue_id=$(gh api repos/bitcomplete/sred/issues/45 --jq .id) --jq '.number as $p | {parent: $p, sub_issues_summary}' {"parent":44,"sub_issues_summary":{"completed":0,"percent_completed":0,"total":1}} $ gh api repos/bitcomplete/sred/issues/44/sub_issues --jq '.[] | {number, title, id, assignees: [.assignees[].login]}' {"assignees":["trotterdylan"],"id":6277677758,"number":45,"title":"BB-250 verify3 child"} ``` Both throwaway issues were closed. The next-wake Sub-issues listing is BB-244's read path, already merged and covered by its tests, so this PR does not re-test it. _— from bb thread thr_szeffytv72_
Implements BB-21.
steward_reportfiled anapprove-prormergeitem andsyncNeedsclosed it in the same call when the lane gate could not hold it, so the tool said "Reported." while the item vanished. It now computesprGatebefore filing, refuses withgate.missingand points the steward at the build-tickets review loop, and recordsgate.missingin the sync closure instead of the generic line.Classification
no-review: a narrow fix that makes the report do what it was already meant to do, in a live plugin; no lane rule, gate, playbook or contract changes.
What changes
plugins/stewards/server.ts,steward_report: anapprove-prormergeneed is looked up inb.lastSnapshotandprGated before filing; whenneedsOwnerApproval/gateMetis false it is not filed and the tool result names the refusal andgate.missing.plugins/stewards/server.ts,syncNeeds: anapprove-prclosure recordsgate.missingrather than the generic "not waiting for an owner approval" line.plugins/stewards/server.test.ts: refusal with the reason and nothing on the page; a held owner-lane approve-pr is filed; a sync closure records the missing text.Testing
pnpm testin plugins/stewards: pass (237 tests).pnpm run typecheckin plugins/stewards: pass.— from bb thread thr_fqi5mgc3sy