|
| 1 | +# Guidance on AI coding tools |
| 2 | + |
| 3 | +<!-- |
| 4 | +Part of the Carbon Language project, under the Apache License v2.0 with LLVM |
| 5 | +Exceptions. See /LICENSE for license information. |
| 6 | +SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 7 | +--> |
| 8 | + |
| 9 | +[Pull request](https://github.com/carbon-language/carbon-lang/pull/5670) |
| 10 | + |
| 11 | +<!-- toc --> |
| 12 | + |
| 13 | +## Table of contents |
| 14 | + |
| 15 | +- [Abstract](#abstract) |
| 16 | +- [Problem](#problem) |
| 17 | +- [Background](#background) |
| 18 | +- [Proposal](#proposal) |
| 19 | +- [Rationale](#rationale) |
| 20 | +- [Alternatives considered](#alternatives-considered) |
| 21 | + - [Place more restrictions around AI-based tool usage when contributing](#place-more-restrictions-around-ai-based-tool-usage-when-contributing) |
| 22 | + |
| 23 | +<!-- tocstop --> |
| 24 | + |
| 25 | +## Abstract |
| 26 | + |
| 27 | +Establish some guidance on using AI coding tools when contributing to the Carbon |
| 28 | +Language project. These tools have growing popularity and interest, and it would |
| 29 | +be good to have a clear and actively documented set of guidance for folks |
| 30 | +interested or already using them. |
| 31 | + |
| 32 | +## Problem |
| 33 | + |
| 34 | +AI-based coding tools are wildly popular at this point and we should have active |
| 35 | +guidance about how and when to use them when contributing to Carbon rather than |
| 36 | +being reactive. |
| 37 | + |
| 38 | +## Background |
| 39 | + |
| 40 | +- [LLVM Developer Policy guidance on AI generated code](https://llvm.org/docs/DeveloperPolicy.html#ai-generated-contributions) |
| 41 | + |
| 42 | +## Proposal |
| 43 | + |
| 44 | +All submissions to Carbon need to follow our Contributor License Agreement |
| 45 | +(CLA), in which contributors agree that their contribution is an original work |
| 46 | +of authorship. This doesn’t prohibit the use of coding assistance tools, but |
| 47 | +what’s submitted does need to be a contributor’s original creation. |
| 48 | + |
| 49 | +Carbon's license was also selected specifically to maintain full compatibility |
| 50 | +between any contributions to Carbon and contributions to LLVM so that we can |
| 51 | +potentially move things between these projects easily. We want the same to be |
| 52 | +true regarding the use of AI-based coding tools, and so any contributions to |
| 53 | +Carbon should also abide by the guidance in the |
| 54 | +[LLVM Developer Policy around AI generated code](https://llvm.org/docs/DeveloperPolicy.html#ai-generated-contributions) |
| 55 | + |
| 56 | +This proposal updates our contributing documentation to contain both these |
| 57 | +points. |
| 58 | + |
| 59 | +## Rationale |
| 60 | + |
| 61 | +- [Community and culture](/docs/project/goals.md#community-and-culture) |
| 62 | + - Explicitly documenting what is and isn't required when contributing to |
| 63 | + Carbon makes the project more open and welcoming to new contributors. |
| 64 | + |
| 65 | +## Alternatives considered |
| 66 | + |
| 67 | +### Place more restrictions around AI-based tool usage when contributing |
| 68 | + |
| 69 | +We could consider adopting more restrictions on how AI-based tools can be used |
| 70 | +as part of contributing to Carbon. However, at this point we don't have a |
| 71 | +compelling rationale for this. |
| 72 | + |
| 73 | +There are real concerns around the quality of code output from AI-based tools in |
| 74 | +some cases. However, we should not rely on avoiding the tools to provide |
| 75 | +protection from low-quality code. Instead, as we already do, we have a system of |
| 76 | +code review, coding standards, and extensive testing to ensure high-quality |
| 77 | +contributions regardless of the tools used. **The quality, correctness, and |
| 78 | +utility expectations of contributions are true regardless of which tools are |
| 79 | +used as part of authoring the contribution.** |
| 80 | + |
| 81 | +We have also seen abuse where large volumes of automatically generated |
| 82 | +"contributions" have been sent to projects, overwhelming their community. Again, |
| 83 | +this is never OK, regardless of which tools are used to achieve it. We hold the |
| 84 | +contributors responsible for using any and all tools responsibly and making |
| 85 | +useful and constructive contributions with them. |
| 86 | + |
| 87 | +Last but not least, we also understand that there may contributors who do not |
| 88 | +wish to use these tools. Currently, we are not proposing any tools in the |
| 89 | +required workflow of the project. |
0 commit comments