Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Why are you here?
<!-- e.g. "I hit this bug using X", "need it for my project", "fun / learning", "AI made me do it". At least a few words, please. -->

## What changed?

## AI disclosure
<!-- AI use is fine; if you did use AI, your reviewer would appreciate knowing that and how you prompted it -->

## Any questions for the reviewer?
54 changes: 54 additions & 0 deletions .github/workflows/disclosure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# Label a PR that still needs a human reader.
#
# AGENTS.md asks an agent to end a commit message with the trailer
# `Human-Review: required` when it expects no human to review the
# commit before the PR, and to end the PR description with an HTML
# comment saying the same when any commit is unreviewed at that point.
# This job looks for either and sets or clears the
# `requires-human-review` label. It runs in the base repository's context so it can label PRs
# from forks; it reads the PR through the API and never checks out or
# runs the PR's code.
#
name: Human review

on:
pull_request_target:
types: [ opened, edited, reopened, synchronize ]

permissions:
pull-requests: write
issues: write

jobs:
label:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
PR: ${{ github.event.pull_request.number }}
steps:
- name: Look for the markers
run: |
set -euo pipefail

gh pr view "$PR" --json body,commits > pr.json

found=0
if jq -e '.body // "" | test("<!-- requires human review -->")' \
pr.json > /dev/null; then
found=1
fi
if jq -e '[.commits[].messageBody
| test("(^|\\n)Human-Review: required[ \\t]*(\\n|$)")] | any' \
pr.json > /dev/null; then
found=1
fi

if [ "$found" = 1 ]; then
gh label create requires-human-review --force --color 0e8a16 \
--description "Nobody has read this change yet; a maintainer will"
gh pr edit "$PR" --add-label requires-human-review
else
gh pr edit "$PR" --remove-label requires-human-review 2>/dev/null || true
fi
16 changes: 16 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Notes for AI coding agents

- Read CONTRIBUTING.md before making changes.
- When opening a PR, fill in every section of .github/pull_request_template.md.
Don't replace it with your own format or pass a free-form `--body`.
- "Why are you here?": ask the human. Don't invent a motivation.
- "AI disclosure": name the tool and model, and say what it did.
- If you expect no human to have reviewed a commit before you open the PR that
carries it, end the commit message with the trailer `Human-Review: required`.
- If any of the PR's commits has not been reviewed by a human when you open it,
end the PR description with the line `<!-- requires human review -->`.
- These tell the maintainers the change still needs a human reader, and they
will be that reader.
- Only describe tests you actually ran.
- Fixing hypothetical issues wastes reviewer time; if the human didn't actually
encounter the bug being fixed, confirm that they still want to proceed.
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Contributing

## AI-assisted contributions

AI tools are fine. Your reviewer appreciates knowing if you did use AI, and if
so how you prompted it or used it. Say what you used in the PR template.
You're responsible for every line: you should be able to explain it in review.
In general, a clear issue describing a real problem you encountered is more
highly valued than a lightly-prompted PR. If you're interested in fixing your
own issue (with or without AI) please say so.

An agent working without a reviewer marks its commits with a
`Human-Review: required` trailer. If you have since read the diff, amend the
commits to drop it.
Loading