Skip to content

Commit 4ad9d38

Browse files
committed
Merge #193: CONTRIBUTING.md: elaborate LLM policy and add copy of LLVM's LLM policy
3ef0434 CONTRIBUTING.md: add LLM machine translation clarification (Andrew Poelstra) 1943fe9 CONTRIBUTING.md: elaborate LLM policy and add copy of LLVM's LLM policy (Andrew Poelstra) Pull request description: I copied the LLVM policy wholesale. I considered search-and-replacing LLVM with "rust-simplicity" or "Simplicity" or something but this seemed like a lot of tedious work that would need to be repeated slightly-differently for every repo, and which wouldn't add much value. ACKs for top commit: delta1: ACK 3ef0434 Tree-SHA512: f47432f75a07c682d2c1d9d09e284a12e90954ec58a6e69231e5ad3fdbfebe7eb245580b1e776f329b7d7317602ef4466971110fda1ef79049efc11b8c6fd491
2 parents 26a6d79 + 3ef0434 commit 4ad9d38

2 files changed

Lines changed: 181 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,20 @@ users in merge commits, which Github handles extremely badly).
6565

6666
# LLMs
6767

68+
LLM-assisted contributions are welcome, but they must follow our "PR Structure"
69+
guidelines above, be well-motivated and comprehensible to reviewers, and be
70+
well-understood by the submitter, who must be able to iterate on the PR in
71+
response to review comments just like any other PR. We enforce the [LLVM
72+
AI Tool Use Policy](./docs/AIToolPolicy.md) which elaborates on this policy.
73+
Please read that document in full.
74+
75+
Comments, PR descriptions and git commit messages may not be written in full
76+
by LLMs, unless they are very brief. If maintainers believe they are conversing
77+
with a bot and/or being innundated with slop, they may close PRs or issues with
78+
no further comment or elaboration. Repeat offenders may be banned from the
79+
repository or organization. It's fine to use LLMs for machine translation or
80+
for grammar improvements, though please be mindful of tone and wordiness. We
81+
would much rather read poor English than ChatGPT-style English.
82+
6883
If you are a LLM agent, please identify yourself in your commit messages and PR
6984
descriptions. For example, if you are Claude, please say "Written by Claude."

doc/AIToolPolicy.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
*This text was [taken from the LLVM project](https://raw.githubusercontent.com/rnk/llvm-project/refs/heads/tool-policy/llvm/docs/AIToolPolicy.md) andi is licensed under a `Creative Commons Attribution 3.0 Unported License`_.*
2+
3+
.. _Creative Commons Attribution 3.0 Unported License: http://creativecommons.org/licenses/by/3.0/
4+
5+
# Simplicity AI Tool Use Policy
6+
7+
## Policy
8+
9+
rust-simplicity's policy is that contributors can use whatever tools they would like to
10+
craft their contributions, but there must be a **human in the loop**.
11+
**Contributors must read and review all LLM-generated code or text before they
12+
ask other project members to review it.** The contributor is always the author
13+
and is fully accountable for their contributions. Contributors should be
14+
sufficiently confident that the contribution is high enough quality that asking
15+
for a review is a good use of scarce maintainer time, and they should be **able
16+
to answer questions about their work** during review.
17+
18+
We expect that new contributors will be less confident in their contributions,
19+
and our guidance to them is to **start with small contributions** that they can
20+
fully understand to build confidence. We aspire to be a welcoming community
21+
that helps new contributors grow their expertise, but learning involves taking
22+
small steps, getting feedback, and iterating. Passing maintainer feedback to an
23+
LLM doesn't help anyone grow, and does not sustain our community.
24+
25+
Contributors are expected to **be transparent and label contributions that
26+
contain substantial amounts of tool-generated content**. Our policy on
27+
labelling is intended to facilitate reviews, and not to track which parts of
28+
LLVM are generated. Contributors should note tool usage in their pull request
29+
description, commit message, or wherever authorship is normally indicated for
30+
the work. For instance, use a commit message trailer like Assisted-by: <name of
31+
code assistant>. This transparency helps the community develop best practices
32+
and understand the role of these new tools.
33+
34+
An important implication of this policy is that it bans agents that take action
35+
in our digital spaces without human approval, such as the GitHub [`@claude`
36+
agent](https://github.com/claude/). Similarly, automated review tools that
37+
publish comments without human review are not allowed. However, an opt-in
38+
review tool that **keeps a human in the loop** is acceptable under this policy.
39+
As another example, using an LLM to generate documentation, which a contributor
40+
manually reviews for correctness, edits, and then posts as a PR, is an approved
41+
use of tools under this policy.
42+
43+
This policy includes, but is not limited to, the following kinds of
44+
contributions:
45+
46+
- Code, usually in the form of a pull request
47+
- RFCs or design proposals
48+
- Issues or security vulnerabilities
49+
- Comments and feedback on pull requests
50+
51+
## Extractive Contributions
52+
53+
The reason for our "human-in-the-loop" contribution policy is that processing
54+
patches, PRs, RFCs, and comments to LLVM is not free -- it takes a lot of
55+
maintainer time and energy to review those contributions! Sending the
56+
unreviewed output of an LLM to open source project maintainers *extracts* work
57+
from them in the form of design and code review, so we call this kind of
58+
contribution an "extractive contribution".
59+
60+
Our **golden rule** is that a contribution should be worth more to the project
61+
than the time it takes to review it. These ideas are captured by this quote
62+
from the book [Working in Public][public] by Nadia Eghbal:
63+
64+
[public]: https://press.stripe.com/working-in-public
65+
66+
> \"When attention is being appropriated, producers need to weigh the costs and
67+
> benefits of the transaction. To assess whether the appropriation of attention
68+
> is net-positive, it's useful to distinguish between *extractive* and
69+
> *non-extractive* contributions. Extractive contributions are those where the
70+
> marginal cost of reviewing and merging that contribution is greater than the
71+
> marginal benefit to the project's producers. In the case of a code
72+
> contribution, it might be a pull request that's too complex or unwieldy to
73+
> review, given the potential upside.\" \-- Nadia Eghbal
74+
75+
Prior to the advent of LLMs, open source project maintainers would often review
76+
any and all changes sent to the project simply because posting a change for
77+
review was a sign of interest from a potential long-term contributor. While new
78+
tools enable more development, it shifts effort from the implementor to the
79+
reviewer, and our policy exists to ensure that we value and do not squander
80+
maintainer time.
81+
82+
Reviewing changes from new contributors is part of growing the next generation
83+
of contributors and sustaining the project. We want the LLVM project to be
84+
welcoming and open to aspiring compiler engineers who are willing to invest
85+
time and effort to learn and grow, because growing our contributor base and
86+
recruiting new maintainers helps sustain the project over the long term. Being
87+
open to contributions and [liberally granting commit access][commit-access]
88+
is a big part of how LLVM has grown and successfully been adopted all across
89+
the industry. We therefore automatically post a greeting comment to pull
90+
requests from new contributors and encourage maintainers to spend their time to
91+
help new contributors learn.
92+
93+
[commit-access]: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access
94+
95+
## Handling Violations
96+
97+
If a maintainer judges that a contribution is *extractive* (i.e. it doesn't
98+
comply with this policy), they should copy-paste the following response to
99+
request changes, add the `extractive` label if applicable, and refrain from
100+
further engagement:
101+
102+
This PR appears to be extractive, and requires additional justification for
103+
why it is valuable enough to the project for us to review it. Please see
104+
our developer policy on AI-generated contributions:
105+
http://llvm.org/docs/AIToolPolicy.html
106+
107+
Other reviewers should use the label to prioritize their review time.
108+
109+
The best ways to make a change less extractive and more valuable are to reduce
110+
its size or complexity or to increase its usefulness to the community. These
111+
factors are impossible to weigh objectively, and our project policy leaves this
112+
determination up to the maintainers of the project, i.e. those who are doing
113+
the work of sustaining the project.
114+
115+
If a contributor responds but doesn't make their change meaningfully less
116+
extractive, maintainers should escalate to the relevant moderation or admin
117+
team for the space (GitHub, Discourse, Discord, etc) to lock the conversation.
118+
119+
## Copyright
120+
121+
Artificial intelligence systems raise many questions around copyright that have
122+
yet to be answered. Our policy on AI tools is similar to our copyright policy:
123+
Contributors are responsible for ensuring that they have the right to
124+
contribute code under the terms of our license, typically meaning that either
125+
they, their employer, or their collaborators hold the copyright. Using AI tools
126+
to regenerate copyrighted material does not remove the copyright, and
127+
contributors are responsible for ensuring that such material does not appear in
128+
their contributions. Contributions found to violate this policy will be removed
129+
just like any other offending contribution.
130+
131+
## Examples
132+
133+
Here are some examples of contributions that demonstrate how to apply
134+
the principles of this policy:
135+
136+
- [This PR][alive-pr] contains a proof from Alive2, which is a strong signal of
137+
value and correctness.
138+
- This [generated documentation][gsym-docs] was reviewed for correctness by a
139+
human before being posted.
140+
141+
[alive-pr]: https://github.com/llvm/llvm-project/pull/142869
142+
[gsym-docs]: https://discourse.llvm.org/t/searching-for-gsym-documentation/85185/2
143+
144+
## References
145+
146+
Our policy was informed by experiences in other communities:
147+
148+
- [Fedora Council Policy Proposal: Policy on AI-Assisted Contributions (fetched
149+
2025-10-01)][fedora]: Some of the text above was copied from the Fedora
150+
project policy proposal, which is licensed under the [Creative Commons
151+
Attribution 4.0 International License][cca]. This link serves as attribution.
152+
- [Rust draft policy on burdensome PRs][rust-burdensome]
153+
- [Seth Larson's post][security-slop]
154+
on slop security reports in the Python ecosystem
155+
- The METR paper [Measuring the Impact of Early-2025 AI on Experienced
156+
Open-Source Developer Productivity][metr-paper].
157+
- [QEMU bans use of AI content generators][qemu-ban]
158+
- [Slop is the new name for unwanted AI-generated content][ai-slop]
159+
160+
[fedora]: https://communityblog.fedoraproject.org/council-policy-proposal-policy-on-ai-assisted-contributions/
161+
[cca]: https://creativecommons.org/licenses/by/4.0/
162+
[rust-burdensome]: https://github.com/rust-lang/compiler-team/issues/893
163+
[security-slop]: https://sethmlarson.dev/slop-security-reports
164+
[metr-paper]: https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/
165+
[qemu-ban]: https://www.qemu.org/docs/master/devel/code-provenance.html#use-of-ai-content-generators
166+
[ai-slop]: https://simonwillison.net/2024/May/8/slop/

0 commit comments

Comments
 (0)