Skip to content

ci: check the PR body only on pull requests an agent authored - #1902

Merged
joshunrau merged 1 commit into
DouglasNeuroInformatics:mainfrom
joshunrau:ci/pr-body-agent-gate
Nov 10, 2026
Merged

joshunrau merged 1 commit into
DouglasNeuroInformatics:mainfrom
joshunrau:ci/pr-body-agent-gate

Conversation

@joshunrau

Copy link
Copy Markdown
Collaborator

The PR Body workflow now holds only agent-authored pull requests to the opening-pr template; a pull request written by a person alone passes untouched.

Changes

  • The template check runs only when the pull request shows agent authorship: a bot author other than Dependabot, a Co-Authored-By: Claude|GPT|Codex|Copilot trailer in the author's own commits or in the body (with or without an email), the 🤖 Generated with footer, or an ## Adversarial review heading or attestation line in the body. Otherwise the job reports that the template does not apply and closes nothing.
  • Pull requests from release/<major> are exempt, so a merge-back to main is not closed for carrying agent commits that already passed the check.
  • The workflow lists the pull request's commits through the API, keeping only those the pull request's author wrote; it still never checks out the pull request's code.
  • opening-pr now tells agents which signals turn the check on.

Decisions

  • A review block or attestation counts as an agent signal, so a body that carries one is always validated. Gating on the attestation alone was rejected: no agent PR from another author since October carries one, so that gate would exempt every agent that skips the template.
  • Free-text disclosures ("assisted with claude Sonnet 5") are not matched; prose is too varied to parse reliably, and an agent that leaves no marker cannot be told apart from a person under any rule.

Risks

Notes

Replaying the new script over every pull request since July (events rebuilt from the GraphQL history) exempted outside contributors, unmarked human pull requests and Dependabot, and checked every pull request carrying an agent marker. The author filter was run against #1893: it keeps the author's seven trailered commits and drops all of them for any other login.

Adversarial review

Reviewed at commit 9c13e26. pnpm check: green.

Findings

  1. scripts/check-pr-body.ts:77 — any agent trailer on any commit in the range marks the PR agent-authored, so a human-opened release merge-back carrying already-reviewed agent commits is closed — count only the PR author's commits and exempt release/ heads.
  2. .agents/skills/opening-pr/SKILL.md:7 — the skill still says the workflow closes any PR missing the review block — say it checks PRs that show agent authorship and list the signals.

Fixed

    1. The workflow keeps only commits whose author is the PR's author, and EXEMPT_HEAD_REF exempts release/<major> heads.
    1. The description and opening paragraph name the agent-authorship signals.

Attestation

I, Claude Opus 5.5, 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

The PR Body workflow closed every pull request that lacked the adversarial
review block, including ones written by people. It now runs the template
check only when the pull request shows agent authorship: a bot author other
than Dependabot, an agent Co-Authored-By trailer in the author's own commits
or the body, the Claude Code footer, or a review block or attestation of its
own. A pull request from a release branch is exempt, since a merge-back
carries commits that already passed the check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joshunrau
joshunrau merged commit f0dbcf4 into DouglasNeuroInformatics:main Nov 10, 2026
3 checks passed
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