|
| 1 | +<!--- This file has been generated from an external template. Please do not modify it directly. --> |
| 2 | +<!--- Changes should be contributed to https://github.com/munich-quantum-toolkit/templates. --> |
| 3 | + |
| 4 | +# AI Usage Guidelines |
| 5 | + |
| 6 | +We acknowledge that AI tools (Large Language Models, code completion engines like GitHub Copilot, etc.) have become helpful assistants for many developers. |
| 7 | +We allow the use of these tools to assist with contributions, provided that their use is transparent, responsible, and that a **human remains in the loop** at all times. |
| 8 | + |
| 9 | +This guide outlines our policy on AI-assisted contributions to ensure code quality, maintainability, and legal compliance. |
| 10 | + |
| 11 | +## Core Principles |
| 12 | + |
| 13 | +### 1. You are Responsible |
| 14 | + |
| 15 | +**You are responsible for every line of code you submit.** |
| 16 | + |
| 17 | +Regardless of whether code was written by you or generated by an AI tool, you are the author and are fully accountable for the contribution. You must: |
| 18 | + |
| 19 | +- Fully understand the code you are submitting. |
| 20 | +- Be able to explain the reasoning behind the code and how it interacts with the rest of the codebase. |
| 21 | +- Verify that the code is correct, efficient, and follows our coding standards. |
| 22 | + |
| 23 | +**Do not blindly copy-paste AI-generated code.** If you cannot explain it, do not submit it. |
| 24 | + |
| 25 | +### 2. Human in the Loop |
| 26 | + |
| 27 | +> **Autonomous contributions from AI agents are not allowed.** |
| 28 | +
|
| 29 | +When using AI tools, you must be the driver. |
| 30 | +The AI is the assistant. |
| 31 | + |
| 32 | +- **Review:** You must read and review all AI-generated code or text before submitting it. |
| 33 | +- **Edit:** AI-generated code often requires significant editing to meet project standards and correctness. |
| 34 | +- **Verify:** Ensure the code actually solves the problem and doesn't introduce subtle bugs or security vulnerabilities. |
| 35 | + |
| 36 | +### 3. Communication |
| 37 | + |
| 38 | +**Do not use AI tools to generate issue descriptions, pull request comments, or code reviews.** |
| 39 | + |
| 40 | +We value your personal input and communication. |
| 41 | +LLMs are notoriously unreliable and can produce "smart-sounding" but incorrect or irrelevant claims ("hallucinations"). |
| 42 | +Phrase your communications in your own words. |
| 43 | +It is more important that we can follow your reasoning than that the text sounds "perfect". |
| 44 | + |
| 45 | +### 4. Transparency and Disclosure |
| 46 | + |
| 47 | +Transparency helps the community understand the role of these tools and develop best practices. |
| 48 | + |
| 49 | +**We encourage you to disclose any AI assistance.** |
| 50 | +This helps us understand how these tools are being used and identify potential issues. |
| 51 | +You can disclose this information in the following ways: |
| 52 | + |
| 53 | +- **Commit Messages**: Add a trailer to your commit message in the form `Assisted-by: [Model Name] via [Tool Name]` (example: `Assisted-by: Claude Sonnet 4.6 via GitHub Copilot`) |
| 54 | +- **PR Description**: Mention the tool (name and version) and how it was used in the PR description. |
| 55 | + |
| 56 | +### 5. Licensing and Copyright |
| 57 | + |
| 58 | +You are responsible for ensuring that your contribution does not violate any third-party licenses or copyrights. |
| 59 | + |
| 60 | +- **Originality**: Your submission must be your own original work of authorship. |
| 61 | +- **Training Data**: Be aware that some AI tools may generate code that is substantially similar to their training data. You must ensure that you have the right to contribute the generated code under [our license](https://github.com/munich-quantum-toolkit/qcec/blob/main/LICENSE.md). |
| 62 | + |
| 63 | +## Extractive Contributions |
| 64 | + |
| 65 | +Processing pull requests and comments for MQT QCEC requires significant maintainer time and energy. |
| 66 | +Sending unreviewed AI output to open-source projects shifts the burden of verifying correctness from the contributor to the maintainer. |
| 67 | +We classify such contributions as "extractive" because they consume more community resources than they provide in value. |
| 68 | + |
| 69 | +Our **golden rule** is that a contribution should be valuable enough to justify the review effort. |
| 70 | +Nadia Eghbal captures this concept in her book _[Working in Public](https://press.stripe.com/working-in-public)_: |
| 71 | + |
| 72 | +> "When attention is being appropriated, producers need to weigh the costs and benefits of the transaction. To assess whether the appropriation of attention is net-positive, it's useful to distinguish between _extractive_ and _non-extractive_ contributions. Extractive contributions are those where the marginal cost of reviewing and merging that contribution is greater than the marginal benefit to the project's producers. In the case of a code contribution, it might be a pull request that's too complex or unwieldy to review, given the potential upside." — Nadia Eghbal |
| 73 | +
|
| 74 | +Before AI tools became widespread, open-source project maintainers would often review all changes sent to the project simply because submitting a pull request was a sign of interest from a potential long-term contributor. |
| 75 | +However, AI tools now allow the rapid generation of large volumes of code, which can easily overwhelm maintainers if submitted without careful review. |
| 76 | +Our policy exists to ensure that maintainer time is spent on high-quality interactions rather than debugging AI-generated code. |
| 77 | + |
| 78 | +### Sustainable Open Source |
| 79 | + |
| 80 | +The Munich Quantum Toolkit (MQT) is committed to remaining free, open-source, and permissively licensed. |
| 81 | +We want to build a welcoming community where aspiring quantum software engineers can learn and grow. |
| 82 | +Reviewing contributions is a key part of this mentorship. |
| 83 | + |
| 84 | +However, to keep the project sustainable, we must prioritize non-extractive contributions. |
| 85 | +By thoroughly reviewing and understanding your AI-assisted code before submission, you ensure that your contribution is a net positive for the project. |
| 86 | +This helps us maintain a healthy ecosystem where both the software and its contributors can thrive. |
| 87 | + |
| 88 | +## Prohibited Uses |
| 89 | + |
| 90 | +- **"Good First Issues"**: Do not use AI tools to solve issues labeled as "good first issue". These are intended as learning opportunities for new contributors. Automating them defeats the purpose. |
| 91 | +- **Spam**: Do not use AI to generate low-quality or repetitive comments/reviews ("AI Slop"). |
| 92 | +- **Unreviewed Code**: Submitting code that you, as a human, have not reviewed and tested yourself. |
| 93 | + |
| 94 | +## Summary |
| 95 | + |
| 96 | +We want to foster a welcoming community where developers can learn and grow. AI tools can be great for productivity, but they should not replace critical thinking or the learning process. |
| 97 | +If a maintainer judges that a contribution relies too heavily on unverified AI generation or lacks sufficient human understanding ("extractive contribution"), we may request that you revise it or close the PR. |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +Parts of this guide were inspired by or adapted from the contribution guidelines of |
| 102 | + |
| 103 | +- [Astral], |
| 104 | +- [Qiskit], |
| 105 | +- [LLVM], including the sources therein, such as [Fedora Council Policy Proposal: Policy on AI-Assisted Contributions (fetched 2026-03-12)][fedora], which is licensed under the [Creative Commons Attribution 4.0 International License][cca]. |
| 106 | + |
| 107 | +with the help of Gemini 3 Pro (Preview). The links above serve as attribution. |
| 108 | + |
| 109 | +[Astral]: https://github.com/astral-sh/uv/blob/c89a78ec085077f6344b0439ddf07fdad7336310/CONTRIBUTING.md |
| 110 | +[Qiskit]: https://github.com/Qiskit/qiskit/blob/cd8701690723d3d9602fac63fe0bd7ea618799be/CONTRIBUTING.md#use-of-ai-tools |
| 111 | +[LLVM]: https://github.com/llvm/llvm-project/blob/9b6391f9c439c9926e8587b7b940e9a1e98a7819/llvm/docs/AIToolPolicy.md |
| 112 | +[fedora]: https://communityblog.fedoraproject.org/council-policy-proposal-policy-on-ai-assisted-contributions/ |
| 113 | +[cca]: https://creativecommons.org/licenses/by/4.0/ |
0 commit comments