repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

Stop the cycle from jamming itself (#118)

4c5bd615989987d1ad1f98dcc7c150d7160c29b1

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

## What forced this

The board stopped merging for roughly five hours with a fully approved
PR sitting in it. #112 had both verdicts, a green merge-gate, a current
branch and auto-merge armed, and would not merge. Three separate
mechanisms had to be cleared by hand before it did, and each one was
invisible from inside the repository.

## The call

Every brake in the cycle must be something a PR can clear by being
correct. `stalled` was not: it is the sweeper's diagnosis that a PR has
stopped moving, it counted as a merge blocker, and the hourly sweep
reapplied it to the PR it had just blocked. A reviewer that returns
without a verdict was not: the label is the contract, the exit code is
not, and a job that skipped silently was recorded as a passed
mission-critical gate. A code-scanning configuration that stops
reporting was not: it goes stale rather than away, and a path-skipped
scan produces "not found" rather than "skipped", so a docs-only PR could
arrive holding a neutral check nothing in the repository could see or
clear.

## What we deliberately didn't do

Did not restore `rust` to the CodeQL matrix, though the checklist
condition looked met once the workspace landed. The crates are 34 lines
of stubs, and a scan with nothing to analyse is the original failure — a
red rust scan on every PR is the same deadlock from the other side. Did
not give the settings audit any write capability, though the App now has
the scope: an agent that can rewrite the rules judging it undoes what
CODEOWNERS exists to enforce.

## Evidence

Clearing `stalled` alone took #112's merge-gate from failure to success
with no other change, and at the time every one of five open PRs carried
the label. The reviewer no-op is measured: 18.8s, two turns, zero tool
calls, no comment, no label, conclusion success. The stale
configurations were `language:rust` at `21a300aa` and a `python` entry
over a single prototype file, against `language:actions` scanned the
same hour.

## Surface touched

Five ADW workflows, two agent charters, and one new shared label source
under `.github/adw/`; closes #113 and #114.

## If this ages badly

If the label set needs a blocker back, it goes in
`.github/adw/gate-labels.sh` and both readers pick it up. If the verdict
assertion proves too strict — a reviewer legitimately ending without a
verdict — the case to add is a third accepted label, not removing the
check. The audit workflow is read-only and can be deleted without
consequence.

---------

Co-authored-by: Claude <noreply@anthropic.com>

Changed files (14)

+739 / −37 text lines

Diff layout

.claude/agents/planner.md

Modified

+13 / −0 text lines

75754. **Keep the board honest.** Fix cards stranded in the wrong column, milestones
7676 with stale membership, and `blocked` issues whose blocker already closed.
7777 `sweeper` brakes runaways; you keep the *structure* true.
79 Clearing a stale `blocked` is not housekeeping — it is the only way a
80 dependent slice ever becomes buildable again, because nothing clears that
81 label at the moment the blocker merges. Walk every open `blocked` issue each
82 pass and check its named blocker. A slice left falsely blocked is
83 indistinguishable from one genuinely waiting, and no builder will ever wake
84 for it.
86 Clear the label only when the blocker was actually **satisfied** — an issue
87 closed as completed, a PR merged. Closed is not the same as done: a PR closed
88 unmerged or an issue closed as not-planned means the dependency was abandoned,
89 and routing the dependent slice as buildable would send a builder at work
90 whose premise no longer holds. Re-anchor or close that slice instead.
78915. **Re-sync the roadmap.** Refresh `docs/plans/*` tables to match the current
7992 spec, catching any a dropped `plan-spec` left stale. This re-syncs the roadmap
8093 doc; it does not by itself reopen a rework work-order for a modification-delta the

.claude/agents/sweeper.md

Modified

+4 / −1 text lines

1717 to rebuild or close, so blocked PRs don't linger stale.
18183. Enforce limits: if too many PRs are in flight, hold new `ready`/`codex` work
1919 (count both builders' queues); if an agent has looped or reopened the same PR
20 repeatedly, freeze it and escalate.
20 repeatedly, freeze it and escalate. Freezing means `blocked` — `stalled` does
21 not hold the merge gate and is not meant to. `stalled` says a PR stopped
22 moving; `blocked` says it must not move. Reaching for the first when you mean
23 the second leaves a runaway free to merge.
21244. Report a one-line board state; stay silent when nothing changed.
2326## Artifact

.claude/agents/triager.md

Modified

+15 / −2 text lines

30306. **Gate readiness and scope.** Route to a builder (step 7) only a *single*,
3131 unambiguous, spec-covered deliverable — one walking-skeleton slice with **no
3232 hold label**. `ready`/`codex` are mutually exclusive with every hold —
33 `blocked`, `needs:info`, `needs:spec`, `needs:breakdown` — because a builder
33 `blocked`, `needs:info`, `needs:spec`, `needs:prototype`, `needs:breakdown`,
34 `risk:high` — because a builder
3435 fires on `ready`/`codex` alone and would launch work that isn't ready; a held
3536 issue gets its hold label and *no* builder label. If it is ambiguous,
3637 `needs:info` with one specific question (and no `ready`/`codex`). If it is **multiple
5859 specific file it changes — a vague "improve the workflows" is `needs:info`.
5960 A change to the **gate itself** (`.github/rulesets/**`, `CODEOWNERS`,
6061 `adw-gate.yml`, `adw-automerge.yml`, `.claude/settings.json`) is **owner-only**:
61 leave it unrouted and say so — no builder may edit the rules that judge it.
62 no builder may edit the rules that judge it. Label it `blocked` and say in one
63 line that the blocker is the owner. A note alone is not a route — nothing
64 reads prose, so an unlabelled owner-only issue is the same silent void as an
65 unrouted one, just with an explanation nobody consumes.
62668. File it into the **current** milestone if it fits the wave; otherwise leave it
6367 unmilestoned for `planner`. Never create a milestone — that is `planner`'s
6468 alone. Place the card on the board.
699. **Exit with a route, always.** Every issue you finish carries exactly one of:
70 a builder route (`ready`/`codex`), a hold naming what it waits on
71 (`needs:info`, `needs:spec`, `needs:prototype`, `needs:breakdown`, `blocked`),
72 or the owner-only note from step 7. An issue that leaves your hands fully
73 labelled — type, size, priority, anchor — but with none of these wakes no
74 builder and states no wait. It is a silent void: it looks triaged, so nobody
75 looks again, and the sweeper eventually rediscovers it as a generic stall.
76 #113 and #114 both left triage this way. If you cannot pick a route, the route
77 is `needs:info` with the question that would let you pick.
6679## Artifact
6780The **Issue** (labels, a short restated acceptance checklist, links) and its

.github/adw/gate-labels.sh

Added
new file mode 100644

+19 / −0 text lines

1# Single source of truth for the labels the merge gate reads.
2#
3# Sourced by adw-gate.yml (which decides mergeability) and adw-jam-detector.yml
4# (which must predict the same decision to tell an expected red gate from a
5# systemic one). These two agreed only by hand-copy until now; a divergence is
6# silent in both directions — an unknown blocker reads every held PR as a jam,
7# and an unknown verdict hides a real one.
8#
9# Both workflows read this from the BASE commit, never the PR head, so a PR
10# cannot widen or narrow the gate that judges it.
11#
12# `stalled` is deliberately NOT blocking. It is the sweeper's diagnosis that a
13# PR has stopped moving — a report, not a veto. Blocking on it made the sweeper's
14# own label the reason the PR could not merge, and the next hourly sweep saw the
15# same stuck PR and reapplied it. Anything that should genuinely hold a merge is
16# in the blocking list below on its own merits.
18REQUIRED_GATE_LABELS="reviewed security-cleared"
19BLOCKING_GATE_LABELS="risk:high blocked changes-requested needs:info needs:spec needs:prototype"

.github/adw/gate-labels.test.sh

Added
new file mode 100755

+188 / −0 text lines

1#!/usr/bin/env bash
2# Validation for the merge gate's label contract.
3#
4# Two things can silently break it. The label sets can drift between the shared
5# source and the bootstrap fallbacks that adw-gate and adw-jam-detector carry for
6# a base that predates the file — drift there is invisible until a PR is judged
7# by the wrong rules. And the gate decision itself can invert on a label whose
8# meaning changed, which is how `stalled` came to block the merge it diagnosed.
9#
10# Run: bash .github/adw/gate-labels.test.sh
11set -uo pipefail
12cd "$(dirname "$0")/../.."
14failures=0
15check() {
16 if [ "$2" = "$3" ]; then
17 printf 'ok %s\n' "$1"
18 else
19 printf 'FAIL %s\n expected: %s\n actual: %s\n' "$1" "$3" "$2"
20 failures=$((failures + 1))
21 fi
22}
24. .github/adw/gate-labels.sh
26# --- the gate decision, replicating adw-gate.yml's logic exactly -------------
27gate() {
28 local csv=",$1," held="" waiting="" b p
29 for b in $BLOCKING_GATE_LABELS; do
30 case "$csv" in *",$b,"*) held="$held $b";; esac
31 done
32 for p in $REQUIRED_GATE_LABELS; do
33 case "$csv" in *",$p,"*) ;; *) waiting="$waiting $p";; esac
34 done
35 if [ -n "$held" ]; then echo "held"; return; fi
36 if [ -n "$waiting" ]; then echo "waiting"; return; fi
37 echo "green"
38}
40check "both verdicts, nothing else -> green" \
41 "$(gate 'reviewed,security-cleared')" green
42check "unrelated labels do not hold" \
43 "$(gate 'reviewed,security-cleared,codex-reviewed,size:s')" green
44# The regression this whole change exists for: the sweeper's diagnosis must not
45# be the reason a finished PR cannot merge.
46check "stalled does NOT hold a fully approved PR" \
47 "$(gate 'reviewed,security-cleared,stalled')" green
48check "missing security verdict waits" \
49 "$(gate 'reviewed')" waiting
50check "missing correctness verdict waits" \
51 "$(gate 'security-cleared')" waiting
52check "no labels at all waits" \
53 "$(gate '')" waiting
55for blocker in risk:high blocked changes-requested needs:info needs:spec needs:prototype; do
56 check "$blocker holds even with both verdicts" \
57 "$(gate "reviewed,security-cleared,$blocker")" held
58done
60# --- the bootstrap fallbacks must equal the shared source --------------------
61# Both readers inline a copy for a base that lacks this file. A copy that drifts
62# is worse than no copy: the gate would judge PRs by rules nobody edited.
63fallback_of() {
64 sed -n "s/^ *\(${2}\)=\"\(.*\)\"$/\2/p" "$1" | head -1
65}
66for wf in .github/workflows/adw-gate.yml .github/workflows/adw-jam-detector.yml; do
67 check "$(basename "$wf") required fallback matches source" \
68 "$(fallback_of "$wf" REQUIRED_GATE_LABELS)" "$REQUIRED_GATE_LABELS"
69 check "$(basename "$wf") blocking fallback matches source" \
70 "$(fallback_of "$wf" BLOCKING_GATE_LABELS)" "$BLOCKING_GATE_LABELS"
71done
73# --- the reviewers' verdict assertion ---------------------------------------
74# Mirrors the accept/reject arms in adw-review.yml. The no-verdict case is #114:
75# a job that returned success having applied nothing at all.
76verdict() {
77 case ",$1," in
78 *",$2,"*|*",$3,"*) echo accept ;;
79 *) echo reject ;;
80 esac
81}
82check "reviewer accepts an approval" "$(verdict 'reviewed,security-cleared' reviewed changes-requested)" accept
83check "reviewer accepts a change-request" "$(verdict 'changes-requested' reviewed changes-requested)" accept
84check "reviewer rejects a silent no-op" "$(verdict 'security-cleared' reviewed changes-requested)" reject
85check "security accepts a clearance" "$(verdict 'reviewed,security-cleared' security-cleared risk:high)" accept
86check "security accepts an escalation" "$(verdict 'risk:high' security-cleared risk:high)" accept
87check "security rejects a silent no-op" "$(verdict 'reviewed' security-cleared risk:high)" reject
89# --- the "this job actually posted" proof ------------------------------------
90# Both reviewers post under one App identity and run concurrently, so recency
91# alone accepts the sibling's comment and leaves the sticky-`risk:high` hole
92# open. The first-line marker is what makes the proof specific to one job.
93# Input mirrors the workflow's jq: created_at TAB first-line-of-body.
94proof() {
95 printf '%b' "$2" \
96 | awk -F'\t' -v t="$1" -v m="$3" -v b="$BOT" -v sha="$SHA" \
97 '$2 == b && $1 >= t && index($3, m) == 1 && index($3, sha) > 0' \
98 | wc -l | tr -d ' '
99}
100BOT='agent-smith-bugabinga-adc[bot]'
101SHA=02a8366
102T=2026-07-25T12:00:00Z
103own="2026-07-25T12:01:00Z\t$BOT\tSecurity review: $SHA no findings.\n"
104sibling="2026-07-25T12:01:00Z\t$BOT\tReview: $SHA one blocker.\n"
105stale="2026-07-25T11:00:00Z\t$BOT\tSecurity review: $SHA no findings.\n"
106spoof="2026-07-25T12:01:00Z\tsome-human\tSecurity review: $SHA trust me.\n"
107# A cancelled prior-head run whose last comment lands in the same second the new
108# job starts: recency alone cannot separate it, the sha can.
109prev_head="2026-07-25T12:00:00Z\t$BOT\tSecurity review: f217b4a no findings.\n"
111check "security proof accepts its own fresh comment" \
112 "$(proof "$T" "$own" 'Security review:')" 1
113check "security proof rejects the sibling reviewer's comment" \
114 "$(proof "$T" "$sibling" 'Security review:')" 0
115check "security proof rejects its own stale comment" \
116 "$(proof "$T" "$stale" 'Security review:')" 0
117check "security proof rejects silence" \
118 "$(proof "$T" "" 'Security review:')" 0
119# The regression: sticky risk:high satisfies the label check, so if the sibling's
120# comment also satisfied the freshness check a silent security run would pass.
121check "sibling comment alone never proves the security run" \
122 "$(proof "$T" "$sibling$stale" 'Security review:')" 0
123check "reviewer proof accepts its own fresh comment" \
124 "$(proof "$T" "$sibling" 'Review:')" 1
125check "marker must match at the START of the line" \
126 "$(proof "$T" "2026-07-25T12:01:00Z\t$BOT\tRe: Security review: $SHA nope\n" 'Security review:')" 0
127check "a same-second comment for the previous head does not prove this one" \
128 "$(proof "$T" "$prev_head" 'Security review:')" 0
129check "a non-bot cannot forge the proof by using the prefix" \
130 "$(proof "$T" "$spoof" 'Security review:')" 0
132# --- which rulesets actually govern the default branch -----------------------
133# Ref conditions are globs, and `~ALL` on a tag ruleset governs no branch. The
134# first version of this matched three literal strings and, worse, compiled the
135# pattern against itself so every ruleset matched — a silent false "no drift".
136ruleset_governs() {
137 printf '%s' "$1" | jq -r --arg ref "refs/heads/main" '
138 select(.enforcement == "active" and .target == "branch")
139 | def globre: gsub("\\."; "\\\\.")
140 | [splits("\\*\\*")] | map(gsub("\\*"; "[^/]*")) | join(".*");
141 def matches($pats): any($pats[];
142 . as $p
143 | $p == "~ALL" or $p == "~DEFAULT_BRANCH" or
144 ($ref | test("^" + ($p | globre) + "$")));
145 if matches(.conditions.ref_name.include // [])
146 and (matches(.conditions.ref_name.exclude // []) | not)
147 then .rules[].type else empty end'
148}
149rs() { printf '{"enforcement":"%s","target":"%s","conditions":{"ref_name":{"include":%s,"exclude":%s}},"rules":[{"type":"R"}]}' "$1" "$2" "$3" "$4"; }
151check "default-branch ruleset governs main" \
152 "$(ruleset_governs "$(rs active branch '["~DEFAULT_BRANCH"]' '[]')")" R
153check "literal refs/heads/main governs main" \
154 "$(ruleset_governs "$(rs active branch '["refs/heads/main"]' '[]')")" R
155check "branch glob governs main" \
156 "$(ruleset_governs "$(rs active branch '["refs/heads/*"]' '[]')")" R
157check "release-only glob does not govern main" \
158 "$(ruleset_governs "$(rs active branch '["refs/heads/release/*"]' '[]')")" ""
159check "main explicitly excluded does not govern main" \
160 "$(ruleset_governs "$(rs active branch '["~ALL"]' '["refs/heads/main"]')")" ""
161check "tag ruleset never governs a branch" \
162 "$(ruleset_governs "$(rs active tag '["~ALL"]' '[]')")" ""
163check "disabled ruleset does not govern" \
164 "$(ruleset_governs "$(rs disabled branch '["~ALL"]' '[]')")" ""
165# GitHub's fnmatch stops `*` at a slash; mapping it to `.*` would claim a
166# branch-glob ruleset governs refs it does not.
167check "single-star glob does not cross a slash" \
168 "$(ruleset_governs "$(rs active branch '["refs/heads/*/x"]' '[]')")" ""
169check "double-star glob does cross a slash" \
170 "$(ruleset_governs "$(rs active branch '["refs/heads/**"]' '[]')")" R
172# --- gh api's flags are not jq's --------------------------------------------
173# `gh api` accepts --jq but has no --arg, so a jq variable must be bound by a
174# real jq on the far side of a pipe. Passing --arg to gh api fails only at the
175# moment the command actually runs, which for a scheduled audit can be long
176# after the change that broke it — and fixture-testing the filter alone cannot
177# catch it, because the filter is fine.
178bad=$(for f in .github/workflows/*.yml; do
179 grep -n -- '--arg' "$f" | grep 'gh api' | grep -vE '^[0-9]+:[[:space:]]*#' \
180 | sed "s|^|$f:|"
181 done)
182check "no workflow passes --arg to gh api" "${bad:-none}" none
184if [ "$failures" -ne 0 ]; then
185 printf '\n%d check(s) failed\n' "$failures"
186 exit 1
187fi
188printf '\nall checks passed\n'

.github/workflows/adw-automerge.yml

Modified

+17 / −1 text lines

99# owner merges their own). Requires the repo setting "Allow auto-merge" (#14).
1010name: adw-automerge
12# Arming once at open is not enough. A PR opened while the repo setting was off,
13# or whose arm step failed transiently, stays unarmed forever and merges only by
14# hand — #77 sat that way from 07-23. Label, unlabel and push events re-arm it,
15# and `--auto` is idempotent, so the cost of the extra runs is a few seconds of
16# runner time against a PR silently never merging.
17#
18# `unlabeled` matters as much as `labeled`: the moment that most often makes a
19# PR mergeable is a blocker being REMOVED — the planner dropping `blocked`, a
20# reviewer clearing `changes-requested`. Arming only on addition would miss the
21# event that actually unblocks.
22#
23# `synchronize` is deliberately absent. A push races adw-review's reset: both
24# fire on the same event, and if merge-gate reads labels before reset strips the
25# previous head's verdicts, it goes green on a review that never saw this code.
26# Arming there would let that race merge an unreviewed head. Every path to
27# mergeable ends in a label event anyway, which is where the arming belongs.
1228on:
1329 pull_request:
14 types: [opened, reopened, ready_for_review]
30 types: [opened, reopened, ready_for_review, labeled, unlabeled]
1632permissions:
1733 contents: write

.github/workflows/adw-gate.yml

Modified

+39 / −2 text lines

66# Green iff BOTH review verdicts are in (`reviewed` + `security-cleared`) AND no
77# blocking label is present. Re-runs on every label change so the gate re-decides
88# the moment a reviewer posts its verdict.
9#
10# The label sets live in .github/adw/gate-labels.sh, shared with the jam
11# detector, and are read from the BASE commit — a PR must not get to edit the
12# gate that judges it.
913name: adw-gate
1115on:
2529 name: merge-gate
2630 runs-on: ubuntu-latest
2731 steps:
32 # Base commit, never the PR head: the gate's own definition must not be
33 # editable by the branch it is judging. Sparse — only the label source.
34 - uses: actions/checkout@v5
35 with:
36 ref: ${{ github.event.pull_request.base.sha }}
37 sparse-checkout: .github/adw
38 sparse-checkout-cone-mode: false
2839 - name: Evaluate merge readiness from labels
2940 env:
3041 GH_TOKEN: ${{ github.token }}
3142 PR: ${{ github.event.pull_request.number }}
3243 REPO: ${{ github.repository }}
44 EVENT_ACTION: ${{ github.event.action }}
3345 run: |
3446 set -euo pipefail
47 # A new head has not been reviewed, whatever the labels currently say.
48 # adw-review's reset strips the previous head's verdicts, but it races
49 # this job: both fire on the same `synchronize`, and auto-merge stays
50 # armed across pushes, so a gate that read labels first could go green
51 # on a review that never saw this code and let it merge. Refusing on
52 # the push itself removes the race rather than narrowing it — the
53 # reviewers' own `labeled` events re-run this job once they re-earn.
54 if [ "$EVENT_ACTION" = "synchronize" ]; then
55 echo "::error::new head pushed — verdicts must be re-earned on this commit"
56 exit 1
57 fi
58 # BOOTSTRAP FALLBACK — keep in sync with .github/adw/gate-labels.sh;
59 # .github/adw/gate-labels.test.sh fails if these two ever disagree.
60 # A base that predates the shared file (this PR before it lands, a
61 # revert, an old branch cut) must degrade to the known-good label sets,
62 # not die on `source` under `set -e`. A gate that cannot read its own
63 # definition and therefore fails every PR is the jam this workflow
64 # exists to prevent.
65 if [ -f .github/adw/gate-labels.sh ]; then
66 . .github/adw/gate-labels.sh
67 else
68 echo "::warning::base lacks .github/adw/gate-labels.sh — using bootstrap defaults"
69 REQUIRED_GATE_LABELS="reviewed security-cleared"
70 BLOCKING_GATE_LABELS="risk:high blocked changes-requested needs:info needs:spec needs:prototype"
71 fi
3572 labels=$(gh pr view "$PR" --repo "$REPO" --json labels -q '[.labels[].name] | join(",")')
3673 echo "labels: [$labels]"
3774 csv=",$labels,"
3875 held=""
39 for b in "risk:high" blocked "changes-requested" "needs:info" "needs:spec" "needs:prototype" stalled; do
76 for b in $BLOCKING_GATE_LABELS; do
4077 case "$csv" in *",$b,"*) held="$held $b";; esac
4178 done
4279 waiting=""
43 for p in reviewed security-cleared; do
80 for p in $REQUIRED_GATE_LABELS; do
4481 case "$csv" in *",$p,"*) ;; *) waiting="$waiting $p";; esac
4582 done
4683 if [ -n "$held" ]; then echo "::error::merge held by label(s):$held"; exit 1; fi

.github/workflows/adw-jam-detector.yml

Modified

+34 / −3 text lines

6464 app-id: ${{ secrets.APP_ID }}
6565 private-key: ${{ secrets.APP_PRIVATE_KEY }}
67 # The gate's label sets, shared verbatim. Predicting the gate's verdict
68 # from a stale copy is how an expected red becomes a false jam.
69 - uses: actions/checkout@v5
70 with:
71 sparse-checkout: .github/adw
72 sparse-checkout-cone-mode: false
6774 - id: scan
6875 env:
6976 GH_TOKEN: ${{ steps.token.outputs.token }}
9097 # attempt that a label change supersedes before its gate run appears,
9198 # without treating comments or unrelated labels as a fresh PR state.
9299 : > fails.tsv
93 required_gate_labels=(reviewed security-cleared)
94 blocking_gate_labels=(risk:high blocked changes-requested needs:info needs:spec needs:prototype stalled)
100 # BOOTSTRAP FALLBACK — keep in sync with .github/adw/gate-labels.sh;
101 # .github/adw/gate-labels.test.sh fails if these two ever disagree.
102 # The detector must survive a checkout without the shared file for the
103 # same reason the gate must: dying on `source` would take out the
104 # dead-man's switch itself, which is the one thing that must not fail
105 # silently.
106 if [ -f .github/adw/gate-labels.sh ]; then
107 . .github/adw/gate-labels.sh
108 else
109 echo "::warning::checkout lacks .github/adw/gate-labels.sh — using bootstrap defaults"
110 REQUIRED_GATE_LABELS="reviewed security-cleared"
111 BLOCKING_GATE_LABELS="risk:high blocked changes-requested needs:info needs:spec needs:prototype"
112 fi
113 read -r -a required_gate_labels <<< "$REQUIRED_GATE_LABELS"
114 read -r -a blocking_gate_labels <<< "$BLOCKING_GATE_LABELS"
96116 has_label() {
97117 case $'\n'"$1"$'\n' in *$'\n'"$2"$'\n'*) return 0 ;; esac
132152 }
134154 for n in $prs; do
135 pr=$(gh pr view "$n" --repo "$REPO" --json labels,statusCheckRollup)
155 pr=$(gh pr view "$n" --repo "$REPO" --json labels,statusCheckRollup,commits)
136156 labels=$(printf '%s' "$pr" | jq -r '.labels[].name')
138158 if ! gate_should_be_green "$labels"; then
144164 continue
145165 fi
167 # Labels older than the head are not a verdict on the head. adw-gate
168 # refuses on a push, and for the moments between that push and the
169 # reset stripping the previous verdicts, the PR reads as "should be
170 # green" while being correctly red. Counting that window would let a
171 # burst of pushes across two approved PRs raise a jam out of the
172 # machinery working — the exact false alarm this scan exists to stop.
173 head_committed=$(printf '%s' "$pr" | jq -r '.commits[-1].committedDate // ""')
174 if [ -n "$head_committed" ] && [ "$head_committed" \> "$gate_label_transition" ]; then
175 continue
176 fi
147178 printf '%s' "$pr" | jq -r --arg gate_label_transition "$gate_label_transition" '
148179 ((.statusCheckRollup // [])
149180 | group_by(.name // .context)

.github/workflows/adw-plan.yml

Modified

+5 / −1 text lines

1515 issues:
1616 types: [labeled]
1717 schedule:
18 - cron: "23 5 * * 1" # weekly Monday groom
18 # Daily, not weekly. The groom is the only thing that clears a `blocked`
19 # label whose blocker has already merged, so a weekly cadence meant a slice
20 # could sit falsely blocked for six days after its dependency landed — #90
21 # and #91 did exactly that once #88 merged.
22 - cron: "23 5 * * *"
1923 workflow_dispatch:
2024 inputs:
2125 base_sha:

.github/workflows/adw-review.yml

Modified

+126 / −2 text lines

88# The reset job strips stale verdict labels first (except sticky `risk:high`), so
99# a new push can't inherit a prior review's pass — the reviewers re-earn it on the
1010# current head.
11#
12# Each reviewer's contract is its LABEL, not its exit code. A model can return a
13# clean success having called no tool and said nothing, which GitHub then records
14# as a passed mission-critical gate; seen on #77, where the security job went
15# green in 18.8s over two turns with no comment and no verdict. So every review
16# job asserts that it actually labelled, and fails loudly when it didn't — a
17# silent skip becomes a red check the rest of the machinery can already escalate.
1118name: adw-review
1320on:
3239 PR: ${{ github.event.pull_request.number }}
3340 REPO: ${{ github.repository }}
3441 run: |
42 set -uo pipefail
3543 # risk:high is deliberately NOT stripped: once security-reviewer
3644 # escalates, only the owner de-escalates it.
37 for l in reviewed security-cleared changes-requested stalled; do
45 stripped="reviewed security-cleared changes-requested stalled"
46 for l in $stripped; do
47 # Removing an absent label errors, which is why failures are ignored
48 # here — but that also swallows a genuine API failure, and a verdict
49 # that survives the reset is a previous head's judgement standing in
50 # for this one.
3851 gh pr edit "$PR" --repo "$REPO" --remove-label "$l" 2>/dev/null || true
3952 done
53 # So verify rather than assume. The reviewers depend on this job, so
54 # failing here stops them running and leaves the gate red — a stale
55 # verdict never gets the chance to authorise the new head.
56 # -e is off so an absent-label removal above can fail harmlessly, which
57 # means this read must be checked by hand: an unchecked failure leaves
58 # `remaining` empty and reports "cleared" on no evidence at all.
59 if ! remaining=$(gh pr view "$PR" --repo "$REPO" --json labels \
60 -q '[.labels[].name] | join(",")'); then
61 echo "::error::could not read labels to confirm the reset"
62 exit 1
63 fi
64 csv=",$remaining,"
65 survived=""
66 for l in $stripped; do
67 case "$csv" in *",$l,"*) survived="$survived $l";; esac
68 done
69 if [ -n "$survived" ]; then
70 echo "::error::reset failed to strip:$survived — refusing to let a"\
71 "previous head's verdict stand for this one"
72 exit 1
73 fi
74 echo "verdict labels cleared for the new head"
4176 reviewer:
4277 needs: reset
4883 with:
4984 app-id: ${{ secrets.APP_ID }}
5085 private-key: ${{ secrets.APP_PRIVATE_KEY }}
86 - name: Mark the start of this review
87 run: echo "REVIEW_STARTED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_ENV"
5188 - uses: anthropics/claude-code-action@v1
5289 with:
5390 github_token: ${{ steps.token.outputs.token }}
6097 the spec, craft lenses. Do not merge.
6198 Post ONE terse PR comment: findings as one-line bullets (file:line —
6299 the defect), most severe first, no preamble/praise/restating; a clean
63 pass is one line. Then apply your verdict as a label: on approve add
100 pass is one line. The comment's FIRST LINE must begin with exactly
101 `Review: ${{ github.event.pull_request.head.sha }}` — the workflow
102 proves this job reviewed THIS commit by finding that prefix and that
103 sha, and a comment without both reads as if you never posted.
104 Then apply your verdict as a label: on approve add
64105 `reviewed` and remove `changes-requested`; on request-changes add
65106 `changes-requested` and remove `reviewed`.
66107 You are a mission-critical gate.
67108 claude_args: --model claude-opus-4-8 --effort xhigh --dangerously-skip-permissions
109 - name: Assert a verdict was cast
110 if: always()
111 env:
112 GH_TOKEN: ${{ steps.token.outputs.token }}
113 PR: ${{ github.event.pull_request.number }}
114 REPO: ${{ github.repository }}
115 MARKER: "Review:"
116 REVIEW_BOT: "agent-smith-bugabinga-adc[bot]"
117 HEAD_SHA: ${{ github.event.pull_request.head.sha }}
118 run: |
119 set -euo pipefail
120 labels=$(gh pr view "$PR" --repo "$REPO" --json labels -q '[.labels[].name] | join(",")')
121 case ",$labels," in
122 *,reviewed,*|*,changes-requested,*) ;;
123 *)
124 echo "::error::reviewer ended without a verdict label (have: [$labels]);"\
125 "expected reviewed or changes-requested"
126 exit 1 ;;
127 esac
128 # A label can outlive the run that set it, so label presence alone
129 # cannot prove this run did anything. The charter requires one comment
130 # per review, so a comment newer than the job start is the evidence —
131 # but it must be THIS job's comment. reviewer and security-reviewer run
132 # in parallel under one App identity, so author cannot separate them
133 # and a bare recency count is satisfied by the sibling's post. The
134 # marker names the job and the head sha names the commit, so no earlier
135 # run can satisfy it however the clocks fall — a second-resolution
136 # timestamp alone could be tied by a cancelled run's last comment.
137 # ISO-8601 sorts lexically, which is all the date comparison needs.
138 posted=$(gh api "repos/$REPO/issues/$PR/comments" --paginate \
139 --jq '.[] | [.created_at, .user.login, (.body | split("\n")[0])] | @tsv' \
140 | awk -F'\t' -v t="$REVIEW_STARTED_AT" -v m="$MARKER" -v b="$REVIEW_BOT" \
141 -v sha="$HEAD_SHA" \
142 '$2 == b && $1 >= t && index($3, m) == 1 && index($3, sha) > 0' | wc -l)
143 if [ "$posted" -eq 0 ]; then
144 echo "::error::reviewer posted no '$MARKER' comment for $HEAD_SHA"\
145 "this run; the verdict label is stale, not earned"
146 exit 1
147 fi
148 echo "verdict cast and $posted '$MARKER' comment(s) posted — labels: [$labels]"
69150 security-reviewer:
70151 needs: reset
76157 with:
77158 app-id: ${{ secrets.APP_ID }}
78159 private-key: ${{ secrets.APP_PRIVATE_KEY }}
160 - name: Mark the start of this review
161 run: echo "REVIEW_STARTED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_ENV"
79162 - uses: anthropics/claude-code-action@v1
80163 with:
81164 github_token: ${{ steps.token.outputs.token }}
88171 injection, supply chain. Do not merge.
89172 Post ONE terse PR comment: only real findings as one-line bullets
90173 (file:line — the risk), most severe first; a clean pass is one line.
174 The comment's FIRST LINE must begin with exactly
175 `Security review: ${{ github.event.pull_request.head.sha }}` — the
176 workflow proves this job reviewed THIS commit by finding that prefix
177 and that sha, and a comment without both reads as if you never posted.
91178 Then apply your verdict: if nothing high-severity add `security-cleared`;
92179 on a high finding add `risk:high` and ensure `security-cleared` is
93180 absent (holds the merge for the owner).
94181 You are a mission-critical gate.
95182 claude_args: --model claude-opus-4-8 --effort high --dangerously-skip-permissions
183 - name: Assert a verdict was cast
184 if: always()
185 env:
186 GH_TOKEN: ${{ steps.token.outputs.token }}
187 PR: ${{ github.event.pull_request.number }}
188 REPO: ${{ github.repository }}
189 MARKER: "Security review:"
190 REVIEW_BOT: "agent-smith-bugabinga-adc[bot]"
191 HEAD_SHA: ${{ github.event.pull_request.head.sha }}
192 run: |
193 set -euo pipefail
194 labels=$(gh pr view "$PR" --repo "$REPO" --json labels -q '[.labels[].name] | join(",")')
195 case ",$labels," in
196 *,security-cleared,*|*,risk:high,*) ;;
197 *)
198 echo "::error::security-reviewer ended without a verdict label (have: [$labels]);"\
199 "expected security-cleared or risk:high"
200 exit 1 ;;
201 esac
202 # `risk:high` deliberately survives the reset, so on this path the
203 # label check alone is satisfiable by a sticky label from an earlier
204 # run — a no-op review would pass green, which is exactly the bug this
205 # assertion exists to catch. The evidence must therefore be this job's
206 # own comment: both reviewers post under one App identity and run in
207 # parallel, so a bare recency count would accept the sibling's comment
208 # and leave the hole open on precisely the path that needs it closed.
209 posted=$(gh api "repos/$REPO/issues/$PR/comments" --paginate \
210 --jq '.[] | [.created_at, .user.login, (.body | split("\n")[0])] | @tsv' \
211 | awk -F'\t' -v t="$REVIEW_STARTED_AT" -v m="$MARKER" -v b="$REVIEW_BOT" \
212 -v sha="$HEAD_SHA" \
213 '$2 == b && $1 >= t && index($3, m) == 1 && index($3, sha) > 0' | wc -l)
214 if [ "$posted" -eq 0 ]; then
215 echo "::error::security-reviewer posted no '$MARKER' comment for"\
216 "$HEAD_SHA this run; the verdict label is stale, not earned"
217 exit 1
218 fi
219 echo "verdict cast and $posted '$MARKER' comment(s) posted — labels: [$labels]"

.github/workflows/adw-selftest.yml

Added
new file mode 100644

+34 / −0 text lines

1# ADW self-test — the deterministic checks on the cycle's own contracts.
2#
3# The gate's label sets are duplicated by necessity: adw-gate and
4# adw-jam-detector each inline a bootstrap copy for a base that predates the
5# shared file. Duplication that nothing checks is how the two drifted apart in
6# the first place, so the drift is checked here instead of trusted.
7#
8# No LLM, no network, no tokens — plain shell over files in the repo. It runs on
9# every PR touching the ADW so a change to the label contract cannot land
10# without its consequences being asserted.
11name: adw-selftest
13on:
14 pull_request:
15 paths:
16 - '.github/adw/**'
17 - '.github/workflows/adw-*.yml'
18 push:
19 branches: [ "main" ]
20 paths:
21 - '.github/adw/**'
22 - '.github/workflows/adw-*.yml'
23 workflow_dispatch: {}
25permissions:
26 contents: read
28jobs:
29 gate-labels:
30 runs-on: ubuntu-latest
31 steps:
32 - uses: actions/checkout@v5
33 - name: Gate label contract
34 run: bash .github/adw/gate-labels.test.sh

.github/workflows/adw-settings-audit.yml

Added
new file mode 100644

+190 / −0 text lines

1# ADW settings audit — read the repository configuration that no file in this
2# repo can prove.
3#
4# Two blind spots cost hours on #112. First, `.github/rulesets/main.json` is the
5# source of truth by convention only: it is applied through the UI by hand, so
6# what actually guards `main` may differ from what the file says, and every
7# diagnosis that trusts the file inherits the drift. Second, code scanning
8# remembers configurations it has seen on the base branch; one that stops
9# reporting goes stale rather than away, and a stale entry turns every PR's
10# code-scanning check neutral — visible nowhere in Actions, because nothing
11# fails.
12#
13# Strictly read-only. It prints what is; it changes nothing. Applying a ruleset
14# or deleting a stale configuration stays the owner's, on purpose: an agent that
15# could rewrite the rules judging it would undo what CODEOWNERS exists to
16# enforce.
17name: adw-settings-audit
19on:
20 workflow_dispatch: {}
21 schedule:
22 - cron: "41 6 * * 1" # weekly — drift is slow, and this is a report
24permissions:
25 contents: read
27jobs:
28 audit:
29 runs-on: ubuntu-latest
30 steps:
31 - id: token
32 uses: actions/create-github-app-token@v3
33 with:
34 app-id: ${{ secrets.APP_ID }}
35 private-key: ${{ secrets.APP_PRIVATE_KEY }}
37 - uses: actions/checkout@v5
39 - name: Applied rulesets vs the file
40 env:
41 GH_TOKEN: ${{ steps.token.outputs.token }}
42 REPO: ${{ github.repository }}
43 BRANCH: ${{ github.event.repository.default_branch }}
44 run: |
45 set -euo pipefail
46 {
47 echo "## Rulesets actually applied to \`main\`"
48 echo
49 } >> "$GITHUB_STEP_SUMMARY"
51 # Needs Administration: read. Say so plainly rather than failing with a
52 # bare 403 — a missing scope and an empty ruleset list look identical
53 # in the output otherwise.
54 if ! rulesets=$(gh api "repos/$REPO/rulesets" 2>/dev/null); then
55 echo "Could not read rulesets — the App is missing **Administration: read**." \
56 >> "$GITHUB_STEP_SUMMARY"
57 exit 0
58 fi
60 # /rulesets lists everything defined on the repository, including
61 # rulesets that target other refs or are disabled. Saying "N applied to
62 # main" off that raw count would be the same kind of false confidence
63 # this job exists to remove, so report the scope plainly and let the
64 # per-ruleset target and enforcement below carry the truth.
65 count=$(printf '%s' "$rulesets" | jq 'length')
66 active=$(printf '%s' "$rulesets" | jq '[.[] | select(.enforcement == "active")] | length')
67 {
68 echo "$count ruleset(s) defined on the repository, $active active."
69 echo "Scope is per-ruleset — read \`target\` and \`enforcement\` on each."
70 echo "The repo file describes one."
71 echo
72 } >> "$GITHUB_STEP_SUMMARY"
74 printf '%s' "$rulesets" | jq -r '.[] | "\(.id)\t\(.name)\t\(.target)\t\(.enforcement)"' \
75 | while IFS=$'\t' read -r id name target enforcement; do
76 {
77 echo "### $name (id $id, $target, $enforcement)"
78 echo '```json'
79 } >> "$GITHUB_STEP_SUMMARY"
80 gh api "repos/$REPO/rulesets/$id" \
81 --jq '{rules: [.rules[] | {type, parameters}], bypass_actors}' \
82 >> "$GITHUB_STEP_SUMMARY"
83 echo '```' >> "$GITHUB_STEP_SUMMARY"
84 done
86 # The rule types the file claims, against the rule types actually live.
87 # A type present in one and not the other is the drift worth seeing;
88 # comparing full parameter trees would bury it in noise.
89 #
90 # KNOWN LIMIT: types only. Swapping the required check away from
91 # merge-gate, turning off code-owner review, or widening bypass_actors
92 # all keep the type and change the meaning, and this table would call
93 # that agreement. Those parameters are printed verbatim per ruleset
94 # above, so the report carries the evidence even though the comparison
95 # does not judge it — read the JSON, not just this row.
96 #
97 # Only rulesets that ACTUALLY govern the default branch may enter the
98 # comparison. Unioning every defined ruleset would invent drift from a
99 # disabled or other-branch rule, and — worse — could mask a missing
100 # main rule behind an identical type defined elsewhere. Enforcement and
101 # ref conditions are both part of "does this judge main".
102 file_types=$(jq -r '[.rules[].type] | sort | join(", ")' .github/rulesets/main.json)
103 # Ref conditions are glob patterns, and `~ALL` on a TAG ruleset governs
104 # no branch at all. Matching three literal strings would both count
105 # tag rules and miss `refs/heads/*`, so the patterns are matched as
106 # globs and the target is checked.
107 live_types=$(printf '%s' "$rulesets" \
108 | jq -r '.[] | select(.enforcement == "active" and .target == "branch") | .id' \
109 | while read -r id; do
110 # Piped to a real jq: `gh api` accepts --jq but has no --arg, so
111 # the ref has to be bound on this side of the pipe.
112 gh api "repos/$REPO/rulesets/$id" \
113 | jq -r --arg ref "refs/heads/$BRANCH" '
114 # GitHub matches refs with fnmatch, where `*` stops at a `/`
115 # and `**` crosses it. Mapping both to `.*` would report
116 # refs/heads/* as governing refs/heads/feature/x and overstate
117 # which rules apply. splits() on `**` rather than a placeholder
118 # string, because any placeholder can occur in a real pattern.
119 def globre: gsub("\\."; "\\\\.")
120 | [splits("\\*\\*")] | map(gsub("\\*"; "[^/]*")) | join(".*");
121 # $p is bound before the test: inside `$ref | test(...)` the
122 # dot would refer to $ref, so the pattern would compile to
123 # itself and match everything.
124 def matches($pats): any($pats[];
125 . as $p
126 | $p == "~ALL" or $p == "~DEFAULT_BRANCH" or
127 ($ref | test("^" + ($p | globre) + "$")));
128 if matches(.conditions.ref_name.include // [])
129 and (matches(.conditions.ref_name.exclude // []) | not)
130 then .rules[].type else empty end'
131 done \
132 | sort -u | paste -sd', ' -)
133 [ -n "$live_types" ] || live_types="(none governing the default branch)"
134 {
135 echo "### Rule types"
136 echo
137 echo "| source | types |"
138 echo "| --- | --- |"
139 echo "| \`main.json\` | $file_types |"
140 echo "| applied | $live_types |"
141 } >> "$GITHUB_STEP_SUMMARY"
143 - name: Code scanning configurations, and which are stale
144 env:
145 GH_TOKEN: ${{ steps.token.outputs.token }}
146 REPO: ${{ github.repository }}
147 BRANCH: ${{ github.event.repository.default_branch }}
148 run: |
149 set -euo pipefail
150 {
151 echo
152 echo "## Code scanning configurations on \`$BRANCH\`"
153 echo
154 } >> "$GITHUB_STEP_SUMMARY"
156 # --paginate, not a single page: the stale categories are by definition
157 # the OLDEST analyses, so capping at the newest 100 would hide exactly
158 # what this is looking for.
159 if ! analyses=$(gh api --paginate --slurp \
160 "repos/$REPO/code-scanning/analyses?ref=refs/heads/$BRANCH&per_page=100" \
161 --jq 'add' 2>/dev/null); then
162 echo "Could not read analyses — the App is missing **Code scanning alerts: read**." \
163 >> "$GITHUB_STEP_SUMMARY"
164 exit 0
165 fi
167 # One row per category, newest analysis first. A category whose newest
168 # analysis is old is the stale configuration GitHub still expects and
169 # the workflow no longer produces — the thing that makes the PR check
170 # neutral with "N configurations not found".
171 {
172 echo "| category | tool | latest analysis | age (days) |"
173 echo "| --- | --- | --- | --- |"
174 } >> "$GITHUB_STEP_SUMMARY"
176 now=$(date -u +%s)
177 printf '%s' "$analyses" \
178 | jq -r 'group_by(.category)[] | max_by(.created_at)
179 | [(.category // "(none)"), .tool.name, .created_at] | @tsv' \
180 | while IFS=$'\t' read -r category tool created; do
181 age=$(( (now - $(date -u -d "$created" +%s)) / 86400 ))
182 echo "| \`$category\` | $tool | $created | $age |" >> "$GITHUB_STEP_SUMMARY"
183 done
185 {
186 echo
187 echo "A category the current matrix no longer builds keeps its entry here."
188 echo "That is the stale configuration: delete it at"
189 echo "\`/security/code-scanning/tools\` — this job will not do it for you."
190 } >> "$GITHUB_STEP_SUMMARY"

.github/workflows/codeql.yml

Modified

+42 / −22 text lines

1212name: "CodeQL Advanced"
14# Incremental scans run only when code or a workflow changes — a docs/config/
15# markdown PR has nothing for CodeQL to analyze. The weekly schedule is the
16# full-tree backstop. (Safe: CodeQL is not a required merge check; only
17# `merge-gate` is, so a path-skipped run can't wedge a PR.)
14# Runs on EVERY push and pull request, with no path filter. Skipping a scan on a
15# docs-only PR saved a minute of runner time and cost far more than that: code
16# scanning compares a PR against the configurations present on the base branch,
17# and a configuration that produces no analysis — because the workflow was
18# path-skipped, or because the language left the matrix — is "not found" rather
19# than "fine". The check then goes NEUTRAL, which is not a failure and so appears
20# nowhere as one. Every configuration must report on every pull request.
21#
22# The weekly schedule stays as the full-tree backstop.
23#
24# The header used to argue this was safe "because CodeQL is not a required merge
25# check; only `merge-gate` is". Whatever the ruleset requires, dropping a
26# language has a cost this missed: code scanning remembers the configurations it
27# has seen on the base branch, and one that stops reporting does not disappear —
28# it goes STALE. GitHub then cannot diff a PR's alerts against a baseline, and
29# posts "Code scanning results / CodeQL — N configurations not found" as a
30# NEUTRAL check. #112 sat with every verdict in and merge-gate green, showing
31# "All checks have passed" and "Unable to merge — some checks did not pass" in
32# the same view.
33#
34# Stale configurations are cleared from the repository's code-scanning tool
35# status page, not from this file. The deadlock the RE-ADD CHECKLIST below warns
36# about is therefore not only a risk when ADDING a language — REMOVING one arms
37# it too, and the cleanup does not live in this repository. Any change to the
38# matrix must be paired with a look at that page.
1839on:
1940 push:
2041 branches: [ "main" ]
21 paths: &scan
22 - '**/*.rs'
23 - '!prototypes/**' # disposable (SPEC §18) — excluded from analysis anyway; don't even trigger
24 - '.github/workflows/**'
2542 pull_request:
2643 branches: [ "main" ]
27 paths: *scan
2844 schedule:
2945 - cron: '27 23 * * 6'
5268 fail-fast: false
5369 matrix:
5470 include:
55 # Only `actions` for now — it is the only code that exists (the ADW's own
56 # workflows). `rust` is dropped until production Rust lands: with the
57 # workspace absent and prototypes excluded, a rust scan finds nothing,
58 # FAILS, and (with code-scanning merge protection on) blocks every PR.
71 # `actions` covers the ADW's own workflows, and is deliberately the only
72 # entry. The stale `language:rust` configuration that wedged #112 was
73 # deleted on the tool status page rather than revived here: the seven
74 # production crates are 34 lines of stubs, and the original reason for
75 # dropping rust — a scan with nothing to analyse fails — is not clearly
76 # retired by stubs. Re-adding it on that evidence risked a red scan on
77 # every PR, which is the same deadlock from the other side.
5978 #
60 # RE-ADD CHECKLIST (as of 2026-07-22, no production Rust / no site/ yet):
61 # - Production Rust lands → add `- language: rust` with `build-mode:
62 # none` (CodeQL's Rust extractor is source-based; the workspace need
63 # not compile). Confirm CodeQL Rust is GA — it has been in preview;
64 # if still beta, coverage is thinner than the C/JS packs.
79 # RE-ADD CHECKLIST (as of 2026-07-25):
80 # - The crates carry real code → add `- language: rust` with
81 # `build-mode: none` (the Rust extractor is source-based, so the
82 # workspace need not compile), and confirm the scan is green on main
83 # BEFORE relying on it.
6584 # - `site/` (Astro) lands → add `- language: javascript-typescript`.
6685 # Note its extractor only partially parses `.astro` SFCs (embedded
6786 # JS, not the template DSL); DevSkim + npm-audit/Dependabot carry the
6887 # site's real coverage.
69 # - Each language added changes the produced result-count. Keep code
70 # scanning ALERTS-ONLY (never a required merge check — only
71 # `merge-gate` is required) or every such change re-creates the
72 # "expecting N results" merge deadlock. See #17.
88 # - Adding OR removing a language changes the set of configurations
89 # code scanning expects. A removed one goes stale rather than away,
90 # and a stale configuration makes every PR's code-scanning check
91 # neutral until it is deleted on the tool status page. Do that in the
92 # same change that edits this matrix. See #116, #17.
7393 - language: actions
7494 build-mode: none
7595 # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'

docs/plans/AGENTIC-DEVELOPMENT.md

Modified

+13 / −3 text lines

279279| When… | Detected by | Handled by | Routes to |
280280|---|---|---|---|
281| CI is red | CI gates | `sweeper` (hourly) | re-kicks `builder` to self-heal; brakes `stalled` if no progress |
281| CI is red | CI gates | `sweeper` (hourly) | re-kicks `builder` to self-heal; `blocked` if no progress — `stalled` reports a stall, it does not hold the gate |
282282| review requests changes | `reviewer` | `builder` via `adw-revise` | revise on the same branch → re-review on push |
283283| PR green but unmerged / conflicted / `ready` with no branch | schedule | `sweeper` | re-kick if tractable, else label `stalled` with why |
284284| change is high-risk / high-severity | `security-reviewer` | owner | `risk:high` → **touchpoint 3**; never auto-merges |
334334 job that reads the PR's labels and is green only when both review verdicts are
335335 in (`reviewed` + `security-cleared`) and no blocking label
336336 (`risk:high`, `blocked`, `changes-requested`, `needs:info`, `needs:spec`,
337 `needs:prototype`, `stalled`) is present — the exact set `adw-gate.yml` holds
338 on. CI checks join this list once the workspace CI lands.
337 `needs:prototype`) is present. The set lives in `.github/adw/gate-labels.sh`,
338 which the gate and the jam detector both read, so the two cannot drift apart.
339 CI checks join this list once the workspace CI lands.
341 `stalled` is deliberately **not** in that set. It is the sweeper's diagnosis
342 that a PR has stopped moving — a report, not a veto — and blocking on it made
343 the sweeper the reason its own subject could not merge: the hourly pass
344 labelled a waiting PR, the label turned the gate red, the red gate kept it
345 waiting, and the next pass labelled it again. Every blocker above is something
346 a PR clears by *being correct*; a stall is cleared by moving, which is what
347 the label reports. When the sweeper needs to genuinely freeze a runaway it
348 applies `blocked`, which holds.
3393493. The reviewers cast their verdict **as labels**, not approvals — deliberately.
340350 `builder`, `reviewer`, and `security-reviewer` are one GitHub identity (the
341351 App), and GitHub forbids approving your own PR, so a required *approval* could