Skip to content

ci: gate PRs on AI disclosure and flag unreviewed AI attribution - #728

Merged
dev-jodee merged 3 commits into
mainfrom
ci/ai-pr-hygiene
Sep 10, 2026
Merged

ci: gate PRs on AI disclosure and flag unreviewed AI attribution#728
dev-jodee merged 3 commits into
mainfrom
ci/ai-pr-hygiene

Conversation

@dev-jodee

@dev-jodee dev-jodee commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add .github/PULL_REQUEST_TEMPLATE.md with a required two-box AI disclosure, and a pr-hygiene workflow that fails any PR that does not check exactly one box (and, when AI was used, states the tool and extent).
  • Second job scans the PR title, description, commits, and branch name for AI tool attribution and a canary word. External PRs that hit it are labeled ai-unreviewed, commented on once with what to fix, and failed. The label is removed automatically when the attribution is cleaned up.
  • Contributors with write or admin access are exempt from the attribution scan, so maintainer workflows are unaffected.
  • AGENTS.md tells coding agents to include the canary word in any PR text, commit message, or review reply they draft on a contributor's behalf, which is what makes an unread submission detectable.
  • CONTRIBUTING.md: disclosure is now mandatory rather than "helpful", the PR section points at the template and notes CI enforcement, and the AI use section documents the attribution rule and the "explain every line without an LLM" expectation.

Why: this repo takes a high volume of external contributions and a growing share arrive with Generated with Claude Code footers, Co-Authored-By: Claude trailers, or codex/ branches still in place. That is a reliable signal the author never read the diff, and today it is caught by hand, per PR, during review. Ported from solana-foundation/kora#665.

Test Plan

  • actionlint .github/workflows/pr-hygiene.yml: clean.
  • Exercised the disclosure grep locally against the template: untouched template fails, one box checked passes, both boxes checked fails, AI box with no tool/extent text fails, AI box with text passes, and a checked box hidden inside a multiline HTML comment fails.
  • pnpm check (prettier) clean.
  • The workflow itself only runs from main once merged (pull_request_target), so its live behavior is verified after merge on the next contributor PR.

AI disclosure

Check exactly one. See CONTRIBUTING.md.

This repository takes a high volume of external contributions, and a growing
share of them arrive with tool attribution still in the description, commits,
or branch name, which is a reliable signal that the author never read the diff.

Add a pull request template with a mandatory two-box AI disclosure and a
pr-hygiene workflow that fails a PR missing the disclosure, and labels,
comments on, and fails external PRs carrying AI tool attribution. Contributors
with write access are exempt from the attribution scan. AGENTS.md tells agents
to mark PR text and commit messages they draft on a contributor's behalf, so a
PR opened without the author in the loop is detectable. CONTRIBUTING makes the
disclosure mandatory and documents what happens when attribution is left in.
@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable new failures or outstanding previous findings remain.

Summary

  • Introduces a pull request template with mutually exclusive disclosure options.
  • Validates disclosure text and flags external submissions containing unreviewed AI attribution.
  • Documents contributor and coding-agent expectations.
  • Since the previous review, uses a canonical documentation link and cleans stale labels from newly exempt maintainer PRs.

Reviews (3) · Last reviewed commit: "ci: harden disclosure parsing and label ..."

Comment thread .github/workflows/pr-hygiene.yml Outdated
Comment thread .github/workflows/pr-hygiene.yml
Per-line sed left a checkbox commented out across several lines intact, so a
disclosure that does not render could satisfy the required check.
Strip HTML comments across lines so a checked box hidden inside a
multiline comment cannot satisfy the disclosure check. Remove a stale
ai-unreviewed label when the author turns out to have write access.
Use an absolute CONTRIBUTING link in the template since relative links
do not resolve from a PR body. Ports the review fixes from
solana-foundation/solana-keychain#308.
@dev-jodee
dev-jodee requested a review from amilz September 10, 2026 14:57

@amilz amilz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM: adds PR-hygiene CI (AI disclosure gate + attribution scan) and docs; CI green.

@dev-jodee
dev-jodee merged commit eb8c87d into main Sep 10, 2026
19 checks passed
@dev-jodee
dev-jodee deleted the ci/ai-pr-hygiene branch September 10, 2026 15:34
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.

2 participants