diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5ab3eb16ed9..f5d19c942b7 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -18,6 +18,30 @@ - - +## AI-Use Disclosure + + +- [ ] **AI tools were NOT used during the preparation of this PR** + +or + +- [ ] **AI tools contributed to the development of this PR** + - [ ] AI tools generated documentation (including the PR description/comments, code comments, and/or Sphinx documentation) + - [ ] AI tools generated tests (baselines, examples, and/or code) + - [ ] AI tools generated code (apart from tests) + + *Review process (select ONE)*: + - [ ] **Rewritten**: All AI-generated content was rewritten by me before being committed. + - [ ] **Reviewed/verified**: I retained AI-generated content and verified it before committing. Verification included (as applicable): + - [ ] Ran the code and fixed issues + - [ ] Added and ran tests + - [ ] Checked correctness/logic of code and tests + - [ ] Checked for alignment with the contribution guide + - [ ] Considered security implications + - [ ] **As-is**: AI-generated content was commited directly to the repository + + **Notes for reviewers (optional):** + ### Legal Acknowledgement By contributing to this software project, I have read the [contribution guide](https://pyomo.readthedocs.io/en/stable/contribution_guide.html) and agree to the following terms and conditions for my contribution: diff --git a/doc/OnlineDocs/contribution_guide.rst b/doc/OnlineDocs/contribution_guide.rst index d3f7324bef6..79c5473c57f 100644 --- a/doc/OnlineDocs/contribution_guide.rst +++ b/doc/OnlineDocs/contribution_guide.rst @@ -158,7 +158,40 @@ For example, assume Python 3.A is declared end-of-life while Pyomo is on version 6.3.Y. After the release of Pyomo 6.3.(Y+1), Python 3.A will be removed, and the next Pyomo release will be 6.4.0. - +Use of Generative AI +++++++++++++++++++++ + +Pyomo contributors are welcome to use AI-assisted coding tools (e.g., Copilot/Codex) to +draft code, tests, documentation, and commit messages. However, the author remains fully +responsible for the correctness, security, licensing compliance, and maintainability of +every changed line and must be prepared to explain design choices and review changed +code personally before submitting. The use of PR and issue templates is mandatory and +contributions that do not use the templates will be closed. + +PRs with substantial AI-generated portions often require significantly more reviewer +time (including extra scrutiny of tests) and may therefore take longer to review or be +deprioritized, especially when the author is not actively engaging with maintainers +(e.g., responding promptly on the PR, coordinating by email, or participating in +developer calls). To help us review efficiently, contributors must disclose whether and +how AI tools were used and highlight any areas of uncertainty or where they want focused +reviewer feedback. + +The use of an AI agent to autonomously open, or comment on, PRs or issues is not +permitted. When interacting with maintainers please do not use AI to speak for you. +The Pyomo Developers want to interact with humans, not chatbots. We reserve the right +to close without review PRs and issues we deem to be "AI slop". + +We recognize that generative AI tools are rapidly evolving and this AI contribution +policy will be updated regularly based on our observations. The following list includes +specific items we are seeing with AI-generated code contributions and our expectations: + + * **Use of ``mock`` in unit tests is prohibited**: We do not allow the use of ``mock`` + in our unit tests unless the developer can provide solid justification as to its + necessity. We have observed that AI-generated unit tests excessively use ``mock`` to + write weak tests that ignore the broader context of the code being tested. + * **Keep comments concise and curated**: Humans are reading every comment on every + PR and issue. Help us out by keeping comments short and direct. + Review Process --------------