diff --git a/AI_CONTRIBUTION_POLICY.md b/AI_CONTRIBUTION_POLICY.md new file mode 100644 index 00000000..f026690f --- /dev/null +++ b/AI_CONTRIBUTION_POLICY.md @@ -0,0 +1,52 @@ +# AI contribution policy + +At Pruna, we very much welcome any contributions from the community. However, we want to ensure they are high quality and aligned with our guidelines. To ensure AI-assisted contributions remain high quality, reviewable, and aligned with project standards,, we have created this AI contribution policy. Please read it carefully before contributing. + +> Greatly inspired by [CodeCarbon's AI policy](https://docs.codecarbon.io/latest/contributing/AI_POLICY/). + +## 1. Core Philosophy + +Pruna accepts AI-assisted code (e.g., using Copilot, Cursor, etc.), but strictly rejects AI-generated contributions where the submitter acts merely as a proxy. The human contributor remains fully responsible for every submitted change.. + +> **Accountability lies with the human contributor, not the AI agent** + +Coding agents (e.g., Copilot, Claude Code) are not conscious entities and cannot be held accountable for their outputs. They can produce code that looks correct and plausible but contains subtle bugs, security vulnerabilities, or design flaws. So, contributors are responsible for catching these issues. The following rules ensure that all contributions are carefully vetted and that there is a human submitter behind the agent, taking full responsibility for the submitted code. + +## 2. The Laws of Contribution + +### Law 1: Proof of Verification + +AI tools frequently write code that looks correct but fails execution. Therefore, "vibe checks" are insufficient. + +**Requirement:** Every PR introducing functional changes must be carefully tested locally by the human contributor before submission , and all CI checks must pass. + +### Law 2: The Hallucination & Redundancy Ban + +AI models often hallucinate comments or reinvent existing utilities. + +**Requirement:** You must use existing project utilities and avoid introducing redundant helpers when an appropriate implementation already exists. + +**Failure Conditions:** + +- Creating new helper functions when a Pruna equivalent exists is grounds for immediate rejection. +- "Ghost Comments" (comments explaining logic that was deleted or doesn't exist) may be asked to revise or justify. Unnecessary comments are not allowed. Example: "This function returns the input". + +### Law 3: The "Explain It" Standard + +**Requirement:** If a maintainer or reviewer asks during code review, you need to be able to explain the logic of any submitted change. + +**Failure Condition:** + +- Answering a review question with "That's what the AI outputted" or "I don't know, it works" may lead to the PR being closed. + +### Law 4: Transparency in AI Usage Disclosure + +**Requirement:** If a non-trivial portion of this PR was generated or substantially shaped by AI tools, the PR must be marked as "AI-assisted". Trivial autocomplete, formatting, or minor line completions do not require disclosure. + +**Failure Condition:** + +- Lack of transparency about AI tool usage may result in PR closure, especially if the code contains fabricated or inaccurate code/comments or cannot be explained during review. + +## Additional Resources + +For comprehensive guidance on contributing to Pruna, including development workflows, code quality standards, testing practices, and AI-assisted development best practices, see the [CONTRIBUTING.md](CONTRIBUTING.md). \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b9527856..a92b277c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,9 +3,8 @@ Since you landed on this part of the repository, we want to first of all say thank you! 💜 Contributions from the community are essential to improving Pruna, we appreciate your effort in making the repository better for everyone! -Please make sure to review and adhere to the [Pruna Code of Conduct](https://github.com/PrunaAI/pruna/blob/main/CODE_OF_CONDUCT.md) before contributing to Pruna. -Any violations will be handled accordingly and result in a ban from the Pruna community and associated platforms. -Contributions that do not adhere to the code of conduct will be ignored. +Please make sure to review and adhere to the [Pruna Code of Conduct](https://github.com/PrunaAI/pruna/blob/main/CODE_OF_CONDUCT.md) and [AI Contribution Policy](https://github.com/PrunaAI/pruna/blob/main/AI_CONTRIBUTION_POLICY.md) before contributing to Pruna. +Contributions that do not adhere to the code of conduct or AI contribution policy will be ignored. There are various ways you can contribute: diff --git a/docs/contributions/how_to_contribute.rst b/docs/contributions/how_to_contribute.rst index 259439e5..a61f83d3 100644 --- a/docs/contributions/how_to_contribute.rst +++ b/docs/contributions/how_to_contribute.rst @@ -7,9 +7,9 @@ How to Contribute ? 💜 Since you landed on this part of the documentation, we want to first of all say thank you! 💜 Contributions from the community are essential to improving |pruna|, we appreciate your effort in making the repository better for everyone! -Please make sure to review and adhere to the `Pruna Code of Conduct `_ before contributing to Pruna. -Any violations will be handled accordingly and result in a ban from the Pruna community and associated platforms. -Contributions that do not adhere to the code of conduct will be ignored. +Please make sure to review and adhere to the `Pruna Code of Conduct `_ +and `AI Contribution Policy `_ before contributing to Pruna. +Contributions that do not adhere to the code of conduct or AI contribution policy will be ignored. If you don't have uv installed, you can install it by following the instructions on the `uv website `_.