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
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@
-
-

## AI-Use Disclosure
<!-- Contributors must disclose whether and how AI tools were used and highlight any areas of uncertainty or where they want focused reviewer feedback -->

Comment thread
blnicho marked this conversation as resolved.
- [ ] 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:
- [ ] 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
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 the intent behind this line to check if "CoPilot did it for me"? If so, I wouldn't say it's entirely clear.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think this section is meant to help us understand the extent to which the contributor reviewed the AI-generated content but this was a change suggested by @jsiirola so I'm hoping he'll also chime in.

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.

The original template was a request for free-response from the author. My concern is that they won't know what we are looking for and could write anything from a novel to the equivalent of "LGTM". The idea here is for a simple template to prompt them to to directly answer our most important questions.

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.

Oh I agree 100% with the checklist. This specific line is hard to parse what it means, though. Does it mean, "I let copilot commit for me"?

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.

Ahh... right. The intent was to indicate that AI-generated code was included verbatim, potentially with no user involvement. My thinking at the time is that the "review process" should be a "radio button" (pick exactly one)... and the third option was a way of saying "none of the above" (and therefore volunteering the PR for summary closure).

The other thing that came to mind as I was reading the references that @blnicho circulated was that we should probably be concerned when any AI code is committed verbatim, as the copyright provenance of that code is ambiguous (e.g., did the AI regenerate copyrighted code it was trained on?)

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.

So is the "Review Process" section only for reviewers, or are submitters still supposed to be selecting something from there?

I would say, "None of us are lawyers, and the courts don't even know what's happening there. Let them figure it out and then we can adjust our terms." We already have the expectation of what license they need to be using when contributing here, and we will be covering our butts by introducing this policy at all (because we can have traceability into "PRs where AI was used").


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:
Expand Down
35 changes: 34 additions & 1 deletion doc/OnlineDocs/contribution_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------

Expand Down
Loading