Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Let the run be an ordinary session, with GitHub as its interface

Daoud Clarkeedbf82c31e86
diff --git a/.github/claude/implement-issue.md b/.github/claude/implement-issue.md
index 8725b6c..d710ed8 100644
--- a/.github/claude/implement-issue.md
+++ b/.github/claude/implement-issue.md
@@ -6,7 +6,8 @@ unbuilt part of one issue, verified green.
`ISSUE_NUMBER` is in the prompt; `$N` below means that number. You are inside the run
described by `.github/claude/run.md`: come back to its section 4 when you have committed,
-which is where the change is reviewed and handed to the publish step. Commit and stop.
+which is where the change is reviewed, pushed and turned into a pull request. Commit and
+stop.
## 1. Decide what to build
diff --git a/.github/claude/plan-issue.md b/.github/claude/plan-issue.md
index 7cf4e11..7d65ae8 100644
--- a/.github/claude/plan-issue.md
+++ b/.github/claude/plan-issue.md
@@ -6,7 +6,8 @@ to turn one issue into a written plan: one commit adding exactly one file.
`ISSUE_NUMBER` is in the prompt; `$N` below means that number. You are inside the run
described by `.github/claude/run.md`: come back to its section 4 when you have committed,
-which is where the plan is reviewed and handed to the publish step. Commit and stop.
+which is where the plan is reviewed, pushed and turned into a pull request. Commit and
+stop.
## 1. Understand the issue
diff --git a/.github/claude/review-changes.md b/.github/claude/review-changes.md
index 82371e3..8438a76 100644
--- a/.github/claude/review-changes.md
+++ b/.github/claude/review-changes.md
@@ -69,7 +69,8 @@ not in this commit.
## Rules
-- Never `git push`, never `gh pr create`, never merge. The publish step pushes.
+- Never `git push`, never `gh pr create`, never merge. The run that spawned you pushes,
+ once you have returned.
- Never amend, rebase or reorder the commit you are reviewing. Add commits on top, so the
reviewer can see what the build did and what the review changed.
- Never weaken, skip or delete a test to make a gate pass. If a test is wrong, fix the
diff --git a/.github/claude/run.md b/.github/claude/run.md
index c24fea5..c14d1b0 100644
--- a/.github/claude/run.md
+++ b/.github/claude/run.md
@@ -1,13 +1,13 @@
# Work on one issue
You are Claude Code running in GitHub Actions on a checkout of `main`, with the project
-installed and a test database up. You are the whole run: you decide what this issue needs,
-do it, have it reviewed, and leave the branch ready to publish.
+installed and a test database up. This is the session you would have in a terminal, with
+GitHub as the interface instead of a person: you decide what this issue needs, do it, have
+it reviewed, and push it yourself.
-A shell step publishes afterwards — it re-runs both gates, pushes, and opens or updates the
-pull request from what you leave behind. **Never `git push`, and never run `gh pr create`.**
-That step is not a formality: it checks your work rather than taking your word for it, and
-it refuses to publish a branch you did not have reviewed.
+Nothing downstream checks your work and nothing downstream finishes it. A shell step chose
+this issue before you started; after you stop, the only thing that runs is the classifier
+that reports how the job ended. What reaches a human is what you push and what you write.
Committing is not the only thing you can do, and it is often not the useful one. Answering
a question, saying what you could not work out, recording what you learnt on the issue and
@@ -22,7 +22,6 @@ The prompt carries:
the state calls for something else, say so in your final message and do the right thing.
- `PULL_REQUEST` — the open pull request's number for a `respond` item, `0` otherwise.
- `REASON` — why the selector woke you.
-- `REPORT_DIR` — where section 4 writes the two files the publish step reads.
## 1. Read the state before choosing
@@ -57,7 +56,7 @@ marker — that would rebuild work that is already merged.
**Answer feedback on the open pull request.** `gh pr checkout $PULL_REQUEST`, make the
change, get both gates green, commit. Address every point that was raised: where you
-disagree, say why in your final message rather than silently skipping it, and where a
+disagree, say why on the pull request rather than silently skipping it, and where a
request is outside this part's scope, put it in the plan as a later section instead of
growing this pull request past its budget.
@@ -68,25 +67,16 @@ the environment — say so on the pull request with the evidence and commit noth
than committing a change that pretends to fix it.
**Rebase onto main.** The branch conflicts. `gh pr checkout $PULL_REQUEST`, then
-`git rebase origin/main`, resolve, re-run both gates. Write `rebased: true` in the report
-file described in section 4, so the publish step force-pushes rather than failing on a
-non-fast-forward.
+`git rebase origin/main`, resolve, re-run both gates. A rebase cannot fast-forward, so
+section 5 pushes it with `--force-with-lease`.
**Answer the question, and commit nothing.** The feedback asks about the change rather
than asking for a change to it: why it was done this way, whether something was
considered, what a test actually covers. Work the answer out from the code — not from what
-the pull request body claims — and post it on the thread it was asked on:
-
-```
-gh pr comment $PULL_REQUEST --body "...
-
-<!-- claude-run: answer -->"
-gh api repos/$REPOSITORY/pulls/comments/<comment-id>/replies -f body="..." # inline thread
-```
-
-Say what you looked at, so the reviewer can check the answer rather than take it. If
-working it out shows the reviewer was right, make the change instead: an articulate
-explanation of a mistake is worth nothing.
+the pull request body claims — and post it on the thread it was asked on. Say what you
+looked at, so the reviewer can check the answer rather than take it. If working it out
+shows the reviewer was right, make the change instead: an articulate explanation of a
+mistake is worth nothing.
**Ask, and commit nothing.** The issue or the feedback is too ambiguous to act on without
guessing. Post the specific questions that block you with `gh issue comment $N` (or
@@ -112,16 +102,6 @@ with write access labels it, and an automation that could label its own would be
itself. At most one per run, and never for a style preference, for something a plan
section already covers, or for anything you could simply have fixed here.
-**Any comment you post on a pull request must end with an HTML comment starting
-`<!-- claude-run:`.** That is how the selector recognises its own voice, and how it knows
-this commit has already had its turn; without it the same red checks would wake a run on
-every trigger from here to eternity.
-
-Committing nothing is a valid outcome. Nothing is published, and on a pull request the
-workflow comments to say the run changed nothing. Nothing else happens until a new commit
-lands or someone says something new, so whatever you post before you stop is all a human
-has to go on: make it specific.
-
## 3. Both gates must pass
Any action that changes code has to leave the branch green:
@@ -131,18 +111,20 @@ make check
uv run pytest
```
-`DATABASE_URL` and `DJANGO_SETTINGS_MODULE` are already set. Iterate until both pass. The
-publish step runs them again and will not push if they fail, so a branch you leave red is
-simply a wasted run. If something is genuinely beyond this change to fix, say exactly what
-fails and why — never describe a run as green when it is not.
+`DATABASE_URL` and `DJANGO_SETTINGS_MODULE` are already set. Iterate until both pass.
+Nobody re-runs these before you push: CI runs them on the branch minutes afterwards, and a
+red branch wakes another run to fix what this one could have. If something is genuinely
+beyond this change to fix, say exactly what fails and why — never describe a run as green
+when it is not.
## 4. Have the change reviewed, in a fresh context
-**If you committed anything, this section is not optional.** The publish step refuses to
-push a branch with no review report, so skipping it throws the run away.
+**If you committed anything, do this before you push.** A change reaches a human only
+after somebody other than its author has read it, and in this pipeline that is a subagent
+rather than a step.
-Spawn a subagent with the Agent tool and this prompt, verbatim, with `$N` substituted and
-nothing added:
+Spawn it with the Agent tool and this prompt, verbatim, with `$N` substituted and nothing
+added:
```
Follow the instructions in .github/claude/review-changes.md exactly.
@@ -155,31 +137,88 @@ checked, or what you would like it to conclude. It reads the diff cold, the way
does, and everything you add is you reviewing your own work through it. It has `Edit` and
`Bash`, and it commits its own fixes: its findings do not need your agreement to land.
-When it returns, write two files under `$REPORT_DIR`:
+Its final message is the only thing that comes back. Carry it into section 5: what it
+changed, what it found and left alone, and where you think it was wrong and why. Do not
+quietly drop a finding you disagreed with.
+
+## 5. Push it, and say what you did
-**`review.md`** — what the review reported, in its own terms: what it changed, what it
-found and left alone, and whether it committed. Where you think it was wrong, say so here
-and say why; do not quietly drop it. If it reported nothing, write that. Start the file
-with `rebased: true` on its own line if section 2 rebased the branch.
+**If you committed nothing**, there is nothing to push, and what you say is all a human
+has to go on. On a `respond` item you must comment on the pull request even when the
+answer is that you could not help: say what you were woken for, what you looked at, and
+why nothing changed. Otherwise say it on the issue. Then stop.
-**`pr-body.md`** — the pull request body, ready to post. What changed and why, how it was
-verified, what the review changed and what it left alone, what you deliberately did not
-do. End with `Part of #$N`, or `Closes #$N` when this finished the last section of the
-plan. For a plan branch, one paragraph on the approach and why it is split this way, then
-the sections with their line estimates, then `Part of #$N` — merging it is what starts
+An answer to a question belongs on the thread it was asked on, which for an inline review
+comment is not the conversation tab:
+
+```
+gh api repos/$REPOSITORY/pulls/comments/<comment-id>/replies -f body="..."
+```
+
+An inline reply is not a pull request comment, so it does not carry a marker and the
+selector never sees it. Post the pull request comment as well.
+
+**If you committed**, push the branch:
+
+```
+git push -u origin "$(git branch --show-current)"
+```
+
+Use `--force-with-lease` if you rebased in section 2, and only then.
+
+Then open or update the pull request:
+
+```
+gh pr list --head "$(git branch --show-current)" --state open --json number
+```
+
+**Nothing open:** `gh pr create`. The title names the work — the plan section's title, or
+`Plan: <issue title>` for a plan branch.
+
+**Already open:** the push updated it. Comment instead, saying what these commits change
+and which piece of feedback each one answers. Leave the original body alone: a reviewer
+coming back wants to see what moved since they left, not a description that quietly
+changed under them.
+
+The body, or the comment, says:
+
+- What changed and why, and what you deliberately did not do.
+- How it was verified: the results of both gates as *you* ran them in section 3.
+- What the review changed, and what it found and left alone.
+- The added lines outside `uv.lock`, `devdata/`, `front-end/` and `docs/plans/`, from
+ `git diff --numstat origin/main...HEAD`. Over 500 is a problem to report here, not to
+ fix by rewriting a change that has already been reviewed.
+- `Part of #$N`, or `Closes #$N` when this finished the last section of the plan.
+
+For a plan branch, one paragraph on the approach and why it is split this way, then the
+sections with their line estimates, then `Part of #$N`. Merging it is what starts
implementation, so make the trade-offs easy to review.
-Do not claim a gate is green in `pr-body.md`. The publish step measures that itself and
-appends what it measured.
+### The two markers
+
+Every comment you post on a pull request ends with an HTML comment, and which one decides
+whether this pull request wakes another run:
+
+- `<!-- claude-run: done -->` — **this commit has had its turn and nothing changed.** Use
+ it when you commit nothing: an answer, a question, a failure you could not fix. The
+ selector stops counting red checks and conflicts on this commit once it sees this, so
+ nothing wakes a run here again until a human replies or a new commit lands.
+- `<!-- claude-run: update -->` — **you pushed.** Use it on the comment that accompanies a
+ push. It tells the selector the comment is yours rather than a maintainer's, without
+ claiming the new commit has had its turn — CI has not even run on it yet.
+
+Getting these the wrong way round is expensive in both directions: `done` on a push
+silences the failing checks of the commit you just made, and `update` on a run that
+changed nothing puts this pull request back in the queue on every trigger for as long as
+the reason stands.
-## 5. Hand over
+## 6. Hand over
Your final message goes in the job log, not the pull request. Say which action you took
and why, what changed, what you deliberately did not do, and the results of both gates.
## Rules
-- Never `git push`. Never `gh pr create`. The publish step does both.
- Do not merge anything, and do not close the issue — the pull request closes it, by
saying `Closes #$N` when it finishes the last section of the plan.
- Do not add or remove labels, on this issue or on one you file. Labels are how a human
@@ -187,6 +226,7 @@ and why, what changed, what you deliberately did not do, and the results of both
- One action per run, and one pull request open per issue at a time.
- At most about 500 added lines including tests, excluding `uv.lock`, `devdata/`,
`front-end/` build output and `docs/plans/`.
+- Push only the branch you are on, and only ever `claude/*`. Never push `main`.
- You may change `.github/` when the issue calls for it. Editing an instruction file you
are following, or the workflow you are running under, takes effect only once a
maintainer merges the pull request — never part-way through this run.
diff --git a/.github/scripts/classify-claude-run.sh b/.github/scripts/classify-claude-run.sh
index b989dd2..babe5b7 100755
--- a/.github/scripts/classify-claude-run.sh
+++ b/.github/scripts/classify-claude-run.sh
@@ -13,10 +13,10 @@
# the same mistake, so the issue is labelled "claude: stuck" and the selector skips it
# until a human removes the label or reruns that issue alone with workflow_dispatch.
#
-# A publish step that refused counts as this run's failure too, and it is the one failure
-# the run log cannot show: publish-branch.sh rejects a branch whose gates fail or that has
-# no review report, both of which are the run's doing however cleanly the Claude step
-# ended. $PUBLISH_OUTCOME carries it in, as steps.publish.outcome.
+# This is the only step after the run, and it deliberately judges nothing about the change
+# itself. A run that pushed something wrong is caught by CI on the branch, which the
+# selector reads as a reason to wake another run — not by a gate here that would be reading
+# the same working tree the run just reported on.
set -euo pipefail
@@ -37,10 +37,6 @@ steps_matching() {
broken=$(steps_matching "($never_reached_model) | not")
out_of_credit=$(steps_matching "$never_reached_model")
-if [[ ${PUBLISH_OUTCOME:-} == failure ]]; then
- broken="${broken:+$broken }publish"
-fi
-
if [[ -n $broken ]]; then
echo "::error::Claude failed in: $broken. Labelling issue #$issue '$stuck_label' so the" \
"scheduled runs stop retrying it; remove the label, or rerun this issue alone with" \
diff --git a/.github/scripts/publish-branch.sh b/.github/scripts/publish-branch.sh
deleted file mode 100755
index d1e6812..0000000
--- a/.github/scripts/publish-branch.sh
+++ /dev/null
@@ -1,148 +0,0 @@
-#!/usr/bin/env bash
-#
-# Push the branch the run left behind, and open or update its pull request.
-#
-# This is the only thing that pushes, and it is a shell script rather than a Claude step
-# for two reasons.
-#
-# The first is that it is mechanical: verify, push, create or comment. The run that did
-# the work already knows everything a pull request body needs, so there is nothing left
-# here for a model to work out — it writes the body to a file in $REPORT_DIR and this
-# posts it.
-#
-# The second is the point. Everything after the run starts is the run's own account of
-# itself, and the two things that must be true before a change reaches a human are exactly
-# the two a self-report cannot establish: that the gates pass, and that somebody other than
-# the author looked at it. So this measures the gates itself rather than believing the
-# summary, and refuses to push at all unless the run left a review report — which only
-# .github/claude/review-changes.md, running as its own subagent, produces. A run that skips
-# the review does not get a shortcut; it gets nothing published.
-#
-# Nothing to publish is the ordinary outcome, not a failure: a run that answered a
-# question, asked one, or found the work already done leaves the branch exactly as it
-# found it, and this exits green having said so.
-
-set -euo pipefail
-
-readonly report_dir="${CLAUDE_REPORT_DIR:?}"
-readonly review_report="$report_dir/review.md"
-readonly body_file="$report_dir/pr-body.md"
-
-# Whether a pull request now carries this run's work. The workflow reads it to decide
-# whether to leave the "this run changed nothing" comment that bounds the retries.
-published() {
- printf 'published=%s\n' "$1" >>"${GITHUB_OUTPUT:-/dev/stdout}"
-}
-
-branch=$(git branch --show-current)
-
-if [[ $branch != claude/* ]]; then
- echo "::notice::Not on a claude/* branch; nothing to publish."
- published false
- exit 0
-fi
-
-# Measured against the branch's own published tip rather than against the commit the job
-# checked out. A respond run starts with `gh pr checkout`, which moves HEAD to commits that
-# are already pushed and already reviewed: comparing against where the job started would
-# call every one of those runs a build.
-published_tip="origin/$branch"
-if ! git rev-parse --verify --quiet "$published_tip" >/dev/null; then
- published_tip=origin/main
-fi
-if [[ $(git rev-parse HEAD) == $(git rev-parse "$published_tip") ]]; then
- echo "::notice::$branch is unchanged from $published_tip; nothing to publish."
- published false
- exit 0
-fi
-
-# The attestation. Not a formality: the review is a separate context precisely so that its
-# verdict is not the author's, and a report that does not exist is a review that did not
-# happen. Refusing here is what stops "I reviewed it" from being a claim the run can simply
-# make about itself.
-if [[ ! -s $review_report ]]; then
- echo "::error::$branch has commits but no review report at $review_report." \
- "Section 4 of .github/claude/run.md is not optional: a change is published only" \
- "once a review subagent has read it in a fresh context. Pushing nothing."
- exit 1
-fi
-if [[ ! -s $body_file ]]; then
- echo "::error::$branch has commits but no pull request body at $body_file." \
- "Section 4 of .github/claude/run.md writes it. Pushing nothing."
- exit 1
-fi
-
-# The Claude GitHub App's token, as the Claude step's github_token output. Not the workflow
-# token: a push made with GITHUB_TOKEN does not trigger workflows, so the pull request this
-# opens would sit with no checks on it, forever, and the automation would never see CI go
-# red on its own branch. Unset means the app authentication the whole workflow assumes did
-# not happen, which is worth failing on rather than working around — but only once there is
-# something to push, so that a run with nothing to publish stays green regardless.
-readonly token="${GH_TOKEN:?}"
-# git prints the remote it failed to reach, and from here that remote carries the token.
-echo "::add-mask::$token"
-
-# Nothing on this branch has been checked since the last commit landed, and the run's own
-# account of the gates is the run's, not ours.
-echo "::group::make check"
-make check
-echo "::endgroup::"
-echo "::group::uv run pytest"
-uv run pytest
-echo "::endgroup::"
-
-# `grep -v` exits 1 when it filters everything out, which under pipefail would end the
-# script — and a plan branch, whose only file is under docs/plans/, hits that every time.
-added=$(git diff --numstat "origin/main...HEAD" \
- | { grep -vE $'\t(uv\\.lock|poetry\\.lock|devdata/|front-end/|docs/plans/)' || true; } \
- | awk '{ total += $1 } END { print total + 0 }')
-
-verified=$(cat <<EOF
----
-\`make check\` and \`uv run pytest\` both pass, measured by the publish step after the
-review, on $(git rev-parse --short HEAD). Added lines outside lockfiles, \`devdata/\`,
-\`front-end/\` and \`docs/plans/\`: $added.
-EOF
-)
-
-# Reported rather than acted on: the change has already been reviewed, and cutting it back
-# now would mean republishing work nobody has looked at.
-if ((added > 500)); then
- verified+=$'\n\n**This is over the 500-line budget.** Reported rather than trimmed here,'
- verified+=$' because trimming it now would republish unreviewed work.'
-fi
-
-body=$(cat "$body_file")$'\n\n'"$verified"
-
-# actions/checkout leaves behind an http.extraheader carrying the workflow token, and it
-# takes precedence over every other credential git could find, so the app token has to
-# replace it rather than sit alongside it.
-# --unset-all exits 5 when the key is not there, which is the state it is trying to reach.
-git config --local --unset-all 'http.https://github.com/.extraheader' || true
-git remote set-url origin \
- "https://x-access-token:${token}@github.com/${GITHUB_REPOSITORY:?}.git"
-
-# A rebase cannot fast-forward. The run says so on the first line of the review report,
-# which is the only place it is allowed to speak to this step.
-if head -1 "$review_report" | grep -qx 'rebased: true'; then
- git push --force-with-lease -u origin "$branch"
-else
- git push -u origin "$branch"
-fi
-
-existing=$(gh pr list --head "$branch" --state open --json number --jq '.[0].number // empty')
-
-if [[ -z $existing ]]; then
- # The commit subject already names the work: an implementing run commits the plan
- # section's title, a planning run commits "Plan issue #<N>: <title>".
- gh pr create --title "$(git log -1 --format=%s)" --body "$body"
-else
- # A reviewer coming back wants to see what moved since they left, not a description
- # that quietly changed under them, so the original body stands and the update is a
- # comment.
- gh pr comment "$existing" --body "$body
-
-<!-- claude-run: update -->"
-fi
-
-published true
diff --git a/.github/scripts/report-no-change.sh b/.github/scripts/report-no-change.sh
deleted file mode 100755
index 92dbea0..0000000
--- a/.github/scripts/report-no-change.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env bash
-#
-# Say on the pull request that this run changed nothing, and why it was woken.
-#
-# The comment is load-bearing rather than courtesy. The selector's queues are pure
-# functions of repository state, so a run that ends without committing leaves exactly the
-# state that selected it: the same red checks, the same unanswered review. Without a record
-# that the automation has already had its turn at this commit, the item would be selected
-# again on the next trigger and on every scheduled run after that, for as long as the
-# reason stood.
-#
-# So this is what bounds the retries: select-claude-work.sh stops counting failing checks
-# and conflicts once the automation has spoken about the current commit, and counts
-# feedback only from after that. A new commit, or a human replying, is what starts the pull
-# request moving again.
-#
-# A run that answered a question or asked one has already spoken, with a comment carrying
-# the same marker, so this stays quiet rather than saying it twice. The marker prefix has
-# to stay in step with the one select-claude-work.sh looks for.
-
-set -euo pipefail
-
-pull_request="${PULL_REQUEST:?}"
-reason="${REASON:?}"
-readonly marker='<!-- claude-run:'
-
-# Piped through jq rather than gh's own --jq, which takes the expression alone and
-# rejects the --arg the marker needs.
-already_spoken=$(gh pr view "$pull_request" --json commits,comments \
- | jq -r --arg marker "$marker" '
- (.commits | last | .committedDate) as $commit
- | [.comments[] | select(.body | contains($marker)) | .createdAt]
- | max
- | . != null and . > $commit')
-
-if [[ $already_spoken == true ]]; then
- echo "::notice::The run already commented on #$pull_request; not saying it twice."
- exit 0
-fi
-
-gh pr comment "$pull_request" --body "This run looked at the pull request and left the
-branch as it found it.
-
-It was woken because: $reason.
-
-It will not try again by itself at this commit — pushing a commit here, or replying, is
-what wakes it.
-
-$marker no change -->"
diff --git a/.github/scripts/select-claude-work.sh b/.github/scripts/select-claude-work.sh
index c050179..72056a0 100755
--- a/.github/scripts/select-claude-work.sh
+++ b/.github/scripts/select-claude-work.sh
@@ -46,13 +46,20 @@ readonly plan_dir="docs/plans"
readonly max_items="${CLAUDE_MAX_ITEMS:-3}"
readonly only_issue="${CLAUDE_ONLY_ISSUE:-}"
-# Every comment the automation posts on a pull request carries this, so recognising its
-# own voice is a string test on text it wrote rather than a guess about authorship. That
-# matters: GraphQL hands a Bot actor a login without the "[bot]" suffix, so the obvious
-# test against gh's projection silently matches nothing and the automation reads its own
-# comments as a maintainer's. Kept in step with .github/scripts/report-no-change.sh and
-# .github/claude/run.md, which write it.
+# Every comment the automation posts on a pull request ends with one of these, so
+# recognising its own voice is a string test on text it wrote rather than a guess about
+# authorship. That matters: gh's projection of a comment author carries a login and nothing
+# else — no bot flag, and a Bot actor's login arrives without the "[bot]" suffix — so the
+# obvious authorship test silently matches nothing and the automation reads its own
+# comments as a maintainer's.
+#
+# The prefix says the comment is the automation's, and never counts as feedback. The
+# narrower marker says something stronger: this run had its turn at the current commit and
+# changed nothing. Only a run that commits nothing writes that one, because a run that
+# pushes has not yet had a turn at what it just pushed — CI has not run on it. Kept in step
+# with section 5 of .github/claude/run.md, which writes both.
readonly marker='<!-- claude-run:'
+readonly turn_taken='<!-- claude-run: done -->'
open_issues=$(gh issue list --state open --limit 200 --json number,title,labels)
open_pull_requests=$(gh pr list --state open --limit 200 \
@@ -67,22 +74,20 @@ open_pull_requests=$(gh pr list --state open --limit 200 \
# carrying inline comments and no body still arrives as a review with a timestamp, so
# inline-only feedback is caught too.
#
-# The last thing the automation said about the current commit bounds the retries. A run
-# that ends without committing changes nothing the queues are derived from, so failing
-# checks it could not fix, or a question it could not answer without guessing, would
-# select this pull request again on every trigger for as long as they stood. Once it has
-# spoken about a commit, the mechanical reasons stop counting for that commit, and only
-# something said afterwards counts as feedback. A new commit, or a human replying, is what
-# starts it moving again.
+# A run that ends without committing changes nothing the queues are derived from, so
+# failing checks it could not fix, or a question it could not answer without guessing,
+# would select this pull request again on every trigger for as long as they stood. Saying
+# so is what bounds the retries: once a run has had its turn at a commit, the mechanical
+# reasons stop counting for that commit, and only something said afterwards counts as
+# feedback. A new commit, or a human replying, is what starts it moving again.
readonly wake_filter='
def ours: (.body // "") | contains($marker);
-def maintainer:
- (["OWNER", "MEMBER", "COLLABORATOR"] | index(.authorAssociation) != null)
- and (.author.is_bot != true);
+def had_a_turn: (.body // "") | contains($turn_taken);
+def maintainer: .authorAssociation | IN("OWNER", "MEMBER", "COLLABORATOR");
def failing: [.statusCheckRollup[] | select(.conclusion == "FAILURE") | .name];
(.commits | last | .committedDate) as $commit
-| ([.comments[] | select(ours) | .createdAt] | max) as $spoken
+| ([.comments[] | select(had_a_turn) | .createdAt] | max) as $spoken
| ([ (.comments[] | select(ours | not) | select(maintainer) | .createdAt),
(.reviews[] | select(maintainer) | .submittedAt) ] | max) as $feedback
| if $feedback != null and $feedback > $commit
@@ -96,7 +101,7 @@ def failing: [.statusCheckRollup[] | select(.conclusion == "FAILURE") | .name];
reason_to_wake() {
gh pr view "$1" --json mergeable,statusCheckRollup,commits,comments,reviews \
- | jq -r --arg marker "$marker" "$wake_filter"
+ | jq -r --arg marker "$marker" --arg turn_taken "$turn_taken" "$wake_filter"
}
pull_request_for() {
diff --git a/.github/workflows/claude-issues.yml b/.github/workflows/claude-issues.yml
index 725f7dc..469ba15 100644
--- a/.github/workflows/claude-issues.yml
+++ b/.github/workflows/claude-issues.yml
@@ -5,18 +5,22 @@ name: Claude issue automation
# A run picks up one issue and decides what it needs — write a plan, build the next part,
# answer a review, fix red checks, rebase, answer a question, ask one, or file what it
# found and should not fix here — then does it, has it reviewed in a fresh context, and
-# leaves a branch for the publish step. Changing no code is a normal outcome, and one a run
-# says out loud rather than ending in silence.
+# pushes it. Changing no code is a normal outcome, and one a run says out loud rather than
+# ending in silence.
#
-# There is one Claude step. It spawns the review as a subagent, which starts cold and
-# commits its own findings, so the fresh-context review costs a briefing rather than a
-# second action invocation. What is left in shell is only what a run cannot credibly say
-# about itself: which issues are worth spending a run on at all
-# (.github/scripts/select-claude-work.sh, before any model runs), and whether the gates
-# actually pass and a review actually happened (.github/scripts/publish-branch.sh, which is
-# the only thing that pushes). Everything between those two is the run's to decide, and
-# .github/claude/run.md is what it is told. See docs/plans/README.md for the plan format
-# the queues are derived from.
+# There is one Claude step, and it is an ordinary Claude Code session with GitHub as its
+# interface rather than a person. It reads the issue, does the work, spawns the review as a
+# subagent that starts cold and commits its own findings, pushes, and opens or comments on
+# the pull request. .github/claude/run.md is the whole of what it is told.
+#
+# The only shell left is what a run cannot do for itself. Choosing which issues are worth
+# spending a run on has to happen before any model starts, so it is
+# .github/scripts/select-claude-work.sh. Saying how the job ended has to happen when the
+# model may not have run at all, so it is .github/scripts/classify-claude-run.sh. Nothing
+# in between: a step that re-ran the gates or re-read the diff would be checking a session
+# that is already reporting on itself, and CI on the pushed branch is what actually catches
+# a change the run got wrong. See docs/plans/README.md for the plan format the queues are
+# derived from.
#
# Only one claude/issue-<N>-* pull request is ever open per issue. It no longer blocks the
# issue, though: while it is open the only thing the automation may do to that issue is
@@ -91,9 +95,11 @@ jobs:
# access must never be able to start a run on a public repository, so a comment or
# review only counts from an OWNER, MEMBER or COLLABORATOR, and never from a bot —
# which is also what stops the automation waking itself with its own comments. The
- # login test belongs on all three: a run that answers a question posts as the Claude
- # app rather than with GITHUB_TOKEN, so unlike a GITHUB_TOKEN comment it does raise an
- # event, and author_association is not a reliable way to recognise an app.
+ # login test belongs on all three, and carries that second job alone: every comment a
+ # run posts is posted as the Claude app, which raises an event the way a person's does,
+ # and author_association is not a reliable way to recognise an app. Webhook payloads
+ # give an app the "[bot]" suffix even though the GraphQL API does not, which is why the
+ # test can live here and not in the selector.
#
# A pull request from a fork is out of scope for the same reason, and for a practical
# one: GitHub gives a fork's pull_request event no secrets and a read-only token
@@ -148,7 +154,8 @@ jobs:
needs: select
if: needs.select.outputs.has_items == 'true'
runs-on: ubuntu-latest
- # One Claude run, the review subagent inside it, and one run of a 67-second test suite.
+ # One Claude run and the review subagent inside it, both iterating on a 67-second test
+ # suite.
timeout-minutes: 120
strategy:
fail-fast: false
@@ -159,7 +166,7 @@ jobs:
cancel-in-progress: false
name: "#${{ matrix.item.issue }} ${{ matrix.item.kind }}"
- # Claude has to get the same gates green before its branch is published as CI runs
+ # Claude has to get the same gates green before it pushes as CI runs on the branch
# afterwards, so it needs the same database and toolchain as ci.yml's test job. The
# planning run gets it too: a plan is only as good as the facts behind it, and this
# lets it count lint violations and see what actually breaks rather than estimating.
@@ -179,26 +186,20 @@ jobs:
env:
ISSUE_NUMBER: ${{ matrix.item.issue }}
- # The publish step runs the gates itself rather than believing the run's account of
- # them, so it needs the same environment the run had.
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test_mwmbl
DJANGO_SETTINGS_MODULE: mwmbl.settings_test
steps:
- # These live outside the checkout. The run holds an unrestricted Bash tool and is
- # asked to commit; a report file sitting untracked in the working tree is one
- # `git add -A` away from being part of the pull request.
+ # The log lives outside the checkout. The run holds an unrestricted Bash tool and is
+ # asked to commit; a file sitting untracked in the working tree is one `git add -A`
+ # away from being part of the pull request.
#
- # They are set here rather than in the job's `env` above because the `runner` context
+ # It is set here rather than in the job's `env` above because the `runner` context
# does not exist at job level: a `${{ runner.temp }}` there is not an empty string but
# a workflow that fails to validate, which is what broke every run from 2f0de72 on.
- - name: Point the run log and reports outside the checkout
- run: |
- echo "CLAUDE_RUN_LOG=$RUNNER_TEMP/claude-runs.jsonl" >>"$GITHUB_ENV"
- echo "CLAUDE_REPORT_DIR=$RUNNER_TEMP/claude-reports" >>"$GITHUB_ENV"
- mkdir -p "$RUNNER_TEMP/claude-reports"
- # Full history: the run and the publish step both diff the branch against main, and
- # the publish step compares HEAD against the branch's own remote tip.
+ - name: Point the run log outside the checkout
+ run: echo "CLAUDE_RUN_LOG=$RUNNER_TEMP/claude-runs.jsonl" >>"$GITHUB_ENV"
+ # Full history: the run diffs the branch against main and pushes it.
#
# The ref is pinned because `pull_request` hands github.ref as refs/pull/<n>/merge:
# a ref GitHub stops guaranteeing once the pull request closes, and a snapshot of a
@@ -215,10 +216,12 @@ jobs:
# No github_token input: the action then authenticates as the Claude GitHub App,
# which sets GH_TOKEN and the git credentials for Claude and, unlike the workflow
- # token, lets CI run on the pull requests this pushes.
+ # token, lets CI run on the pull requests it pushes. That is the whole reason the run
+ # can push for itself — a branch pushed with GITHUB_TOKEN would sit with no checks on
+ # it forever, and CI going red is how the selector learns a change was wrong.
#
# continue-on-error, so that the last step can classify how the run ended rather than
- # the job dying here with no explanation. The publish step guards itself.
+ # the job dying here with no explanation.
- name: Work on the issue
id: run
uses: anthropics/claude-code-action@v1
@@ -242,7 +245,6 @@ jobs:
PULL_REQUEST: ${{ matrix.item.pr }}
REASON: ${{ matrix.item.reason }}
REPOSITORY: ${{ github.repository }}
- REPORT_DIR: ${{ runner.temp }}/claude-reports
# Agent is the subagent tool section 4 of run.md needs; Task is what older
# releases of the CLI called it, and a name that matches nothing is inert.
claude_args: |
@@ -256,37 +258,6 @@ jobs:
EXECUTION_FILE: ${{ steps.run.outputs.execution_file }}
run: .github/scripts/record-claude-run.sh run
- # The only step that pushes, and the only check on the run that is not the run's own
- # account of itself: it re-runs both gates and refuses a branch with no review report.
- # Skipped when the run itself failed — a run that died part-way through leaves a tree
- # nobody has finished with, and republishing that is what this exists to prevent.
- - name: Publish the branch
- id: publish
- continue-on-error: true
- if: steps.run.outcome == 'success'
- env:
- # The Claude GitHub App's token, not the workflow token: a push made with
- # GITHUB_TOKEN does not trigger workflows, so the pull request would open with no
- # checks on it and CI could never go red on a branch the automation owns.
- GH_TOKEN: ${{ steps.run.outputs.github_token }}
- run: .github/scripts/publish-branch.sh
-
- # A run that changes nothing leaves the repository exactly as the selector found it,
- # so the same red checks or the same unanswered review would select this pull request
- # again on the next trigger, and on every scheduled run after that. This comment is
- # the record that stops it; select-claude-work.sh reads it as "this commit has
- # already had its turn".
- - name: Say on the pull request that nothing changed
- if: >-
- matrix.item.kind == 'respond'
- && steps.run.outcome == 'success'
- && steps.publish.outputs.published == 'false'
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- PULL_REQUEST: ${{ matrix.item.pr }}
- REASON: ${{ matrix.item.reason }}
- run: .github/scripts/report-no-change.sh
-
- name: Upload the run log
if: always()
uses: actions/upload-artifact@v4
@@ -299,5 +270,4 @@ jobs:
if: always()
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- PUBLISH_OUTCOME: ${{ steps.publish.outcome }}
run: .github/scripts/classify-claude-run.sh
diff --git a/test/test_claude_automation_workflow.py b/test/test_claude_automation_workflow.py
index 4f6380f..9c88df4 100644
--- a/test/test_claude_automation_workflow.py
+++ b/test/test_claude_automation_workflow.py
@@ -1,9 +1,16 @@
-"""The issue automation is a pipeline wired together in YAML, and a run costs an hour.
-
-Nothing else checks that wiring: a renamed instruction file, a review step dropped in a
-merge or a guard left off a pushing step all look fine until a run burns its budget or
-opens a pull request nobody reviewed. These tests are cheap and they run in CI, which is
-where that feedback belongs.
+"""The issue automation is one Claude session wired into GitHub, and a run costs an hour.
+
+Almost all of it is prompt: the run decides what the issue needs, has the change reviewed
+by a subagent, pushes, and opens or comments on the pull request itself. Only two pieces of
+shell survive, on either side of it — the selector that decides an issue is worth a run at
+all, and the classifier that says how the job ended.
+
+That leaves very little that can be checked mechanically, and makes the little there is
+worth checking: a renamed instruction file, a marker that drifts out of step with the
+selector, or a guard dropped from the trigger list all look fine until a run burns its
+budget or wakes itself in a loop. These tests are cheap and they run in CI, which is where
+that feedback belongs. What the run does with its instructions is not testable here, and
+deliberately not faked: this file checks the wiring, not the judgement.
"""
import os
@@ -16,9 +23,14 @@ import yaml
REPOSITORY_ROOT = Path(__file__).resolve().parent.parent
WORKFLOW_PATH = REPOSITORY_ROOT / ".github/workflows/claude-issues.yml"
SELECTOR_PATH = REPOSITORY_ROOT / ".github/scripts/select-claude-work.sh"
-REPORTER_PATH = REPOSITORY_ROOT / ".github/scripts/report-no-change.sh"
+RUN_INSTRUCTIONS_PATH = REPOSITORY_ROOT / ".github/claude/run.md"
CLAUDE_ACTION = "anthropics/claude-code-action@v1"
+# The marker that says a run had its turn at the current commit and changed nothing, and
+# the prefix that says a comment is the automation's whatever else it means.
+TURN_TAKEN_MARKER = "<!-- claude-run: done -->"
+MARKER_PREFIX = "<!-- claude-run:"
+
# yaml.safe_load reads the `on:` key as the boolean True, per YAML 1.1.
TRIGGERS_KEY = True
@@ -38,9 +50,24 @@ def claude_steps(work_steps: list[dict]) -> list[dict]:
return [step for step in work_steps if step.get("uses") == CLAUDE_ACTION]
-def test_the_pipeline_is_build_then_review_then_finalise(claude_steps: list[dict]) -> None:
- """Reviewing after the push, or not at all, is the failure this ordering prevents."""
- assert [step["id"] for step in claude_steps] == ["coordinate", "review", "finalise"]
[email protected](scope="module")
+def run_instructions() -> str:
+ return RUN_INSTRUCTIONS_PATH.read_text()
+
+
+def test_the_work_is_one_claude_session(claude_steps: list[dict]) -> None:
+ """A second step would be a second cold context that has to be told what the first one
+ did, and the whole point of this shape is that there is nothing to hand over."""
+ assert [step["id"] for step in claude_steps] == ["run"]
+
+
+def test_the_run_can_spawn_the_review_subagent(claude_steps: list[dict]) -> None:
+ """The review is the only thing standing between a change and a human, and it is a
+ subagent now. A tool name that matches nothing is inert: the run would carry on and
+ push, having reviewed its own work."""
+ allowed = claude_steps[0]["with"]["claude_args"]
+ assert re.search(r"--allowedTools\s+\"[^\"]*\bAgent\b", allowed)
+ assert ".github/claude/review-changes.md" in RUN_INSTRUCTIONS_PATH.read_text()
def test_every_instruction_file_a_prompt_names_exists(claude_steps: list[dict]) -> None:
@@ -62,42 +89,23 @@ def test_instruction_files_only_cross_reference_files_that_exist() -> None:
assert (REPOSITORY_ROOT / path).is_file(), f"{instruction_file.name} -> {path}"
-def test_review_and_finalise_run_only_on_a_successful_build(claude_steps: list[dict]) -> None:
- """Without the guard, a build that hit its turn limit part-way through a change still
- gets pushed and opened for review."""
- for step in claude_steps[1:]:
- guard = step["if"]
- assert "steps.built.outputs.built == 'true'" in guard, step["id"]
- assert "steps.coordinate.outcome == 'success'" in guard, step["id"]
-
-
-def test_nothing_is_published_over_a_review_that_did_not_finish(claude_steps: list[dict]) -> None:
- """The review step is continue-on-error, so one that ran out of turns half-way through
- a fix ends red having left the branch mid-change. Pushing that is exactly the pull
- request nobody reviewed."""
- assert "steps.review.outcome == 'success'" in claude_steps[2]["if"]
-
-
-def test_a_build_is_measured_against_the_branch_not_against_the_checkout(
- work_steps: list[dict],
-) -> None:
- """A respond run starts with `gh pr checkout`, which moves HEAD to commits that are
- already pushed: measured against where the job started, every one of those runs would
- count as a build and be reviewed and pushed again."""
- built = next(step for step in work_steps if step.get("id") == "built")
- assert "origin/$branch" in built["run"]
- assert "steps.start" not in built["run"]
+def test_the_run_is_told_to_have_the_change_reviewed_before_it_pushes(run_instructions: str) -> None:
+ """Nothing enforces this any more, so the ordering has to be in the instructions and
+ has to stay there: a review after the push is a review a human has already seen past."""
+ review_section = run_instructions.index("## 4. Have the change reviewed")
+ push_section = run_instructions.index("## 5. Push it")
+ assert review_section < push_section
-def test_the_finalise_step_is_told_what_the_earlier_steps_reported(claude_steps: list[dict]) -> None:
- """It writes the pull request body from them, and each step is a fresh session that can
- see nothing of the last one."""
- prompt = claude_steps[2]["with"]["prompt"]
- assert "BUILD_SUMMARY" in prompt
- assert "REVIEW_SUMMARY" in prompt
- instructions = (REPOSITORY_ROOT / ".github/claude/finalise-pull-request.md").read_text()
- assert "BUILD_SUMMARY" in instructions
- assert "REVIEW_SUMMARY" in instructions
+def test_the_review_subagent_is_given_nothing_but_the_issue_number(run_instructions: str) -> None:
+ """Everything else the run could add is the author reviewing their own work through a
+ second context. The prompt it is told to send is fixed text for that reason."""
+ spawn_prompt = run_instructions.split("## 4. Have the change reviewed")[1].split("```")[1]
+ assert spawn_prompt.strip().splitlines() == [
+ "Follow the instructions in .github/claude/review-changes.md exactly.",
+ "",
+ "ISSUE_NUMBER: $N",
+ ]
def test_every_claude_step_is_recorded_so_a_failure_can_be_classified(
@@ -129,6 +137,27 @@ def test_the_classifier_has_the_last_word(work_steps: list[dict]) -> None:
assert last["if"] == "always()"
+def test_no_step_between_the_run_and_the_classifier_judges_the_change(work_steps: list[dict]) -> None:
+ """A step that re-ran the gates or re-read the diff would be checking a session that is
+ already reporting on itself, and the branch is pushed by then either way. CI on the
+ pushed branch is what catches a change the run got wrong."""
+ run_index = next(index for index, step in enumerate(work_steps) if step.get("id") == "run")
+ after = work_steps[run_index + 1 :]
+ scripts = {step["run"].split()[0] for step in after if step.get("run", "").startswith(".github/")}
+ assert scripts == {
+ ".github/scripts/record-claude-run.sh",
+ ".github/scripts/classify-claude-run.sh",
+ }
+
+
+def test_the_run_pushes_as_the_app_rather_than_with_the_workflow_token(claude_steps: list[dict]) -> None:
+ """A push made with GITHUB_TOKEN triggers no workflows, so the branch would sit with no
+ checks on it forever — and CI going red is the only thing that tells the selector a
+ change was wrong. Passing no github_token is what makes the action authenticate as the
+ Claude GitHub App instead."""
+ assert "github_token" not in claude_steps[0]["with"]
+
+
def test_triggers_are_events_the_action_accepts(workflow: dict) -> None:
"""claude-code-action fails the job outright on an event outside this set, which is
what `push` did to every merge to main between a5eb9e3 and 141ae84."""
@@ -147,6 +176,12 @@ def test_triggers_are_events_the_action_accepts(workflow: dict) -> None:
assert set(workflow[TRIGGERS_KEY]) <= supported
+def test_ci_going_red_wakes_a_run(workflow: dict) -> None:
+ """It is the only check on a change now that nothing between the run and the classifier
+ reads the diff."""
+ assert workflow[TRIGGERS_KEY]["workflow_run"]["workflows"] == ["CI"]
+
+
def test_a_scheduled_run_still_exists_to_retry_a_spent_usage_window(workflow: dict) -> None:
"""It is the only thing that picks an item back up after the subscription runs out."""
assert workflow[TRIGGERS_KEY]["schedule"]
@@ -162,9 +197,9 @@ def test_comment_and_review_triggers_require_write_access(workflow: dict) -> Non
def test_no_feedback_trigger_can_be_fired_by_a_bot(workflow: dict) -> None:
- """A run answering a question comments as the Claude app, which — unlike a comment made
- with GITHUB_TOKEN — does raise an event. author_association does not reliably identify
- an app, so every clause tests the login too."""
+ """Every comment a run posts is posted as the Claude app, which raises an event the way
+ a person's comment does. author_association does not reliably identify an app, so this
+ is the clause that stops the automation waking itself in a loop."""
guard = workflow["jobs"]["select"]["if"]
for event, field in [
("issue_comment", "comment"),
@@ -175,12 +210,14 @@ def test_no_feedback_trigger_can_be_fired_by_a_bot(workflow: dict) -> None:
assert f"!endsWith(github.event.{field}.user.login, '[bot]')" in clause, event
-def test_nothing_the_runs_write_lands_inside_the_checkout(workflow: dict) -> None:
- """The review and finalise steps run git with an unrestricted Bash tool and are asked
- to commit; an untracked file in the working tree is one `git add -A` from the diff."""
- for name, value in workflow["jobs"]["work"]["env"].items():
- if name.startswith("CLAUDE_") and "/" in value:
- assert value.startswith("${{ runner.temp }}"), name
+def test_nothing_the_run_writes_lands_inside_the_checkout(work_steps: list[dict]) -> None:
+ """The run holds an unrestricted Bash tool and is asked to commit; an untracked file in
+ the working tree is one `git add -A` from the diff."""
+ exported = [step for step in work_steps if "GITHUB_ENV" in step.get("run", "")]
+ assert exported
+ for step in exported:
+ for name, value in re.findall(r'echo "(CLAUDE_\w+)=(\S+)"', step["run"]):
+ assert value.startswith("$RUNNER_TEMP/"), name
def test_no_checkout_lands_on_the_pull_request_merge_ref(workflow: dict) -> None:
@@ -207,33 +244,42 @@ def test_only_pull_requests_from_this_repository_start_a_run(workflow: dict) ->
assert "head.repo.full_name == github.repository" in clause, event
-def test_a_run_that_changes_nothing_says_so_on_the_pull_request(work_steps: list[dict]) -> None:
+def test_the_selector_reads_the_markers_the_run_writes() -> None:
+ """Two files, two strings: if they drift apart the retries stop being bounded and
+ nothing says so."""
+ selector = SELECTOR_PATH.read_text()
+ instructions = RUN_INSTRUCTIONS_PATH.read_text()
+ for marker in (TURN_TAKEN_MARKER, MARKER_PREFIX):
+ assert marker in selector, marker
+ assert marker in instructions, marker
+
+
+def test_a_run_that_changes_nothing_says_so_on_the_pull_request(run_instructions: str) -> None:
"""It is the only record such a run leaves. Without it the same red checks select the
same pull request on every trigger and every scheduled run, for as long as they are
red."""
- reporter = next(
- step for step in work_steps if step.get("run", "").startswith(".github/scripts/report-no-change.sh")
- )
- guard = reporter["if"]
- assert "matrix.item.kind == 'respond'" in guard
- assert "steps.built.outputs.built != 'true'" in guard
+ committed_nothing = run_instructions.split("**If you committed nothing**")[1].split("**If you committed**")[0]
+ assert "comment on the pull request" in committed_nothing
-def test_the_selector_looks_for_the_marker_the_reporter_writes() -> None:
- """Two files, one string: if they drift apart the retries stop being bounded and
- nothing says so."""
- marker = "<!-- claude-run: no change -->"
- assert marker in REPORTER_PATH.read_text()
- assert marker in SELECTOR_PATH.read_text()
+def test_a_push_is_not_recorded_as_a_turn_taken(run_instructions: str) -> None:
+ """The commit a run just pushed has not had its turn: CI has not run on it. Marking it
+ as spoken for silences the failing checks of exactly the commits the automation made,
+ so the comment that goes with a push carries the other marker."""
+ assert "<!-- claude-run: update -->" in run_instructions
+ assert TURN_TAKEN_MARKER != "<!-- claude-run: update -->"
+ assert "<!-- claude-run: update -->" not in SELECTOR_PATH.read_text()
-def test_feedback_is_read_from_an_api_that_identifies_bots() -> None:
- """gh's GraphQL projection gives a Bot author a login without the "[bot]" suffix, so a
- suffix test there matches nothing and the automation reads its own comments as a
- maintainer's. REST says user.type."""
+def test_the_selector_recognises_its_own_voice_by_marker_not_by_author() -> None:
+ """gh's projection of a comment author carries a login and nothing else, and a Bot
+ actor's login arrives there without the "[bot]" suffix, so an authorship test in the
+ selector silently matches nothing and the automation reads its own comments as a
+ maintainer's."""
selector = SELECTOR_PATH.read_text()
- assert '.user.type != "Bot"' in selector
+ assert "def ours:" in selector
assert 'endswith("[bot]")' not in selector
+ assert "is_bot" not in selector
def test_forks_are_not_the_automations_to_work_on() -> None: