diff --git a/scripts/super-board-deps.sh b/scripts/super-board-deps.sh index 38d8449d..6cfd6e2e 100755 --- a/scripts/super-board-deps.sh +++ b/scripts/super-board-deps.sh @@ -54,9 +54,16 @@ # A ๐Ÿ™‹ card stays humanGated either way โ€” only the resume path moves it. # # `runnable` is true only when the line parses, no blocker is still open, AND the -# card is not human-gated. `humanGated` comes from `blocked-by: -`, which means -# "nothing on this board clears it" โ€” credentials, permissions, a product ruling. -# The sweep must never free one of those; only a person can. +# card is not human-gated. `humanGated` comes from `blocked-by: -` in a Block +# comment, which means "nothing on this board clears it" โ€” credentials, +# permissions, a product ruling. The sweep must never free one of those; only a +# person can. +# +# A bounce is not a human gate. A card bounced back to Ready for a rebase kept an +# older Block's `blocked-by: -`, or wrote its own, and the planner skipped it as +# human-gated until someone cleared the line by hand. So: `blocked-by: none` means +# no blockers; `-` outside a Block comment reads as none; and a newer `โ†ฉ๏ธ` report +# (a bounce) with no `blocked-by:` line clears an older Block's line. set -euo pipefail HERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) @@ -131,14 +138,23 @@ echo "$ISSUES" | jq --arg only "$ONLY" ' # most recent one wins over the issue body: a lane that just parked the card # knows why, and the `## Blocked by` in the body may be weeks older. # - # `blocked-by: -` is NOT "no blockers". It means nothing on this board clears - # it โ€” a credentials, permissions or product-decision block โ€” so the card is - # parseable AND deliberately not runnable. Only a person moves it. + # `blocked-by: -` in a Block comment is NOT "no blockers". It means nothing on + # this board clears it โ€” a credentials, permissions or product-decision block โ€” + # so the card is parseable AND deliberately not runnable. Only a person moves + # it. In any other comment (a bounce report) `-` reads as none. + # + # Newest wins, comment by comment, as {line, block}. A `โ†ฉ๏ธ` report (a bounce) + # with no `blocked-by:` line of its own resets the line of an older Block to none. + # A Block is the `[blocker]` header, or a `Reason tag:` or `Why blocked:` field + # of the Block template (older Block comments carry only the fields). + def is_block: test("^\\[[a-z]+\\] \\[blocker\\]"; "m") or test("(Reason tag|Why blocked):"); + def is_bounce: (split("\n")[0]) | test("^\\[[a-z]+\\] \\[report\\] โ†ฉ๏ธ"); def comment_line: - [ (.comments.nodes // .comments // [])[] - | (.body // "") | split("\n")[] - | select(test("^[ \t]*blocked-by:"; "i")) ] - | last // null; + reduce ((.comments.nodes // .comments // [])[] | (.body // "")) as $b (null; + ([ $b | split("\n")[] | select(test("^[ \t]*blocked-by:"; "i")) ] | last) as $l + | if $l != null then { line: $l, block: ($b | is_block) } + elif ($b | is_bounce) then { line: "blocked-by: none", block: false } + else . end); def bodies: [ (.comments.nodes // .comments // [])[] | (.body // "") ]; def label_names: [ (.labels.nodes // .labels // [])[] | (.name // "") ]; @@ -155,14 +171,16 @@ echo "$ISSUES" | jq --arg only "$ONLY" ' | ($i.body | section) as $sec | ($i | comment_line) as $cl | ( if $cl != null then - ( $cl | capture("blocked-by:[ \t]*(?.*)$"; "i").v | gsub("[ \t]"; "") ) as $v - | if $v == "-" or $v == "" then + ( $cl.line | capture("blocked-by:[ \t]*(?.*)$"; "i").v | gsub("[ \t]"; "") ) as $v + | if ($v == "-" or $v == "") and $cl.block then { parseable: true, blockers: [], human_gated: true, why: "" } + elif $v == "-" or $v == "" or ($v | ascii_downcase) == "none" then + { parseable: true, blockers: [], human_gated: false, why: "" } elif ($v | test("^[0-9]+(,[0-9]+)*$")) then { parseable: true, blockers: ($v / "," | map(tonumber)), human_gated: false, why: "" } else { parseable: false, blockers: [], human_gated: false, - why: ("the `blocked-by:` line reads \"" + $v + "\" โ€” it must be issue numbers alone, or `-`") } + why: ("the `blocked-by:` line reads \"" + $v + "\" โ€” it must be issue numbers alone, `none`, or `-`") } end elif $sec == null then { parseable: false, blockers: [], human_gated: false, diff --git a/skills/super-board/references/block-template.md b/skills/super-board/references/block-template.md index 49af3e61..c03518be 100644 --- a/skills/super-board/references/block-template.md +++ b/skills/super-board/references/block-template.md @@ -59,7 +59,11 @@ same rule: **prose above for the human, one parseable line below for the loop.** - `blocked-by: 32, 91` โ€” this card returns to `Ready` the moment both close. The sweep does it. - `blocked-by: -` โ€” nothing on this board clears it. It waits for a person, and the sweep leaves it - alone. Use this for every `๐Ÿ”`, `๐Ÿ’ณ`, `๐Ÿ”‘`, `๐Ÿง‘`, `๐ŸŽจ` and `๐Ÿ™‹` block. + alone. Use this for every `๐Ÿ”`, `๐Ÿ’ณ`, `๐Ÿ”‘`, `๐Ÿง‘`, `๐ŸŽจ` and `๐Ÿ™‹` block. Only a Block comment can + say it: in any other comment `-` reads as none. +- `blocked-by: none` โ€” nothing blocks it. Every bounce to Ready (rebase, rebuild) ends with this, + so a stale `-` from an earlier Block cannot keep the card human-gated. A newer `โ†ฉ๏ธ` report with + no `blocked-by:` line also clears an older Block's line. Write the numbers alone. **Never `blocked-by: none โ€” but #26 must merge first`**: a line that says none and then names an issue is read as *no blocker* by the sweep and as *one blocker* by a human, diff --git a/skills/super-board/references/run.md b/skills/super-board/references/run.md index ac3b975b..751fcf8b 100644 --- a/skills/super-board/references/run.md +++ b/skills/super-board/references/run.md @@ -532,6 +532,10 @@ Next: - NEVER list changed files โ€” the PR shows them. No restating the issue, no adjectives. - Machine lines go last and do not count: `Local tests:` (Tester and Builder, the exact command the Reviewer reruns), `gh-quota-on-exit:`, `blocked-by:`. +- A bounce (`โ†ฉ๏ธ`, card back to Ready or QA) ends with `blocked-by: none`, or the numbers of + blockers that are still open. NEVER `blocked-by: -` on a bounce: `-` is a human gate. + `super-board-deps.sh` reads `-` as a gate only in a Block comment, and a newer `โ†ฉ๏ธ` report + clears an older Block's line. - Run the prose through `humanizer` when installed (else the plain-words rules in writing-standard.md). - The **issue comment** is the same header plus the PR link; the PR comment carries the detail. @@ -679,6 +683,7 @@ function. Three cards lost a wave to a mechanical edit. [ ] label the issue `loop:rebase` [ ] move the card Review โ†’ Ready (NOT Blocked) [ ] comment on the PR: which files conflicted, or which verify command failed, and its output +[ ] end the issue comment with `blocked-by: none` (NEVER `-`: that reads as a human gate) ``` The Builder picks it up as an ordinary pass, routes `mattpocock-skills:resolving-merge-conflicts`, diff --git a/tests/fixtures/deps-issues.json b/tests/fixtures/deps-issues.json index 9fe111c8..f79c290d 100644 --- a/tests/fixtures/deps-issues.json +++ b/tests/fixtures/deps-issues.json @@ -90,7 +90,7 @@ "body": "blocked-by: 2\n" }, { - "body": "the blocker closed\nblocked-by: -\n" + "body": "[builder] [blocker] ๐Ÿ›‘ blocked ยท ๐Ÿ” the blocker closed, now needs a key\nWhy blocked: no API key\nblocked-by: -\n" } ] } @@ -181,5 +181,114 @@ } ] } + }, + { + "number": 30, + "title": "bounce writes dash", + "state": "OPEN", + "body": "## Blocked by\n\n- None.\n", + "comments": { + "nodes": [ + { + "body": "[reviewer] [blocker] ๐Ÿ›‘ blocked ยท ๐Ÿ™‹ PR #9 is over the size cap\nCard: #N card\nReason tag: ๐Ÿ™‹\nWhy blocked: over the size cap\nblocked-by: -" + }, + { + "body": "[reviewer] [report] โ†ฉ๏ธ back to Ready ยท loop:rebase\nDid: gate exit 5, base does not merge cleanly\nNext: builder\nblocked-by: -" + } + ] + } + }, + { + "number": 31, + "title": "bare bounce clears block", + "state": "OPEN", + "body": "## Blocked by\n\n- None.\n", + "comments": { + "nodes": [ + { + "body": "[reviewer] [blocker] ๐Ÿ›‘ blocked ยท ๐Ÿ™‹ PR #9 is over the size cap\nCard: #N card\nReason tag: ๐Ÿ™‹\nWhy blocked: over the size cap\nblocked-by: -" + }, + { + "body": "[reviewer] [report] โ†ฉ๏ธ back to Ready ยท loop:rebase\nDid: gate exit 5\nNext: builder" + }, + { + "body": "[qa] [report] โœ… pass ยท round 2\nDid: AC1โ€“AC3 pass\nNext: reviewer" + } + ] + } + }, + { + "number": 32, + "title": "bounce says none", + "state": "OPEN", + "body": "## Blocked by\n\n- None.\n", + "comments": { + "nodes": [ + { + "body": "[reviewer] [blocker] ๐Ÿ›‘ blocked ยท ๐Ÿ™‹ PR #9 is over the size cap\nCard: #N card\nReason tag: ๐Ÿ™‹\nWhy blocked: over the size cap\nblocked-by: -" + }, + { + "body": "[reviewer] [report] โ†ฉ๏ธ back to Ready ยท loop:rebase\nNext: builder\nblocked-by: none" + } + ] + } + }, + { + "number": 33, + "title": "bounce names open blocker", + "state": "OPEN", + "body": "## Blocked by\n\n- None.\n", + "comments": { + "nodes": [ + { + "body": "[reviewer] [report] โ†ฉ๏ธ back to Ready ยท loop:rebase\nDid: gate exit 5\nNext: builder\nblocked-by: 2" + } + ] + } + }, + { + "number": 34, + "title": "report does not clear block", + "state": "OPEN", + "body": "## Blocked by\n\n- None.\n", + "comments": { + "nodes": [ + { + "body": "[reviewer] [blocker] ๐Ÿ›‘ blocked ยท ๐Ÿ™‹ PR #9 is over the size cap\nCard: #N card\nReason tag: ๐Ÿ™‹\nWhy blocked: over the size cap\nblocked-by: -" + }, + { + "body": "[qa] [report] โœ… pass ยท round 2\nDid: AC1โ€“AC3 pass\nNext: reviewer" + } + ] + } + }, + { + "number": 35, + "title": "block after bounce", + "state": "OPEN", + "body": "## Blocked by\n\n- None.\n", + "comments": { + "nodes": [ + { + "body": "[reviewer] [report] โ†ฉ๏ธ back to Ready ยท loop:rebase\nNext: builder\nblocked-by: none" + }, + { + "body": "[reviewer] [blocker] ๐Ÿ›‘ blocked ยท ๐Ÿ™‹ PR #9 is over the size cap\nCard: #N card\nReason tag: ๐Ÿ™‹\nWhy blocked: over the size cap\nblocked-by: -" + } + ] + } + }, + { + "number": 36, + "title": "dash outside a block", + "state": "OPEN", + "body": "## Blocked by\n\n- None.\n", + "comments": { + "nodes": [ + { + "body": "the blocker closed\nblocked-by: -\n" + } + ] + } } ] diff --git a/tests/test-deps.sh b/tests/test-deps.sh index 235675ef..f8f1c928 100755 --- a/tests/test-deps.sh +++ b/tests/test-deps.sh @@ -113,4 +113,34 @@ get 28 '.needsYouDone == false' || fail "#28: a 'done' before the ๐Ÿ™‹ block mus get 26 '.runnable == false' || fail "#26: done goes through resume, never the Ready sweep" get 2 '.needsYou == false and .needsYouDone == false' || fail "an ordinary card is not needsYou" -echo "PASS: test-deps.sh (18 scenarios)" +# ---- bounces are not human gates ------------------------------------------- +# A card bounced back to Ready for a rebase kept an older Block's `blocked-by: -`, +# or wrote its own, and the planner skipped it as human-gated until someone +# cleared the line by hand. `-` gates only in a Block comment; `none` is none; +# a newer `โ†ฉ๏ธ` report with no line of its own clears an older Block's line. + +# 19 โ€” a bounce that writes `-` is not a human gate. +get 30 '.humanGated == false and .runnable == true' || fail "#30: a bounce's \`-\` must not gate: $(echo "$OUT" | jq -c '.["30"]')" + +# 20 โ€” a bounce with no `blocked-by:` line clears an older Block's line, and a +# later ordinary report does not bring the Block back. +get 31 '.humanGated == false and .runnable == true' || fail "#31: a newer โ†ฉ๏ธ bounce should clear the older Block: $(echo "$OUT" | jq -c '.["31"]')" + +# 21 โ€” `blocked-by: none` means no blockers, not a blocker named "none". +get 32 '.parseable == true and .humanGated == false and .blockers == [] and .runnable == true' \ + || fail "#32: \`blocked-by: none\` should mean no blockers: $(echo "$OUT" | jq -c '.["32"]')" + +# 22 โ€” a bounce that names an open blocker still waits for it. +get 33 '.openBlockers == [2] and .runnable == false' || fail "#33: a bounce naming open #2 must wait" + +# 23 โ€” an ordinary report is not a bounce: the Block still gates. +get 34 '.humanGated == true and .runnable == false' || fail "#34: a later report must not clear a Block" + +# 24 โ€” a Block newer than the bounce gates again. +get 35 '.humanGated == true and .runnable == false' || fail "#35: a Block after a bounce must gate" + +# 25 โ€” `-` in a comment that is not a Block reads as none. +get 36 '.parseable == true and .humanGated == false and .runnable == true' \ + || fail "#36: \`-\` outside a Block comment should read as none: $(echo "$OUT" | jq -c '.["36"]')" + +echo "PASS: test-deps.sh (25 scenarios)"