|
| 1 | +<!--- |
| 2 | + Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + or more contributor license agreements. See the NOTICE file |
| 4 | + distributed with this work for additional information |
| 5 | + regarding copyright ownership. The ASF licenses this file |
| 6 | + to you under the Apache License, Version 2.0 (the |
| 7 | + "License"); you may not use this file except in compliance |
| 8 | + with the License. You may obtain a copy of the License at |
| 9 | +
|
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +
|
| 12 | + Unless required by applicable law or agreed to in writing, |
| 13 | + software distributed under the License is distributed on an |
| 14 | + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + KIND, either express or implied. See the License for the |
| 16 | + specific language governing permissions and limitations |
| 17 | + under the License. |
| 18 | +--> |
| 19 | + |
| 20 | +# AI Policy |
| 21 | + |
| 22 | +DataFusion has the following policy for AI-assisted PRs: |
| 23 | + |
| 24 | +- We welcome AI-assisted PRs from anyone. We do not welcome unreviewed "AI |
| 25 | + dumps" (defined below). |
| 26 | +- The PR author should have personally read the entire PR they submit and |
| 27 | + **understand the core ideas end-to-end**. Authors should be ready to justify |
| 28 | + and help reviewers understand the design and code during review. |
| 29 | +- **Call out unknowns and assumptions**. It's okay to not fully understand |
| 30 | + some bits of AI-generated code. Please point these cases out so we can work |
| 31 | + together to clear up any concerns. |
| 32 | +- **Follow [ASF Generative Tooling Guidance]**. Among other things, |
| 33 | + the author must ensure the PR does not include undisclosed third-party |
| 34 | + code or copyrighted material. |
| 35 | + |
| 36 | +[asf generative tooling guidance]: https://www.apache.org/legal/generative-tooling.html |
| 37 | + |
| 38 | +While "understand the core ideas" is partly subjective, it means more than being |
| 39 | +able to follow the diff textually. We expect the PR author to take an active |
| 40 | +role in responding to feedback and crafting the PR to make sure it fits well |
| 41 | +into the project as a whole. The worst situation is one where the reviewer ends |
| 42 | +up simply driving the contributor's LLM, for the reasons described in the next |
| 43 | +section. |
| 44 | + |
| 45 | +## What is an "AI dump" and why it is not helpful |
| 46 | + |
| 47 | +An "AI dump" is a PR, or a series of PRs, consisting largely of AI-generated |
| 48 | +code and descriptions that the author has not reviewed and does not understand. |
| 49 | +The code may even be correct. The problem is that all the work of understanding |
| 50 | +falls on the reviewer. |
| 51 | + |
| 52 | +Code review serves two purposes: |
| 53 | + |
| 54 | +1. Finishing the intended task. |
| 55 | +2. Sharing knowledge between authors and reviewers, as a long-term investment in |
| 56 | + the project. For this reason, even if someone familiar with the codebase |
| 57 | + could finish a task more quickly by themselves, we are still happy to help |
| 58 | + a new contributor work on it. |
| 59 | + |
| 60 | +An AI dump meets neither purpose. Maintainers could finish the task faster by |
| 61 | +running the AI tool themselves, and an author who acts only as a pass-through |
| 62 | +proxy for the tool learns little from the review. |
| 63 | + |
| 64 | +Reviewing capacity for the project is **very limited**, so PRs that appear to be |
| 65 | +AI dumps may not get reviewed, and may eventually be closed. |
| 66 | + |
| 67 | +Multiple PRs created in a short amount of time, especially by a first-time |
| 68 | +contributor, that in our judgment show a lack of understanding or author |
| 69 | +engagement may be treated as spam and closed. One high-quality PR that you work |
| 70 | +with maintainers to merge is far more valuable to you and the project than ten |
| 71 | +PRs you have your agent generate and submit for you. |
| 72 | + |
| 73 | +## Responding to review comments |
| 74 | + |
| 75 | +The same policy applies to review discussion as to the code itself: reviewers |
| 76 | +want to talk to **you**, not to your AI tool. Please do not respond to reviewer |
| 77 | +comments with unreviewed, fully AI-generated responses, as this again puts all |
| 78 | +the burden on the reviewer and you learn nothing. We expect your responses to be |
| 79 | +in your own words, though it is fine to use AI to help prepare your response |
| 80 | +(for example to understand the comment, or help translate your response to |
| 81 | +English). Examples of unreviewed AI-generated replies: |
| 82 | + |
| 83 | +- Summarizes the diff rather than answering the question that was asked. |
| 84 | +- Lists the commands run locally (e.g. `cargo fmt`, `cargo test`) |
| 85 | + and whether they passed. This is not useful to reviewers because CI already runs |
| 86 | + these checks. |
| 87 | +- Contains statements that don't make sense in context, such as claiming |
| 88 | + tests could not be run because `cargo` is not installed. |
| 89 | + |
| 90 | +For example, see [this review thread in arrow-rs][arrow-rs-review-example] where |
| 91 | +the reviewer asked a design question, and received several replies that |
| 92 | +described what had changed and which commands had been run, rather than an |
| 93 | +answer to the question. |
| 94 | + |
| 95 | +Again, the point of code review is to help the project **and** to help you grow |
| 96 | +as an engineer, so please read each comment, make sure you understand it, and |
| 97 | +reply in your own words. |
| 98 | + |
| 99 | +[arrow-rs-review-example]: https://github.com/apache/arrow-rs/pull/11209#discussion_r4145512124 |
| 100 | + |
| 101 | +## AI-assisted reviews |
| 102 | + |
| 103 | +The same standard applies to AI-generated reviews as to AI-generated code: you |
| 104 | +should have read and understood anything you post. Raw AI review output is often |
| 105 | +verbose with unnecessary details, and it can take substantial effort to figure |
| 106 | +out what is actually being asked. |
| 107 | + |
| 108 | +If you review PRs with the help of an AI tool, read all comments first, remove |
| 109 | +detail that is unnecessary or you don't understand, and explain the rest in your |
| 110 | +own words so that each comment makes a clear, specific request. |
| 111 | + |
| 112 | +## Better ways to contribute than an "AI dump" |
| 113 | + |
| 114 | +It's recommended to write a high-quality issue with a clear problem statement |
| 115 | +and a minimal, reproducible example. The reproducer should focus on the |
| 116 | +end-user-visible behavior rather than explaining the details of some code |
| 117 | +defect. |
| 118 | + |
| 119 | +This will make it easier for others to contribute and for reviewers to |
| 120 | +understand the problem being addressed. |
0 commit comments