From 72d6fa2490cba83bd53ee3f2012fdd17f9b523c2 Mon Sep 17 00:00:00 2001 From: blnicho Date: Tue, 19 May 2026 11:58:06 -0600 Subject: [PATCH 1/6] Add AI policy to contribution guide --- .github/PULL_REQUEST_TEMPLATE.md | 3 +++ doc/OnlineDocs/contribution_guide.rst | 34 ++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5ab3eb16ed9..2612ac2933f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -18,6 +18,9 @@ - - +## AI-Use Disclosure + + ### 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..83a22f0cc9e 100644 --- a/doc/OnlineDocs/contribution_guide.rst +++ b/doc/OnlineDocs/contribution_guide.rst @@ -158,7 +158,39 @@ 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. + +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 explain why they can't do unit testing + without it. We have observed that AI-generated unit tests excessivly 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. PR review comments + can be marked as resolved without commenting "Done" on every one. + Review Process -------------- From fc2b4d6ba030b4b4604a2cc8adb7a5803628f429 Mon Sep 17 00:00:00 2001 From: blnicho Date: Tue, 19 May 2026 12:04:35 -0600 Subject: [PATCH 2/6] Fix typo --- doc/OnlineDocs/contribution_guide.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/OnlineDocs/contribution_guide.rst b/doc/OnlineDocs/contribution_guide.rst index 83a22f0cc9e..3a2ef491e73 100644 --- a/doc/OnlineDocs/contribution_guide.rst +++ b/doc/OnlineDocs/contribution_guide.rst @@ -185,7 +185,7 @@ specific items we are seeing with AI-generated code contributions and our expect * **Use of `mock` in unit tests is prohibited**: We do not allow the use of `mock` in our unit tests unless the developer can explain why they can't do unit testing - without it. We have observed that AI-generated unit tests excessivly use `mock` to + without it. 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. PR review comments From efffd2a230af65891d4f9133fba4dfc19801df8a Mon Sep 17 00:00:00 2001 From: Bethany Nicholson Date: Tue, 19 May 2026 14:36:12 -0600 Subject: [PATCH 3/6] Apply suggestions from code review Co-authored-by: Miranda Mundt <55767766+mrmundt@users.noreply.github.com> Co-authored-by: John Siirola --- .github/PULL_REQUEST_TEMPLATE.md | 15 +++++++++++++++ doc/OnlineDocs/contribution_guide.rst | 6 +++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2612ac2933f..6198c889a9a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -21,6 +21,21 @@ ## 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 Sphnix documentation) + [ ] AI tools generated tests (baselines, examples, and/or code) + [ ] AI tools generated code (apart from tests) + +Review process: + [ ] ALL AI-generated content was rewritten by the PR author + [ ] ALL AI-generated content was thoroughly reviewed and verified by the PR author + [ ] AI-generated content was contributed directly to the repository + + Details / discussion: ### 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 3a2ef491e73..3b0271d4f65 100644 --- a/doc/OnlineDocs/contribution_guide.rst +++ b/doc/OnlineDocs/contribution_guide.rst @@ -183,9 +183,9 @@ We recognize that generative AI tools are rapidly evolving and this AI contribut 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 explain why they can't do unit testing - without it. We have observed that AI-generated unit tests excessively use `mock` to + * **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. PR review comments From ea83451a1e9a0810d8d5dedb8bc25ffa93367f93 Mon Sep 17 00:00:00 2001 From: Bethany Nicholson Date: Tue, 19 May 2026 14:37:32 -0600 Subject: [PATCH 4/6] Update AI policy text based on feedback Removed redundant instruction about marking PR review comments as resolved. --- doc/OnlineDocs/contribution_guide.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/OnlineDocs/contribution_guide.rst b/doc/OnlineDocs/contribution_guide.rst index 3b0271d4f65..585a326730e 100644 --- a/doc/OnlineDocs/contribution_guide.rst +++ b/doc/OnlineDocs/contribution_guide.rst @@ -188,8 +188,7 @@ specific items we are seeing with AI-generated code contributions and our expect 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. PR review comments - can be marked as resolved without commenting "Done" on every one. + PR and issue. Help us out by keeping comments short and direct. Review Process -------------- From d443547bcf632e25587d013b53b4ba2fac7bd745 Mon Sep 17 00:00:00 2001 From: Bethany Nicholson Date: Tue, 19 May 2026 14:44:53 -0600 Subject: [PATCH 5/6] Fix formatting in AI-use disclosure section of PR template --- .github/PULL_REQUEST_TEMPLATE.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 6198c889a9a..e215623b3d9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -21,21 +21,22 @@ ## AI-Use Disclosure -[ ] AI tools were NOT used during the preparation of this PR +- [ ] 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 Sphnix documentation) - [ ] AI tools generated tests (baselines, examples, and/or code) - [ ] AI tools generated code (apart from tests) +- [ ] 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: - [ ] ALL AI-generated content was rewritten by the PR author - [ ] ALL AI-generated content was thoroughly reviewed and verified by the PR author - [ ] AI-generated content was contributed directly to the repository + Review process: + - [ ] ALL AI-generated content was rewritten by the PR author + - [ ] ALL AI-generated content was thoroughly reviewed and verified by the PR author + - [ ] AI-generated content was contributed directly to the repository Details / discussion: + ### 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: From be9df8e85a5a8d8f00ed62dfae13f751bfc4a133 Mon Sep 17 00:00:00 2001 From: Bethany Nicholson Date: Tue, 19 May 2026 17:29:27 -0600 Subject: [PATCH 6/6] Edits to AI contribution policy --- doc/OnlineDocs/contribution_guide.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/OnlineDocs/contribution_guide.rst b/doc/OnlineDocs/contribution_guide.rst index 585a326730e..79c5473c57f 100644 --- a/doc/OnlineDocs/contribution_guide.rst +++ b/doc/OnlineDocs/contribution_guide.rst @@ -178,6 +178,8 @@ 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