Skip to content
Open
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
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Comment thread
rgommers marked this conversation as resolved.
Resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also note that agentic tools don't tend to load this file deterministically. Moreover, they open PRs via API, supplying a free-form body in the request never seeing this text. Most tools would, however, load an AGENTS.md file. An instruction placed there may encourage an agent to read this template and fill it out. It's still left to chance, but the likelihood is higher.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I know it's not deterministic, that's fine - this is as much for the reviewers' benefit as for the new contributor or agentic tool. If it's clear that they didn't read it, it's an easy automatic close. Which we do now as reviewers already sometimes, it's just harder to justify so takes more work.

Most tools would, however, load an AGENTS.md file.

That's not an option, since it conflicts with valid AGENTS.md by experienced contributors or maintainers. You shouldn't add such a file unless you expect it to apply to everyone who interacts with the repo, which is typically not the case for OSS projects.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tools allow local files generally; usually a harmless specific file overrides AGENTS.md and some harnesses even have a <THING>.local.md specifically for this case.

However, I don't think this repo needs one, you can just make sure there's a link to what you want it to read in the README. If there's no AGENTS.md, all models are very likely to at least read the README as they gather info about where they are.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(Also, we can come up with a valid AGENTS.md that helps experienced contributors while still making sure it follows a process if making PRs - not in this PR though)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree w/ Henry here. I've been exploring agentic context files and they can generally be useful and wouldn't conflict w/ whatever people have locally. I've been looking at them as a way to improve the interactions as a contrib thing and found that it ended up being a place where I'd record things I repeat the PR authors should stop doing in reviews. Having agents not repeat mistakes automatically (to an extent) is a good thing. But I was also focusing on configuring the thing making the operator more aware of the project and on their own understanding of what they are doing and why... Like a reverse rubber ducky.
But perhaps it's a separate discussion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It doesn't seem true that it wouldn't conflict: some harnesses allow overriding, some allow a second file that gets combined, some have no options for this at all. It's a bit like the pre-AGENTS.md wild west, but worse. It got better than 6 months ago though, so hopefully in another 6-12 months this UX problem will be solved.

Summary of current state generated with Sol 6.1.

Checked against the official documentation on 27 November 2026. This comparison is restricted to uncommitted, repository-specific files inside the checkout or in its immediate parent directory. It excludes user-wide settings, global instruction files, and session-only prompts or switches. Behavior is documented loading behavior, not a guarantee that the model follows every instruction.

Harness Local file mechanism inside the checkout Does it replace the repository's AGENTS.md? Can the immediate parent directory be used instead? Limitations and sources
Codex Put AGENTS.override.md beside the repository's AGENTS.md. Yes, for that directory. Codex selects at most one instruction file per directory, preferring AGENTS.override.md. Instruction files in other directories remain applicable. Not by default. Project instruction discovery starts at the Git root, so ../AGENTS.override.md is outside that search. This is an actual local replacement mechanism, but it is Codex-specific. Renaming an existing personal AGENTS.md is necessary if the repository starts tracking that path. Documentation.
Claude Code Add CLAUDE.local.md. For explicit exclusions, use claudeMdExcludes in .claude/settings.local.json. Under the default configuration, yes: the presence of CLAUDE.local.md suppresses automatic AGENTS.md discovery. It does not replace an existing CLAUDE.md; those files are combined. Explicit exclusions can skip selected instruction files. Yes: ../CLAUDE.local.md is loaded through ancestor discovery and also suppresses the default AGENTS.md fallback. A dedicated parent directory keeps this repository-specific. With claude-md-and-agents-md enabled, both families load instead, so the simple local-file workaround no longer suppresses AGENTS.md. Neither AGENTS.override.md nor AGENTS.local.md is recognized. Direct AGENTS.md support requires v2.1.277 or later. Loading and exclusions.
Gemini CLI Use a private .gemini/settings.json to set context.fileName to a personal filename, such as GEMINI.local.md, and create that file. Through explicit configuration: selecting only the personal filename excludes the repository's usual instruction filenames from automatic discovery. Merely adding GEMINI.local.md does nothing unless configured; listing both names combines their contents. Not with default discovery across a Git root. The default context.memoryBoundaryMarkers contains .git. Reaching a file outside the checkout requires changing discovery configuration or explicitly importing it. Gemini defaults to GEMINI.md, not AGENTS.md. There is no automatic local-suffix replacement rule. The project settings path itself may already be tracked, so this is not always a separate private override file. Context files, project settings and boundaries.
GitHub Copilot CLI Add an uncommitted recognized file, such as CLAUDE.md, or a matching .github/instructions/*.instructions.md file. No documented file-based replacement. Applicable instruction files are combined, with no general precedence order between them. A second personal instruction file therefore does not reliably supersede AGENTS.md. Not through the documented default discovery locations when the checkout is the repository root and working directory. A parent instruction file would require additional setup. No documented automatic AGENTS.override.md or AGENTS.local.md mechanism. This row concerns the CLI; other Copilot interfaces differ. Documentation.
Cursor Agent Add an uncommitted .cursor/rules/local.mdc project rule, configured to apply to the relevant work. No documented same-directory replacement. Additional project rules can supply instructions, but the documentation does not establish that a private rule overrides AGENTS.md or prevents it from loading. Not documented when the checkout is opened as the project. Opening its parent as the workspace changes that setup rather than providing a private override inside the existing project. No documented automatic AGENTS.override.md or AGENTS.local.md mechanism. A deeper AGENTS.md can override parent guidance for its subtree, but is not a replacement covering the whole checkout. Documentation.
OpenCode An uncommitted opencode.json or opencode.jsonc can select a personal file through its instructions array. No. Selected instructions are added after discovered AGENTS.md files; OpenCode explicitly does not resolve conflicts between those instruction sources. A same-directory CLAUDE.md is ignored when AGENTS.md exists. Parent configuration: yes, ../opencode.json(c) is discovered and can select personal instructions. Parent AGENTS.md: conditional—ancestor discovery extends toward the home directory for workspaces under it, but stops at the project root for workspaces elsewhere. Neither approach replaces the repository file. No documented automatic AGENTS.override.md or AGENTS.local.md mechanism. A private configuration path may itself collide with a tracked project configuration file. Instructions, configuration discovery.

Here, a parent-directory arrangement means a dedicated container for this one
checkout, for example:

project-local/
├── CLAUDE.local.md
└── packaging.python.org/
    └── AGENTS.md

That arrangement works for Claude Code's documented ancestor lookup. It is not
a portable layout: Codex and Gemini's default project discovery stops at the
Git root, while the other harnesses have different discovery rules.

Files inside a checkout are private only if they are kept out of commits. A
locally chosen filename can also become tracked by the project later. None of
these mechanisms automatically migrates a pre-existing personal AGENTS.md
when the repository starts tracking the same path.

Under this narrower definition, Codex has a direct local replacement file;
Claude Code has local suppression and exclusion mechanisms; Gemini supports
explicit project-local filename selection. Copilot CLI, Cursor, and OpenCode
document ways to add local instructions, but not an equivalent automatic
private-file replacement for a repository AGENTS.md.

But perhaps it's a separate discussion.

Yes, I think so. If someone can come up with a working solution and more or less universally applicable content for this file, then sure why not.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
### PR summary and motivation
<!-- Please take some time to make it easier for us to review
your pull request (PR). Describe the PR using the questions below as guidance.

- What problem does this PR solve? Link any relevant issues and PRs.
- Why are you interested in working on this PR?
- How does the proposed change help you?
Comment thread
rgommers marked this conversation as resolved.
Resolved
- Will this change be relevant in 5 years (for new pages or sections)?

Make sure to review the contribution guidelines: https://packaging.python.org/en/latest/contribute/

-->


#### AI usage disclosure
Comment thread
rgommers marked this conversation as resolved.
Resolved
<!-- If AI was used in the preparation of this PR, please disclose
the tool(s) used, how they were used, and specify what code or text is AI generated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is too much detail, expect nobody to fill it in to this level. specifying what was AI generated is inappropriate and nobody is going to track that other than "all of it". nobody will ever go line by line, word by word, and call out the bits and pieces when they edited something. it isn't practical.

I'd keep this simpler to the thing you'll actually see complied with: "please disclose the tool(s) and model version used"

what outcomes are you looking for?

there isn't anything meaningful reviewers will be able to do with "how they were used" or a specific byte by byte indicator of whether a PEBKAC keyboard user was involved or not. so don't ask for it. you won't generally get it and have no way to know because that level of detail is generally not relevant.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it appropriate to simply copy the text from the devguide into here?

Disclosure of the use of AI tools in the PR description is appreciated, while not required. Be prepared to explain how the tool was used and what changes it made.

(ref: https://devguide.python.org/getting-started/ai-tools/#ai-tools )

It could be dropped in verbatim, followed by "Use this section to tell us about your tool versions and usage."
And then it's at the contributor's discretion.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like the "be prepared to" phrasing, as there are times when that could be of interest but I doubt most cases are.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, I will keep this as is. These comments feel like bike shedding, and this works quite well for NumPy and SciPy where it's been in use for the past year or so. There is high signal-to-noise on this question, and this addresses an actual problem we have on this repo (many drive-by PRs). There are no complaints on this from the dozens maintainers on those repos, and it takes like 5 seconds to fill out where you didn't use an AI tool, used one for code generation, only for self-review, etc.

To be clear, the main problems we have are:

  1. Many drive-by PRs made with AI tools
  2. For higher-quality PRs, many do not get reviewed at all or in time, and those that did get reviewed often still don't get merged.

An "it's optional to disclose" does not address (1), and based on what I hear from CPython devs, that devguide guidance isn't working all that well and there's an issue there deciding on what to do with the flood of AI-driven issues and PRs as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

editing a doc or template will not solve drive by PR volume. you have to actually restrict PR creation. https://docs.github.com/en/communities/moderating-comments-and-conversations/limiting-interactions-in-your-repository

In cpython we currently limit the ability for drive-by PR creations for those not already involved with the project.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We did add a limit to PRs from new contributors a few days ago. IMO the best way to reduce PR volume is to close open issues (I wish there was a private issue option that was not related to security). I agree I've not really seen a difference in volume when adding similar docs to build (for example). Also about 2/3 of the low quality PRs ignore the template completely.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comparing the disclosure request to a proactive control on junk PRs is slightly amiss. Whether or not the section is filled out, and what it says, helps with triage, which is a distinct activity.

I'm in favor of any minor changes which help keep this PR unblocked.1
I only suggested the CPython option to have something concrete.2

To me, this is good enough:

this works quite well for NumPy and SciPy where it's been in use for the past year or so.

Footnotes

  1. I stand by my initial comment that I like the content in this PR; I'm only adding to the conversation where I can try to grease the path towards completion. ↩

  2. Aside: the CPython devguide has a specific extra hurdle, which is that many would-be-contributors aren't going to the separate site to read the instructions there. ↩

If no AI tools were used, please write "No AI tools used" in this section.
Comment thread
rgommers marked this conversation as resolved.
Resolved

All interactions with reviewers must be performed by humans, including the submission of PRs.

Read the Python Packaging User Guide's policy on AI-assisted contributions at
https://github.com/pypa/packaging.python.org/blob/main/AI_POLICY.md

-->
21 changes: 21 additions & 0 deletions AI_POLICY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# AI Policy

AI-assisted contributions are accepted only if:

- The PR follows the same rules as a non-AI PR.
- It clearly states that it is AI-assisted and names the tool used.
- If you are a new contributor, your PR links to an accepted issue.
- AI-generated descriptions/comments are clearly marked and only used when
required.
- A human drove the tool, reviewed every line, and can explain the change.
- It was not opened by a fully autonomous agent.
- You respond to review comments yourself.

This applies to issues and comments as well as pull requests. Using AI for
translation or grammar help is fine. AI output may infringe copyright; it is

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This copyright claim is baseless FUD. It is already the maintainers responsibility to do this. Human authored things are just as likely to do this as well. Do you tell people not to do this explicitly in a human policy doc? If not, this statement is fluff and doesn't add anything by being here.

Your contribute.rst text already covers this concept with "you are responsible".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I personally don't care much about the exact wording here and would be fine to delete it, given that the risk is quite a bit lower than it would be in say domain-specific algorithmic code. I'll just point out that (a) this is not uncommon wording, (b) contribute.rst doesn't say "copyright" in so many words, and (c) "baseless FUD" isn't particularly constructive wording (especially on a repo you don't actually contribute to).

I'll defer to @henryiii here, since he maintains the chosen template. Henry, would you prefer to keep or delete this?

your responsibility to make sure it does not.

Unsolicited, undisclosed, or low-effort AI PRs will be closed.
Comment thread
rgommers marked this conversation as resolved.
Resolved

Only humans can be named as co-authors, and AI can *never* sign off on a
commit. I.e., don't add `Co-authored-by` or `Signed-Off-By` for an AI tool.
6 changes: 6 additions & 0 deletions source/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ By contributing to the |PyPUG|, you're expected to follow the PSF's
.. __: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md


You are responsible for all code and documentation you submit, including
AI-generated content. Review it yourself and respond to review comments in your
own words. If you use AI coding tools, please read our
`AI policy <https://github.com/pypa/packaging.python.org/blob/main/AI_POLICY.md>`_.


Documentation types
===================

Expand Down
Loading