Skip to content

ci: add pull request status labels, a backlog skill and a typescript release script - #1919

Merged
joshunrau merged 5 commits into
DouglasNeuroInformatics:mainfrom
joshunrau:new-skill
Nov 13, 2026
Merged

joshunrau merged 5 commits into
DouglasNeuroInformatics:mainfrom
joshunrau:new-skill

Conversation

@joshunrau

Copy link
Copy Markdown
Collaborator

Every open pull request now carries one Status: label saying whose turn it is, a new user-invoked skill works the issue backlog in small batches that read those labels, and the Release workflow plans its run from a TypeScript script like the other workflow scripts.

Changes

  • A new PR Status workflow gives each open pull request exactly one of Status: Draft, Needs Rebase, CI Failing, Waiting on Author, Waiting on Review or Ready to Merge. A draft outranks a conflict, a conflict outranks a failed check, and a failed check outranks the review state. It runs when CI, Commitlint or PR Body completes, every 15 minutes, and on dispatch; it gates nothing. On merge it starts labelling every open pull request.
  • A pull request goes back to Waiting on Review when its author pushes after the feedback or requests the review again. The author's own replies, bot reviews, and approvals or change requests from accounts without write access do not count, and an approval counts only for the head commit.
  • A check is read from its newest run, so a failure that later passed on a re-run, or a PR Body run that passed after the body was edited, no longer reads as CI failing.
  • A new working-the-backlog skill, which only a user can invoke, turns one batch of backlog issues into pull requests. It first clears the operator's pull requests labelled CI Failing, Needs Rebase or Waiting on Author, then picks Difficulty: Low issues and Difficulty: Medium bugs that share no file with any open pull request, waits for the operator's go-ahead, and stops at five open pull requests.
  • The Release workflow's configure job plans the run with node scripts/plan-release.ts instead of actions/github-script. The plan, its five outputs and the notice for a superseded major are unchanged.
  • Root tsc type-checks every file under .github/scripts/, so a new script there needs no tsconfig.json edit, and knip no longer treats .github/scripts/*.cjs as entry files or ignores a github-script dependency.

Decisions

  • The newest run of a check is found by the check's name alone, not by name and workflow. That is how the main ruleset identifies its required checks. Two workflows with a job of the same name would be read as one check.
  • The skill reads the Status: label instead of working out conflicts, failed checks and open feedback itself, so the two cannot disagree. The cost is that a plain conversation comment, which the labels ignore, does not send the skill back to a pull request.
  • The skill rebases a conflicted branch and force-pushes, and after a reply that pushes nothing it requests the review again, because the label moves on a push or a new request and never on a reply.
  • scripts/plan-release.ts takes the version by importing the root package.json, which types it at compile time, where the old script read and parsed the file at run time. The reading of the ref, the tags and the version now sits in that entrypoint, outside the coverage gate like scripts/check-pr-body.ts, so the two tests that asserted those reads are gone.

Risks

  • The new plan step cannot run before merge: the first push to main afterwards is its first real run. If it fails, configure fails and nothing is built or published until it is fixed.
  • A fork author without write access may not be allowed to request a review again. Such a pull request, answered by a reply alone, keeps Waiting on Author; the skill treats one where its reply is the last word as cleared.
  • The test for whether the reviewer has seen the latest push still reads reviews from any person, since GitHub offers no write-access filter there. A comment review from an outside account on the head can therefore hold a pull request at Waiting on Author after its author has pushed.

Notes

For this repository's current version and tags, node scripts/plan-release.ts wrote the same five outputs as the old release.cjs run through a stand-in for actions/github-script; on a ref that is not a release ref it exited 1 and wrote nothing. The status query, run read-only against this repository, was accepted by GitHub and planned one label for each of the 13 open pull requests.

Adversarial review

Reviewed at commit bc341ed. pnpm check: green.

Findings

  1. .github/scripts/pr-status.ts:71 — an approval or a change request from an account without write access is counted, so a passer-by's review can label a pull request Status: Ready to Merge or hold it at Status: Waiting on Author — query latestOpinionatedReviews with writersOnly: true
  2. .github/scripts/pr-status.ts:167 — every check context on the head is read, including runs a later run of the same check replaced, so a failure that passed on a re-run keeps the pull request at Status: CI Failing — keep only the newest context of each check before classifying

Fixed

    1. The query asks for opinionated reviews with writersOnly: true.
    1. Each check is read from the newest of its runs, by name.

Attestation

I, Claude Fable 5.2, attest that the review block above reports the adversarial review as it ran on the commit named, with every finding it returned.

🤖 Generated with Claude Code

joshunrau and others added 5 commits November 13, 2026 11:31
A workflow gives every open pull request exactly one Status: label, recomputed from what
GitHub reports: draft, needs rebase, CI failing, waiting on author, waiting on review or
ready to merge. Only reviews from accounts with write access approve or block, and a check
is read from its newest run, so a failure that passed on a re-run does not read as CI failing.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
release.cjs becomes .github/scripts/release.ts, and the configure job runs
scripts/plan-release.ts with node, the way pr-body.yaml and pr-status.yaml run their scripts.
The plan and its outputs are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@joshunrau
joshunrau merged commit 7f4a33d into DouglasNeuroInformatics:main Nov 13, 2026
3 of 5 checks passed
@joshunrau
joshunrau deleted the new-skill branch November 19, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant