From 3f19cdc11548ffb9764f2d3dedf7fe2634fb9052 Mon Sep 17 00:00:00 2001 From: David Zaslavsky Date: Mon, 23 Nov 2026 01:12:52 -0800 Subject: [PATCH 1/3] Add an LLM contribution policy This updates the README to adopt pytest's policy on AI/LLM use in contributions, with an additional requirement for strict disclosure. I've been wary about accepting LLM-aided contributions in other open source projects, but since this plugin is useless without pytest and pytest already accepts LLM contributions, it probably doesn't cause any additional problems to accept them in this project under the same terms. However, I want to have a strict disclosure requirement so that if some problem with LLM contributions does come up in the future, we have a way of identifying them. (And yes, it's very possible that contributors will just lie, but the best we can do is state clear expectations and then do our best to encourage people to meet those expectations.) --- README.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.rst b/README.rst index 7a4e557..18c75b1 100644 --- a/README.rst +++ b/README.rst @@ -281,6 +281,33 @@ I already have a couple of ideas for future versions: * making the SMTP outbox as convenient to use as ``django.core.mail.outbox`` * add your own here! +AI/LLM-Assisted Contributions Policy +------------------------------------ + +For consistency, we have adopted the `pytest LLM policy`_ except that +attribution is mandatory. pytest's LLM policy generally allows developers to +include LLM-generated code in their contributions, as long as they understand +what they're contributing and take responsibility for it in the same way as if +they had written it themselves. In particular, taking responsibility for +a contribution means that the human developer needs to check and understand +LLM-generated contributions _before_ submitting them as a PR, and the human +developer must be the one to respond to questions from maintainers and +participate in the process of getting the PR ready to merge. + +Again, for ``pytest-localserver`` we have an extra requirement that disclosing +the use of AI tools is mandatory. We ask that it be done in a specific way: + +* Use a commit trailer that identifies the model and harness in each commit + that includes LLM-generated content. We recommend ``Assisted-by``, with + a format like this:: + + Assisted-by: Claude Code 2.1.310-325 with Opus 5 + Assisted-by: OpenCode 2.2.5 with Sonnet 5.6 and gpt-5.4 + + A ``Co-authored-by`` trailer that includes the same information is also + acceptable. +* Mention in the PR description that you used AI tools, just for visibility. + Preparing a release ------------------- @@ -332,3 +359,4 @@ For package maintainers, here is how we release a new version: .. _twine: https://twine.readthedocs.io/en/stable/ .. _new release form on Github: https://github.com/pytest-dev/pytest-localserver/releases/new .. _release workflows page: https://github.com/pytest-dev/pytest-localserver/actions/workflows/release.yml +.. _pytest LLM policy: https://github.com/pytest-dev/pytest/blob/main/CONTRIBUTING.rst#aillm-assisted-contributions-policy From abf8c655a8c26a7d3bcb7abc44befcb186f13337 Mon Sep 17 00:00:00 2001 From: David Zaslavsky Date: Mon, 23 Nov 2026 01:19:12 -0800 Subject: [PATCH 2/3] Add a pull request template that reminds people of the LLM policy This template is adapted from the one pytest itself uses. --- .github/PULL_REQUEST_TEMPLATE.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..c9b64ae --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,20 @@ + From eb76fc2274ca4d29bef601871149667adc7e6ff6 Mon Sep 17 00:00:00 2001 From: David Zaslavsky Date: Mon, 23 Nov 2026 02:48:35 -0800 Subject: [PATCH 3/3] Add an AGENTS.md file with agent instructions echoing the LLM policy The file was generated by an LLM and then I manually reviewed it and made some minor edits. Assisted-by: OpenCode 2.3.0 with gemma4:31b --- AGENTS.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..e16186e --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,19 @@ +# AI Agent Guidelines + +This project follows the AI/LLM-Assisted Contributions Policy outlined in `README.rst`. + +## LLM Policy + +When contributing to this repository, AI agents (and the humans using them) must adhere to the following: + +1. **Responsibility**: The human developer is responsible for all contributions. All LLM-generated code must be reviewed and understood by the developer before submission. +2. **PR Disclosure**: Any pull request containing LLM-generated content must explicitly disclose this in the PR description. +3. **Commit Attribution**: Every commit containing LLM-generated content must include an `Assisted-by` (recommended) or `Co-authored-by` commit trailer in the commit message. + +### Commit Message Format + +Follow the project's requirement for an `Assisted-by` or `Co-authored-by` trailer. A recommended format is: + +`Assisted-by: with [, TOOL1, TOOL2, ...]` + +Example: `Assisted-by: OpenCode 2.3.0 with gemma4:31b`