Skip to content

Commit f7c49e6

Browse files
authored
[docs] add a policy for AI assisted contributions (#4138)
1 parent 43b725b commit f7c49e6

3 files changed

Lines changed: 121 additions & 17 deletions

File tree

docs/make_utilities.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ function documentation_structure()
652652
],
653653
"Developer Docs" => [
654654
"Contributing" => "developers/contributing.md",
655+
"AI Policy" => "developers/ai_policy.md",
655656
"Extensions" => "developers/extensions.md",
656657
"Custom binaries" => "developers/custom_solver_binaries.md",
657658
"Style Guide" => "developers/style.md",

docs/src/developers/ai_policy.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# AI Policy
2+
3+
This document describes how the JuMP developers will manage and respond to
4+
AI-assisted contributions to the JuMP ecosystem.
5+
6+
"AI" herein refers to generative AI tools like large language models that can
7+
generate, edit, and review software code; create and manipulate images; or
8+
generate human-like communication.
9+
10+
The intent of the policy is to balance the benefits of AI-assisted contributions
11+
against the long-term maintenance requirement of the JuMP ecosystem.
12+
13+
It was inspired by similar policies in [SymPy](https://docs.sympy.org/dev/contributing/ai-generated-code-policy.html)
14+
and [SciPy](https://scipy.github.io/devdocs/dev/conduct/ai_policy.html).
15+
16+
## Communication
17+
18+
This part of the policy applies to all communication in our [community forum](https://jump.dev/forum),
19+
[developer chatroom](https://jump.dev/chatroom), and [GitHub repositories](https://github.com/jump-dev).
20+
21+
Do not use AI to generate written communication. Write in your own words.
22+
Human-to-human communication is essential for an open source community to thrive.
23+
24+
If English is not your first language, consider providing both a machine
25+
generated translation into English and the original text in your preferred
26+
language.
27+
28+
## Responsibility
29+
30+
You are responsible for any code you submit to JuMP's repositories. You must
31+
understand and be able to explain the code you submit as well as the existing
32+
related code. It is not acceptable to submit a patch that you cannot understand
33+
and explain in your own words.
34+
35+
If you use AI to automatically generate descriptions, please first start with a
36+
human-written description of your changes, and then provide a properly
37+
identified (see [Disclosure](@ref)) and polished AI summary.
38+
39+
## Copyright
40+
41+
All code in JuMP-related repositories is released under an open source license
42+
(the exact license depends on the repository). Contributors license their code
43+
under the same license. That means contributors must own the copyright of any
44+
code you submit. It is your responsibility to not infringe on others copyright.
45+
We will reject any pull requests where the copyright is in question.
46+
47+
## Disclosure
48+
49+
You must disclose whether AI has been used to assist in the development of your
50+
pull request. If so, you must document which tools have been used, how they
51+
were used, and specify what code or text is AI generated. We will reject any
52+
pull request that does not include the disclosure.
53+
54+
## Pull Requests
55+
56+
When authoring new code in JuMP, keep in mind that the JuMP developers' two
57+
biggest bottlenecks are:
58+
59+
1. capacity for code review of new pull requests
60+
2. on-going support and maintenance of existing features.
61+
62+
For these reasons, if you want to add a new feature or undertake a large
63+
refactor, please open an issue to discuss what you want to change _before_
64+
opening a pull request. In the issue, describe what you want to change and why
65+
it matters to you.
66+
67+
Large pull requests that add new features not previously discussed in an issue
68+
may be closed without review, even if they are correct and demonstrably useful.
69+
70+
## AI Agents
71+
72+
The use of an AI agent that writes code and then submits a pull request
73+
autonomously is not permitted. A human must check any generated code and submit
74+
a pull request according to the [Responsibility](@ref) section above.

docs/src/developers/contributing.md

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# How to contribute to JuMP
22

3-
Welcome, this document explains some ways you can contribute to JuMP.
3+
The JuMP developers welcome and encourage new contributors. This document
4+
explains some ways you can contribute to JuMP.
45

56
## Code of Conduct
67

@@ -22,10 +23,40 @@ help answer questions on the forum.
2223
## Join the developer chatroom
2324

2425
If you're interested in contributing code to JuMP, the next place to join is the
25-
[developer chatroom](https://jump.dev/chatroom). Let us know what you
26-
have in mind, and we can point you in the right direction.
26+
[developer chatroom](https://jump.dev/chatroom). Let us know what you have in
27+
mind, and we can point you in the right direction.
2728

28-
## Improve the documentation
29+
## The best ways to contribute
30+
31+
The best ways you can get involved are:
32+
33+
1. **Find and report bugs**: we can't fix things that we don't know about. There
34+
are always new bugs (or inconsistencies that we should better document) to
35+
find. Report a bug by [opening a GitHub issue](https://github.com/jump-dev/JuMP.jl/issues).
36+
37+
Using AI tools to find bugs is acceptable, but you are responsible for
38+
understanding and explaining _why_ the issue is a bug in your own words.
39+
Rather than copy-pasting only the content of the AI analysis into the issue,
40+
first explain what you did to find and verify the bug, and then copy-paste
41+
the AI tool's output.
42+
43+
Also note that there are many repositories in the JuMP ecosystem. Don't worry
44+
if you open an issue in the "wrong" one; we can easily transfer it to the
45+
correct repository.
46+
47+
2. **Tell us about confusing parts of the documentation**: if you get stuck
48+
trying to do something in JuMP, it means we didn't document things well
49+
enough. If you have suggestions for new tutorials we could add or how we
50+
could improve the documentation please leave a comment at
51+
["Suggestions for documentation improvements"](https://github.com/jump-dev/JuMP.jl/issues/2348).
52+
53+
3. **Make your own packages**: write your own solver or JuMP extension under
54+
your personal account. There are no rules here. Vibe code as much as you
55+
like. Tell us about the things you have created by posting on the
56+
[community forum](https://jump.dev/forum), or give a talk at a
57+
[JuMP-dev workshop](https://jump.dev/categories/#jump-dev).
58+
59+
## How to improve the documentation
2960

3061
Chances are, if you asked (or answered) a question on the community forum, then
3162
it is a sign that the [documentation](https://jump.dev/JuMP.jl/dev/) could be
@@ -44,14 +75,13 @@ on how to do this.)
4475

4576
If your change is larger, or touches multiple files, you will need to make the
4677
change locally and then use Git to submit a pull request. (See
47-
[Contribute code to JuMP](@ref) below for more on this.)
78+
[How to contribute code to JuMP](@ref) below for more on this.)
4879

4980
!!! tip
50-
If you need any help, come join the
51-
[developer chatroom](https://jump.dev/chatroom) and we will walk
52-
you through the process.
81+
If you need any help, come join the [developer chatroom](https://jump.dev/chatroom)
82+
and we will walk you through the process.
5383

54-
## File a bug report
84+
## How to file a bug report
5585

5686
Another way to contribute to JuMP is to file
5787
[bug reports](https://github.com/jump-dev/JuMP.jl/issues/new?template=bug_report.md).
@@ -61,12 +91,11 @@ before posting. You can also find a copy of that info
6191
[here](https://github.com/jump-dev/JuMP.jl/blob/master/.github/ISSUE_TEMPLATE/bug_report.md).
6292

6393
!!! tip
64-
If you're unsure whether you have a real bug, post on the
65-
[community forum](https://jump.dev/forum)
94+
If you're unsure whether you have a real bug, post on the [community forum](https://jump.dev/forum)
6695
first. Someone will either help you fix the problem, or let you know the
6796
most appropriate place to open a bug report.
6897

69-
## Contribute code to JuMP
98+
## How to contribute code to JuMP
7099

71100
Finally, you can also contribute code to JuMP.
72101

@@ -89,14 +118,14 @@ JuMP is similar to the following:
89118
The first step is to find an [open issue](https://github.com/jump-dev/JuMP.jl/issues)
90119
(or open a new one) for the problem you want to solve. Then, _before_ spending
91120
too much time on it, discuss what you are planning to do in the issue to see if
92-
other contributors are fine with your proposed changes. Getting feedback early can
93-
improve code quality, and avoid time spent writing code that does not get merged into
94-
JuMP.
121+
other contributors are fine with your proposed changes. Getting feedback early
122+
can improve code quality and avoid time spent writing code that does not get
123+
merged into JuMP.
95124

96125
!!! tip
97126
At this point, remember to be patient and polite; you may get a _lot_ of
98-
comments on your issue. However, do not be afraid. Comments mean that people are
99-
willing to help you improve the code that you are contributing to JuMP.
127+
comments on your issue. However, do not be afraid. Comments mean that people
128+
are willing to help you improve the code that you are contributing to JuMP.
100129

101130
**Step 2: fork JuMP**
102131

0 commit comments

Comments
 (0)