forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 248
docs: Update the AI code guidelines #3249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
stephanmeesters
wants to merge
3
commits into
TheSuperHackers:main
Choose a base branch
from
stephanmeesters:docs/ai-policy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+57
−6
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # LLM Contribution Policy | ||
|
|
||
| Today, large language model (LLM)-based tools are being deployed in many coding environments. Some of the "lower-end" features like keyword-driven code completion can be useful aids; other tools make it very easy to generate contributions without the submitter fully understanding how the code works, or the consequences of specific implementation choices. These latter forms of LLM assistance cause major overhead for project maintainers. | ||
|
|
||
| To protect the quality of the project and the sanity of our contributors, we have adopted the following policy regarding LLM-generated content. | ||
|
|
||
| ## 1. Accountability | ||
|
|
||
| **The human contributor is the sole party responsible for the contribution.** | ||
|
|
||
| If you submit a pull request that includes LLM-generated code, documentation, or comments: | ||
|
|
||
| - You must fully understand every line of code in the submission. | ||
| - You must be able to explain the "why" behind the implementation during the review process. | ||
| - You are responsible for verifying that the code is human-readable, maintainable and logically correct. | ||
| - All code needs to be tested and verified. | ||
|
|
||
| "The LLM generated it and it works for me" is never an acceptable answer to a reviewer's question. You must write review responses yourself. LLM tools may assist with translation, meaning-preserving edits, or formatting, but you must verify the final wording. If unsure of an answer, say so rather than presenting an LLM's output as your own. | ||
|
|
||
| Autonomous LLM agents may not submit pull requests, nor comments in other pull requests, issues or discussions. | ||
|
|
||
| ## 2. Disclosure | ||
|
|
||
| If an LLM was used to generate a significant portion of your contribution (i.e. beyond simple autocomplete), we require you to **disclose it** in the pull request description. Note that you should not use an LLM to create the pull request description itself (unless you’ve used it for translation) - as discussed above, we expect pull requests to be submitted by humans. | ||
|
|
||
| In a pull request, generated code needs to be announced as such and to what extent it was polished by human intervention. | ||
|
|
||
| ## 3. Intentionality | ||
|
|
||
| We do not accept pull requests and issues that result from running an LLM tool over the codebase to find improvements without prior context or alignment with the project. | ||
|
|
||
| - **Focused changes:** Do not submit pull requests that perform broad refactoring or cleanup suggested by an LLM unless a maintainer specifically requests it. | ||
| - **Design First:** For any non-trivial change, we strongly recommend opening an **Issue** or **Discussion** first, or reach out to the **Discord**. Pull requests that arrive out of the blue with significant LLM-generated logic that doesn't align with our roadmap or architecture will be closed. | ||
| - **Quality over Quantity:** We value one thoughtful, manually crafted pull request over ten LLM-assisted fixes for nonexistent or trivial issues. | ||
|
|
||
| New contributors are discouraged from submitting pull requests with thousands of lines changed or added with the help of LLMs, because human code reviewers cannot attend such volumes at the risk of wasting precious time with potentially poorly generated code. | ||
|
|
||
| ## 4. Prohibited Uses | ||
|
|
||
| The following are strictly prohibited and will result in immediate closure of a pull request or issue and potentially a block from the organization: | ||
|
|
||
| - **Automated Pull Request Descriptions:** Using an LLM to write pull request descriptions that are vague, overly elaborate, or fail to accurately describe the technical changes. We want to hear from *you* - the developer - why this change matters (see points 1 & 2). | ||
| - **Unvetted Boilerplate:** Submitting large blocks of LLM-generated boilerplate that haven't been trimmed to what's actually necessary. If you don't understand what the code does, don't submit the pull request. | ||
| - **Hallucinated Features:** Submitting pull requests for features or bug fixes that don't exist, based on LLM hallucinations about the project's capabilities. | ||
|
|
||
| ## 5. Enforcement | ||
|
|
||
| TheSuperHackers project maintainers reserve the right to close any pull request that appears to be a low-effort LLM-assisted contribution, without providing a detailed technical critique. If a maintainer suspects you do not understand your pull request, it will be closed immediately. | ||
|
|
||
| Cases of repeated violations of these (or any of our other contributor guidelines) could result in a ban from our repositories. | ||
|
|
||
| ### Acknowledgement | ||
|
|
||
| This policy was written by humans, based on the work in the [Mastodon AI Policy](https://github.com/mastodon/.github/blob/main/AI_POLICY.md), the [CloudNativePG AI Policy](https://github.com/cloudnative-pg/governance/blob/main/AI_POLICY.md), the [Ghostty AI Policy](https://github.com/ghostty-org/ghostty/blob/main/AI_POLICY.md), and the Linux Foundation's [Generative AI Policy](https://www.linuxfoundation.org/legal/generative-ai). | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the one sentence where adding AI would clarify the "Generated".