Skip to content

Automate PR review and rebase decisions - #427

Merged
jserv merged 2 commits into
mainfrom
pr-automation
Oct 22, 2026
Merged

jserv merged 2 commits into
mainfrom
pr-automation

Conversation

@jserv

@jserv jserv commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

A triage run spent most of its time on steps a script can settle: deciding who each open pull request waits on, finding the ones ready for a maintainer review, noticing a Refs line that closes nothing, diagnosing a cargo-audit failure that only needs a rebase, and checking that a pull request had not moved before posting a confirmed review. Doing them by hand also went wrong, as when a maintainer's standing request for Closes #141 on #143 went unseen. This moves those decisions into the sweep scripts, so the skills read their output instead of re-deriving it.

pr-sweep.sh gives each pull request a waits_on (author, maintainer, ci, approval) read from the same table as its grade, a review queue of the ones waiting on a maintainer, refs_only for pull requests that close nothing yet name an issue with Refs, and a rebase list whose entries carry a reason: conflicts, or stale_base when ci-failure.sh finds the only failure is an advisory main has since moved past. stale_base holds only when the pull request changes none of the files the audit reads, main's passing run is newer than the failing one, and no other check is failing or pending. issue-sweep.sh names the open pull requests that close each unanswered or waiting issue. The new post-review.sh refuses to post when the head or updatedAt moved, a comment would fall outside the diff, or the payload has no event. CONTRIBUTING.md and the contributor skill now ask pull requests to avoid Refs unless it sits beside a Closes or a full account of the motivation and the implementation.

Verified with ./scripts/test.sh (no failed gates; browser lanes skipped here for want of Chromium), python3 -m unittest tests.test_skill_scripts (56 tests, 15 of them new or extended), shellcheck, scripts/indent.sh --check and scripts/check-skill-refs.py. Against the live repository the sweep queued #422, #396, #411 and #401 for review, flagged #143 as already asked, marked #334 a stale base and #423 not, and post-review.sh refused a payload on a stale head with exit 3.

Left out: pr-sweep.sh and ci-failure.sh each read main's latest check run; sharing that lookup means a helper both scripts source, which is a structural change of its own.


Summary by cubic

Moves triage decisions out of triage runs and into the sweep scripts: who each open pull request waits on, which are ready for a maintainer review, which Refs lines close nothing, and which failing cargo-audit checks a rebase fixes. Confirmed reviews post through a new guard that refuses when the pull request changed.

  • pr-sweep.sh reports a waits_on per PR, a review queue, refs_only entries, and rebase entries carrying a conflicts or stale_base reason. A stale_base diagnosis only counts for the head the sweep read; one for any other head is dropped.
  • post-review.sh exits 3 without posting when the head or updatedAt moved, a comment falls outside the diff, or the payload has no event. It posts the checked text, not the payload file again, so a rewrite after the checks cannot slip in.
  • issue-sweep.sh names the open pull requests that close each unanswered or waiting issue; past ten closing PRs the issue is marked truncated, and the reference narrows the candidates without settling them.
  • CONTRIBUTING.md and the contributor skill now ask PRs to avoid Refs unless it sits beside a Closes or a full account of the motivation and the implementation, and reviews record the updatedAt the guard compares against.

Written for commit 4886d53. Summary will update on new commits.

View guided diff Turn on auto-fix

The PR sweep now says who each pull request waits on, queues the ones
waiting on a maintainer for review, lists Refs lines that close nothing,
and asks for a rebase on its own when a PR merges cleanly but fails only
a cargo-audit advisory main has already fixed. post-review.sh posts a
confirmed review only while the PR is where the reader left it. These
were steps a triage run did by hand and got wrong at least once, as when
a standing request for Closes #141 went unseen. CONTRIBUTING.md now asks
pull requests to avoid Refs unless it sits beside a Closes or a full
account of the motivation and the implementation.
cubic-dev-ai[bot]

This comment was marked as resolved.

A stale-base diagnosis now counts only for the head the sweep read, and
post-review.sh posts the checked text instead of rereading a file that
may have changed since its checks. closing_prs marks an issue truncated
past ten closing PRs, waiting.md says a closing reference narrows the
candidates rather than settling them, and review.md records the
updatedAt that post-review.sh compares against.
@jserv
jserv merged commit 7fff3fc into main Oct 22, 2026
10 checks passed
@jserv
jserv deleted the pr-automation branch October 22, 2026 06:52
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