diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.yml b/.github/ISSUE_TEMPLATE/01_bug_report.yml index 860a54c94a74..9677f6b7aa2e 100644 --- a/.github/ISSUE_TEMPLATE/01_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/01_bug_report.yml @@ -121,6 +121,8 @@ body: required: true - label: "I assert that I have read the [NixOS Code of Conduct](https://github.com/NixOS/.github/blob/master/CODE_OF_CONDUCT.md) and agree to abide by it." required: true + - label: "I assert that I have read the [automation/AI policy](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy) and that this issue report complies with it." + required: true - type: "markdown" attributes: value: | diff --git a/.github/ISSUE_TEMPLATE/02_bug_report_darwin.yml b/.github/ISSUE_TEMPLATE/02_bug_report_darwin.yml index 22ab5035ff6b..efdd09a02a5b 100644 --- a/.github/ISSUE_TEMPLATE/02_bug_report_darwin.yml +++ b/.github/ISSUE_TEMPLATE/02_bug_report_darwin.yml @@ -135,6 +135,8 @@ body: required: true - label: "I assert that I have read the [NixOS Code of Conduct](https://github.com/NixOS/.github/blob/master/CODE_OF_CONDUCT.md) and agree to abide by it." required: true + - label: "I assert that I have read the [automation/AI policy](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy) and that this issue report complies with it." + required: true - type: "markdown" attributes: value: | diff --git a/.github/ISSUE_TEMPLATE/03_bug_report_nixos.yml b/.github/ISSUE_TEMPLATE/03_bug_report_nixos.yml index 7922c4508455..41b10ea75e50 100644 --- a/.github/ISSUE_TEMPLATE/03_bug_report_nixos.yml +++ b/.github/ISSUE_TEMPLATE/03_bug_report_nixos.yml @@ -125,6 +125,8 @@ body: required: true - label: "I assert that I have read the [NixOS Code of Conduct](https://github.com/NixOS/.github/blob/master/CODE_OF_CONDUCT.md) and agree to abide by it." required: true + - label: "I assert that I have read the [automation/AI policy](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy) and that this issue report complies with it." + required: true - type: "markdown" attributes: value: | diff --git a/.github/ISSUE_TEMPLATE/04_build_failure.yml b/.github/ISSUE_TEMPLATE/04_build_failure.yml index 28aead4e1935..cd673601ea83 100644 --- a/.github/ISSUE_TEMPLATE/04_build_failure.yml +++ b/.github/ISSUE_TEMPLATE/04_build_failure.yml @@ -131,6 +131,8 @@ body: required: true - label: "I assert that I have read the [NixOS Code of Conduct](https://github.com/NixOS/.github/blob/master/CODE_OF_CONDUCT.md) and agree to abide by it." required: true + - label: "I assert that I have read the [automation/AI policy](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy) and that this issue report complies with it." + required: true - type: "markdown" attributes: value: | diff --git a/.github/ISSUE_TEMPLATE/05_update_request.yml b/.github/ISSUE_TEMPLATE/05_update_request.yml index f13338bea71c..21466ba01fb1 100644 --- a/.github/ISSUE_TEMPLATE/05_update_request.yml +++ b/.github/ISSUE_TEMPLATE/05_update_request.yml @@ -104,6 +104,8 @@ body: required: true - label: "I assert that I have read the [NixOS Code of Conduct](https://github.com/NixOS/.github/blob/master/CODE_OF_CONDUCT.md) and agree to abide by it." required: true + - label: "I assert that I have read the [automation/AI policy](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy) and that this issue report complies with it." + required: true - type: "markdown" attributes: value: | diff --git a/.github/ISSUE_TEMPLATE/06_module_request.yml b/.github/ISSUE_TEMPLATE/06_module_request.yml index 416d1166bec1..ce64b1c47517 100644 --- a/.github/ISSUE_TEMPLATE/06_module_request.yml +++ b/.github/ISSUE_TEMPLATE/06_module_request.yml @@ -79,6 +79,8 @@ body: required: true - label: "I assert that I have read the [NixOS Code of Conduct](https://github.com/NixOS/.github/blob/master/CODE_OF_CONDUCT.md) and agree to abide by it." required: true + - label: "I assert that I have read the [automation/AI policy](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy) and that this issue report complies with it." + required: true - type: "markdown" attributes: value: | diff --git a/.github/ISSUE_TEMPLATE/07_backport_request.yml b/.github/ISSUE_TEMPLATE/07_backport_request.yml index c03306938a22..767d25176634 100644 --- a/.github/ISSUE_TEMPLATE/07_backport_request.yml +++ b/.github/ISSUE_TEMPLATE/07_backport_request.yml @@ -85,6 +85,8 @@ body: required: true - label: "I assert that I have read the [NixOS Code of Conduct](https://github.com/NixOS/.github/blob/master/CODE_OF_CONDUCT.md) and agree to abide by it." required: true + - label: "I assert that I have read the [automation/AI policy](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy) and that this issue report complies with it." + required: true - type: "markdown" attributes: value: | diff --git a/.github/ISSUE_TEMPLATE/08_documentation_request.yml b/.github/ISSUE_TEMPLATE/08_documentation_request.yml index 0fc240e64cd5..608a4ba4da84 100644 --- a/.github/ISSUE_TEMPLATE/08_documentation_request.yml +++ b/.github/ISSUE_TEMPLATE/08_documentation_request.yml @@ -67,6 +67,8 @@ body: required: true - label: "I assert that I have read the [NixOS Code of Conduct](https://github.com/NixOS/.github/blob/master/CODE_OF_CONDUCT.md) and agree to abide by it." required: true + - label: "I assert that I have read the [automation/AI policy](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy) and that this issue report complies with it." + required: true - type: "markdown" attributes: value: | diff --git a/.github/ISSUE_TEMPLATE/09_unreproducible_package.yml b/.github/ISSUE_TEMPLATE/09_unreproducible_package.yml index 658223e75465..e29a11380acb 100644 --- a/.github/ISSUE_TEMPLATE/09_unreproducible_package.yml +++ b/.github/ISSUE_TEMPLATE/09_unreproducible_package.yml @@ -137,6 +137,8 @@ body: required: true - label: "I assert that I have read the [NixOS Code of Conduct](https://github.com/NixOS/.github/blob/master/CODE_OF_CONDUCT.md) and agree to abide by it." required: true + - label: "I assert that I have read the [automation/AI policy](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy) and that this issue report complies with it." + required: true - type: "markdown" attributes: value: | diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 45a55eb45dce..8f2c6648efe4 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -27,12 +27,14 @@ For new packages please briefly describe the package or provide a link to its ho - [ ] Module addition: when adding a new NixOS module. - [ ] Module update: when the change is significant. - [ ] Fits [CONTRIBUTING.md], [pkgs/README.md], [maintainers/README.md] and other READMEs. +- [ ] Follows the [automation/AI policy]. [NixOS tests]: https://nixos.org/manual/nixos/unstable/index.html#sec-nixos-tests [Package tests]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#package-tests [nixpkgs-review usage]: https://github.com/Mic92/nixpkgs-review#usage [CONTRIBUTING.md]: https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md +[automation/AI policy]: https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy [lib/tests]: https://github.com/NixOS/nixpkgs/blob/master/lib/tests [maintainers/README.md]: https://github.com/NixOS/nixpkgs/blob/master/maintainers/README.md [nixos/tests]: https://github.com/NixOS/nixpkgs/blob/master/nixos/tests diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9d2b42e194d2..3fd9c4234f36 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -206,7 +206,7 @@ For example, if you make a change to `texlive`, you probably would only check th #### Meets Nixpkgs contribution standards -The last checkbox is about whether it fits the guidelines in this `CONTRIBUTING.md` file. +The last two checkboxes are about whether it fits the guidelines in this `CONTRIBUTING.md` file. This document details our standards for commit messages, reviews, licensing of contributions, etc... Everyone should read and understand these standards before submitting a pull request. @@ -888,3 +888,77 @@ As mentioned previously, it is unfortunately perfectly normal for a PR to sit ar Please don't blow up situations where progress is happening but is merely not going fast enough for your tastes. Honking in a traffic jam will not make you go any faster. + +# Automation/AI policy + +Every contribution to Nixpkgs and related development venues, including code, documentation, and communication on GitHub and Matrix, must have a **responsible person in the loop** who is accountable for that contribution and reviews it before submission, and must **transparently disclose** any non‐trivial use of automation to produce it, including but not limited to LLM‐based AI tools. + +The following sections give more detail. + +## Scope + +Any use of automated tools to generate non‐trivial amounts of output as part of a contribution, in whole or in part, verbatim or edited, is covered by this policy, except as listed in the Exemptions section. +Both LLM‐based AI tools and hand‐written automation are covered. +Contributions include code and documentation in commits, commit messages, pull request summaries and reviews, issue and vulnerability reports, GitHub comments, Matrix messages, and Discourse posts. +The covered venues are the GitHub repositories for Nixpkgs and [related projects](https://github.com/orgs/NixOS/teams/nixpkgs-core/repositories) under the jurisdiction of the Nixpkgs core team, Matrix rooms that are focused on development of those projects, and Discourse topics about Nixpkgs development. + +## Accountability + +Everyone who submits a contribution to Nixpkgs is responsible for it, regardless of the use of automated tooling. +Before submission, they must establish a reasonable level of understanding of the contribution and expectation of its correctness. +A contributor submitting a contribution intended for inclusion in Nixpkgs is also responsible for ensuring that it is [appropriately licensed](https://github.com/NixOS/nixpkgs/blob/master/COPYING) and credited, and not encumbered by any incompatible copyright. + +When output from automated tooling is used in contributions, a contributor must establish confidence in that output. +This can be achieved by establishing confidence in the correctness of the tooling’s logic, manual review of the included output, or using further automation to verify the output (e.g. programmatically checking whether a refactor avoids causing rebuilds). +As the inner workings of LLM‐based AI tools cannot be sufficiently understood at present, only the latter two options are available when those are used; vibe coding without review is not permitted. +When automation is used to verify output, the verification tooling itself must be disclosed and reviewed in line with this policy. + +This policy applies equally to any further discussion of a contribution. +Comments and reviews must separately satisfy the same requirements of understanding, review, and disclosure. +Contributors are expected to be able to answer questions about their contribution and respond to feedback appropriately, without simply forwarding messages back and forth to automated tools. + +It is not permitted to submit automated contributions without any manual review or intervention, outside of standard community automation. +Automation without any manual review must not be used as the sole arbiter of whether to merge a change. + +## Transparency + +All covered use of automated tooling for a contribution must be disclosed as part of that contribution. + +In the case of LLM‐based AI tooling used for commits, this **must** be in the form of an `Assisted-by:` Git commit trailer, including at least the tool name and the primary model name and version used for the contribution. +A `Co-authored-by:` trailer does not satisfy this policy. + +Any adequate form of disclosure is permitted for other kinds of tooling and contribution. +Pull request summaries and review comments must be disclosed separately to commits. + +## Exemptions + +The following situations are fully or partially exempt: + +* Use of standard deterministic editor/IDE/formatter/text transformation tooling to produce changes that the author manually reviews and understands is exempt, including inline “auto‐completion” (even if LLM‐based) of short, rote snippets of text that do not contribute anything beyond boilerplate the author would have written anyway. + +* Use of standard community automation is exempt, such as `nix-update`, the official Nixpkgs CI bots, the @r-ryantm update bot, other maintainer‐approved bots that run update scripts, and the Nixpkgs security tracker bot. + +* Use of AI tools for research, testing, debugging, or private review is out of scope, if no substantial amount of their output is included in the resulting contribution. + However, if these tools had a significant technical influence on your contribution, you are still responsible for it per the Accountability section, and are expected to disclose this where relevant. + +* Use of machine translation is exempt from the requirement to understand the translated output. + However, the requirements of appropriate confidence in the original text, responsibility, and disclosure still apply, and you are encouraged to additionally include the original untranslated contribution. + +* Use of automation in a contribution clearly marked as not being ready for merge (e.g. a draft pull request) is exempt from the requirement for full self‐review, as long as some amount of review has been done and it is expected that the requirements will be met by the time it is marked as ready. + This does not waive any other requirement. + +* Use of automated tools to develop upstream software packaged inside Nixpkgs is not in scope. + +## Enforcement + +If you believe that someone is using automation without appropriate disclosure and review, you can politely ask them if that’s the case and point them to this policy as appropriate. +Please assume good faith and remain civil; it’s not always possible to determine, and it is more likely that someone overlooked this policy than deliberately violated it. +If you think someone is continuing to break the policy after this, please escalate to the [Nixpkgs core team](https://nixos.org/community/teams/nixpkgs-core/) rather than fighting over it. + +If a contribution is clearly in violation of the policy (e.g. the contributor admits it was not followed, or there are AI tool attributions that do not meet our required format), it can be closed or hidden, preferably after informing the contributor of the policy and giving them a chance to address the violations. +Deliberate violations of this policy are considered to break the [Code of Conduct](https://github.com/NixOS/.github/blob/master/CODE_OF_CONDUCT.md) clause against “Wasting other people’s time with low quality contributions, including but not limited to LLM and bot spam”. +Repeated violations are grounds for further moderation action. + +## Credits + +This policy takes inspiration from similar policies in [LLVM](https://llvm.org/docs/AIToolPolicy.html), [Mesa](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.1.0-rc1/docs/submittingpatches.rst?ref_type=tags), [Fedora](https://docs.fedoraproject.org/en-US/council/policy/ai-contribution-policy/), and the [Linux kernel](https://docs.kernel.org/7.0/process/coding-assistants.html), along with [a proposal by the author of Anubis](https://xeiaso.net/notes/2025/assisted-by-footer/).