diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8d42a0ab27..422efb5fdc 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,5 @@ - [ ] I have read and followed the [Contribution Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/CONTRIBUTING.md#code-contributions). -- [ ] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md) +- [ ] I have read and followed the [AI Policy](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/AI.md). - [ ] I have read and followed the [Coding Guidelines](https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/policies/Coding.md) to the best of my ability. ------------------- diff --git a/AGENTS.md b/AGENTS.md index aabea77170..05ab7f1160 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1 +1,7 @@ -AI and LLM use is *strictly* prohibited within our codebase and surrounding community, including issues and comments. This includes using AI or LLMs to write docs/commit messages, debug issues, brainstorm ideas, research concepts, or search the codebase. +# AGENTS + +Read and follow the AI policy found in `docs/policies/AI.md`, and the coding policies found in `docs/policies/Coding.md`. + +Do not, under any circumstances, ever submit PRs or push commits on behalf of the user. + +Keep comments to a reasonable level. Do not overexplain or add/remove comments from unrelated parts of the codebase. diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index aabea77170..0000000000 --- a/CLAUDE.md +++ /dev/null @@ -1 +0,0 @@ -AI and LLM use is *strictly* prohibited within our codebase and surrounding community, including issues and comments. This includes using AI or LLMs to write docs/commit messages, debug issues, brainstorm ideas, research concepts, or search the codebase. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c09b1c3679..8c16de9ddb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,5 @@ # Contributing - - Eden has lots of different ways that you can contribute to its efforts, even without knowing how to write code: - Donate! This will help us live our lives, pay for infrastructure/testing hardware, and more @@ -20,8 +16,7 @@ Eden is free, open-source, copyleft software, licensed under the terms of the [G ### Policies -- No LLM or AI usage, *period*, for patches, pull requests, issues, comments, debugging, brainstorming, etc. - - For details on why, see the [detailed AI policy](docs/policies/AI.md). +- We are trialing a slightly relaxed AI policy to allow high-quality contributors to use AI *responsibly*. Please read our [detailed AI policy](docs/policies/AI.md) for more info. - Usage of any form of profanity or otherwise unsavory language is generally discouraged. - This is primarily because it rarely helps to actually understand what's going on. - Remember that your comments should be focused and actually address what's happening. With very few exceptions, expletives are actively detrimental at best. diff --git a/docs/policies/AI.md b/docs/policies/AI.md index 554a805331..dd4b4a7fb2 100644 --- a/docs/policies/AI.md +++ b/docs/policies/AI.md @@ -1,65 +1,159 @@ # AI Policy -AI and LLM use is *strictly* prohibited within our codebase and surrounding community, including issues and comments. This includes using AI or LLMs to write docs/commit messages, debug issues, brainstorm ideas, research concepts, or search the codebase. +> [!WARNING] +> We are trialing a slightly relaxed AI policy to allow high-quality contributors to use AI *responsibly*. +> This policy is subject to change at any point in time, so check back frequently. +> +> This banner will be removed once we have finalized our revised policy. - [AI Policy](#ai-policy) - - [Low-quality code](#low-quality-code) - - [Licensing concerns](#licensing-concerns) - - [Vibe-coding](#vibe-coding) - - [Commit messages](#commit-messages) - - [Miscellaneous concerns](#miscellaneous-concerns) - - [Unacceptable Use Examples](#unacceptable-use-examples) - - [Addendum: Commit Messages](#addendum-commit-messages) + - [TL;DR](#tldr) + - [Definitions](#definitions) + - [Scope](#scope) + - [Introduction](#introduction) + - [Requirements](#requirements) + - [Sign-off, Authorship, and Copyright](#sign-off-authorship-and-copyright) + - [Permitted Usage](#permitted-usage) + - [Recommended Prior Discussion](#recommended-prior-discussion) + - [Forbidden Usage](#forbidden-usage) + - [Human Effort Denial of Service](#human-effort-denial-of-service) + - [Disclosure](#disclosure) + - [Codebase Ingestion](#codebase-ingestion) + - [Enforcement](#enforcement) + - [Addendum: AI Commit Messages](#addendum-ai-commit-messages) + - [References](#references) -## Low-quality code +## TL;DR -AI is notorious for producing low-quality code; be it: +AI-assisted contributions are welcome, provided you take responsibility for them. -- nonfunctional, -- verbose/inefficient, -- breaking other parts of the codebase, -- or writing/architecting in a completely different style +- You **must** disclose any AI or LLM usage in your pull request description *and* commit message. +- You **must** be able to explain, defend, and revise every line of code you submit. +- Commit messages, PR descriptions, issues, and comments **must** be written by you. Verbatim AI output is not acceptable. +- Undisclosed AI usage will result in your contribution being rejected. +- Low-quality contributions, disclosed or not, will be reworked or rejected. +- Spamming automated PRs, comments, or issues is treated as a Denial of Service (DoS) attack on our reviewers; see [Human Effort Denial of Service](#human-effort-denial-of-service). -All code, AI or not, is held under a **strict standard of excellence**. AI/LLM-generated code will fail this test 10 times out of 10. +## Definitions -## Licensing concerns +An *AI or LLM-based tool* is any piece of software that generates code, text, or other content through machine learning models. This includes, but is not limited to: chat assistants, agentic coding tools/harnesses, inline code completion suggestions you have accepted into the code, and AI-driven explanation/refactoring features. -This is an area of ongoing litigation, and as such, is still very iffy. For the time being, know that allowing AI to ingest the codebase may end up with its copyleft code regurgitated into incompatibly-licensed proprietary or permissive software. For you, this means to **not** feed code into LLMs. +For the purposes of this policy, basic deterministic/static development tools (such as clang-tidy, git, compilers, etc.) are not considered AI tools. -AI models may have also ingested AGPLv3 code, which is license-incompatible with our codebase. +Terms such as "substantially", "large-scale", "majority", and "low-quality" are intentionally left vague, and will be interpreted at the maintainers' discretion. When in doubt, ask first. -## Vibe-coding +## Scope -Just don't. If you're not going to put the effort in to understand every line of code you wrote, neither will we, and your patch or pull request will be ignored. +This policy applies to all code contributions, alongside issues and pull requests surrounding this codebase. This includes: -## Commit messages +- Commit messages +- PR descriptions +- Code review comments +- Issue/PR comments +- Patches submitted via e-mail -AI-generated commit messages are absolutely terrible, and your pull request or patch will immediately be rejected if you choose to do this. They are, quite simply, actively detrimental to our understanding of your changes, and if you're not willing to summarize the intent behind your changes, then we're not going to bother reading the code you wrote. +Areas that are not directly related to code--such as our surrounding communities--are not covered by the terms of this policy. Additionally, spelling/grammar checking via AI or LLM-based tools is not covered under this document. -Write concise, simple, and descriptive commit messages that actually convey the proper intent behind what your change is trying to do. +## Introduction -See the [Addendum](#addendum-commit-messages) for an instance of how bad AI models are at commit messages. +In the right hands, AI and LLM-based tools are incredibly useful for getting features and bugfixes out the door as fast as possible. At the same time, reviewer bandwidth is a scarce resource. We are therefore open to AI-assisted contributions, provided they are produced and disclosed properly. -## Miscellaneous concerns +The goal of this document is *not* to set arbitrary restrictions, but rather to keep our development healthy and stable, while still allowing contributors to use the tools they find helpful. A contribution must be worth more to the project than the time it takes to review it. -- While many environmental concerns about AI are typically blown out of proportion, it *is* a legitimate issue, and should be taken into account. -- Many people have significant concerns over the ethics of AI usage due to inhumane and predatory behavior by large AI companies, particularly Anthropic and OpenAI. This can technically be avoided through the usage of local LLMs. -- LLMs have a tendency to add unicode characters (such as the arrow → and the em-dash — symbols) to their output, which can make viewing code or documents harder on command-line editors and viewers. -- Dedicated coding models--namely Claude--also like to add a lot of comments to overexplain every individual line of code it produces. This actually makes it *harder* to understand the code! +Throughout this document, **must** and **must not** are inflexible, binding requirements. Refusal to follow these is treated as a violation of the terms outlined in this document. -## Unacceptable Use Examples +## Requirements -Here are a few examples of unacceptable use: +These apply to all contributions, whether AI-assisted or not. AI-assisted contributions also carry additional disclosure requirements as outlined in [Disclosure](#disclosure). -- Solving problems - - Slapping a few files and a "please fix bug XYZ" into an LLM is a recipe for disaster that will pretty much never work. -- Fully AI-generated code, aka "vibecoding" -- Writing code based on pseudo-instructions - - If you don't know how to write code, don't. If you've figured out the root cause (preferably without feeding random files into an LLM) and actively know what's going on, provide information to other developers or friends of yours who have knowledge of the language and/or the codebase. +1. *Disclosure*. Any and all usage of AI or LLM-based tools within any contribution **must** be explicitly marked and disclosed as appropriate. +2. *Responsibility*. The human submitter of any contribution is held wholly responsible for the accuracy, completeness, and intent of what is submitted. You **must** be able to explain, defend, and revise your code during review. +3. *Review*. All code **must** be thoroughly reviewed by the author before opening a PR or marking it ready for review. +4. *Testing*. All code changes **must** be tested directly by the human author. +5. *Quality*. All submitted code is held to a strict standard of excellence. Low-quality AI-generated content does not uphold this standard. +6. *Licensing*. All code **must** be compatible with the GPLv3 or later. You **must** warrant that you have the right to submit it under those terms, and that it was not copied from work published under an incompatible license. -## Addendum: Commit Messages +## Sign-off, Authorship, and Copyright -The patchset for pull request [#3422](https://git.eden-emu.dev/eden-emu/eden/pulls/3422) was fed into several LLMs to generate a commit message. One LLM produced the following: +AI agents **must not** add `Signed-off-by:` tags. The human submitter **must** sign off on all changes. + +Similarly, AI agents cannot hold authorship or copyright over code, and **must not** add `Co-authored-by:` or `Co-developed-by:` tags. The human submitter **must** author all changes. + +## Permitted Usage + +This is a non-exhaustive list of permitted uses of AI and LLM-based tools, provided they are disclosed properly. + +- Drafting issues and pull requests, provided the final text and submitted code are substantially your own. +- Debugging issues, bugs, glitches, and crashes, whether pre-existing or introduced by your own changes. +- Reviewing your own changes before submitting a PR. +- Research, brainstorming, and codebase searching/understanding. +- Applying tedious but not particularly large changes, such as mass-migrating specific classes to polyfills or abstractions. + +## Recommended Prior Discussion + +Some usage cases are not necessarily forbidden nor permitted. These should be discussed with maintainers in an issue or e-mail *before* submission. Maintainers and reviewers may also comment on this during the review/submission phase. + +- Generating boilerplate/scaffolding for new code. +- Writing unit tests. +- Large-scale refactors primarily driven by an AI agent. +- Any contribution where an AI agent or model was responsible for the majority of the implementation. + +## Forbidden Usage + +This is a non-exhaustive list of strictly forbidden uses of AI and LLM-based tools. + +- Vibecoding, or changes entirely authored by AI agents without human intervention or understanding. + - If you don't choose to put in the necessary effort to understand every line of code you submitted, neither will we. +- Fully AI-generated commit messages, PR descriptions, issues, or comments. See [Addendum: AI Commit Messages](#addendum-ai-commit-messages). +- Submission of AI-assisted work that is not disclosed per the [Disclosure](#disclosure) requirements. +- Low-quality submissions that fail to satisfy our standard of code excellence. +- Submitting secrets, credentials, private user data, or unpublished security reports to third-party AI services. + - This includes console keys, encryption material, and private vulnerability disclosures. +- Verbatim AI code reviews (e.g. Codex/Copilot reviews). + +## Human Effort Denial of Service + +Using automated tools and AI to submit PRs, issues, and comments that we have to carefully review and handle is considered a [Denial-of-service attack](https://en.wikipedia.org/wiki/Denial-of-service_attack) on our human effort. + +It takes very little effort on your side (an LLM prompt) to generate a large amount of effort on ours (careful and thorough code review). Please respect our time and don't do that. + +## Disclosure + +How you disclose AI usage is up to you. However, it **must** be explicit, easy to identify, and placed both within the commit message *and* the surrounding PR description. For patches submitted by e-mail, the cover letter counts as the PR description. We recommend an `Assisted-by:` footer: + +```txt +Assisted-by: () +``` + +For instance: + +```txt +Assisted-by: Claude Opus 5.5 (initial draft and code review) +``` + +Contributions without a commit message (e.g. issues/comments) should instead use a plain sentence in the text body such as `I used to help with `. PRs and commit messages may opt to use this format as well. + +Multi-commit series/squashes **must** maintain the trailer. Maintainers will handle this for merges to master, but you are responsible for ensuring the disclosure survives into the final commit/PR body of squashes within your branches. + +Regardless, what matters is that reviewers can tell *at a glance* where and how AI was involved in your contribution. + +## Codebase Ingestion + +Ingestion of this codebase by LLMs for any purpose--such as training or prompt context--is permitted *for now*. This may change at any point as litigation and court rulings around AI and code copyright proceed. + +AI models may have ingested AGPLv3 or otherwise copyleft-incompatible code and may regurgitate it. You remain responsible for ensuring that all code you submit is compatible with the GPLv3 or later. + +## Enforcement + +- If we suspect undisclosed AI usage in a contribution, we will ask for disclosure. +- Refusal to provide disclosure will result in rejection of the contribution, and your PR or issue will be closed. Maintainers may choose to rework it themselves if the change is worth having. +- Accounts that spam us with repeated automated PRs or comments will be blocked or permanently suspended from our Git instance. +- Maintainers reserve the right to close your issues and pull requests if you don't follow the guidelines and procedures outlined in this document, and refuse or fail to make changes as necessary to comply. +- Repeated failures to comply may result in loss of contribution privileges. + +## Addendum: AI Commit Messages + +The patchset for pull request [#3422](https://git.eden-emu.dev/eden-emu/eden/pulls/3422) was fed into a dedicated code AI model, and it produced the following: ```txt profile_manager: Refactor user deletion to use index instead of UUID @@ -89,28 +183,21 @@ These changes eliminate redundant code, reduce the risk of UUID → index mismat Fixes: potential inconsistency when user order changes between UI and backend ``` -This is: +This: -- Needlessly verbose (nobody cares about most of these details) +- Is needlessly verbose (nobody cares about most of these details) - Doesn't address the actual purpose of the PR (fixing a double-deletion bug in the profile manager) - Has unicode arrows (this is bad for command-line editors) -- Uses corporate and word-salad language +- Uses corporate and word-salad language that pads out the message to make it look like a lot changed -Another (code-oriented) LLM output the following: +A good commit message should be concise, descriptive, and convey the *intent* behind the change, such as the bug being fixed or the feature being added. It should *not* be a detailed changelog of every individual byte that's changed. -```txt -profile(manager/ui): switch to index-based deletion and unify removal logic +## References -- Make ConfigureProfileManagerDeleteDialog emit a deleteUser(int) signal instead of taking a callback. Store the target index in the dialog (m_index) and emit it on acceptance. -- Change ConfigureProfileManager to pass an index to SetInfo and to accept an index in DeleteUser. Wire the dialog signal to the new DeleteUser slot. -- Update headers: add the signal and m_index, add TODO to move dialog to a .ui file, and update slot/signature declarations. -- Add ProfileManager::RemoveProfileAtIndex(std::size_t) and refactor RemoveUser(UUID) to call RemoveProfileAtIndex to avoid duplicated removal logic. Ensure the removal path marks saves as needed and writes the user save file. -- Ensure the profile list updates immediately after deletes by calling profile_manager.ResetUserSaveFile() when populating the user list (qlaunch fix). -- Misc: update SPDX copyright year and fix build breakages caused by the API changes. +This policy document has been adapted from the AI policies of numerous other free and open-source projects, whether restrictive or permissive. -This consolidates profile removal behavior, fixes potential race conditions in the profile dialog, and removes duplicated removal code. -``` - -This has all of the same problems as the other one. Needlessly verbose, doesn't address *what* it actually fixes ("consolidates profile removal behavior"... okay, why? What does it fix?), etc. It even has the bonus of totally hallucinating the addition of a method! - -On a more "philosophical" note, LLMs tend to be geared towards *corporate language*, as that's what they're trained on. This is why AI-generated commit messages feel like "word salad", and typically pad out the commit message to make it *look* like a lot of things were changed (trust me, it's like that in the corporate world). They typically also drift towards unneeded buzzwords and useless implementation details. +- [Gitea](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#ai-contribution-policy) +- The [Linux kernel](https://kernel.org/doc/html/next/process/coding-assistants.html) +- [Gentoo Linux](https://wiki.gentoo.org/wiki/Project:Council/AI_policy) +- [cURL](https://curl.se/dev/contribute.html#on-ai-use-in-curl) +- [FastAPI](https://tiangolo.com/open-source/contributing/#automated-code-and-ai)