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 @@ + 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` 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