Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 31 additions & 13 deletions scripts/super-board-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 // "") ];
Expand All @@ -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]*(?<v>.*)$"; "i").v | gsub("[ \t]"; "") ) as $v
| if $v == "-" or $v == "" then
( $cl.line | capture("blocked-by:[ \t]*(?<v>.*)$"; "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,
Expand Down
6 changes: 5 additions & 1 deletion skills/super-board/references/block-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions skills/super-board/references/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,10 @@ Next: <builder | qa | reviewer | Eric | none>
- 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.
Expand Down Expand Up @@ -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`,
Expand Down
111 changes: 110 additions & 1 deletion tests/fixtures/deps-issues.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
Expand Down Expand Up @@ -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"
}
]
}
}
]
32 changes: 31 additions & 1 deletion tests/test-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"