[RFC PATCH v3 0/4] docs/devel, AGENTS.md: a completely new policy on AI-generated contributions

Paolo Bonzini posted 4 patches 5 days, 11 hours ago
docs/devel/code-provenance.rst |  71 +-----------
docs/devel/index-process.rst   |   1 +
docs/devel/llm-usage.rst       | 202 +++++++++++++++++++++++++++++++++
AGENTS.md                      | 137 +++++++++++++++++++---
scripts/checkpatch.pl          |   5 +-
5 files changed, 336 insertions(+), 80 deletions(-)
create mode 100644 docs/devel/llm-usage.rst
[RFC PATCH v3 0/4] docs/devel, AGENTS.md: a completely new policy on AI-generated contributions
Posted by Paolo Bonzini 5 days, 11 hours ago
WARNING: this is *intentionally* a full U-turn from the previous policy
and discussions.  This is not a refusal of the arguments presented in
those discussions.  Also, it is still a request for comments.

I've explained in v2 my reason to "try something else".  On one hand
attempting to introduce small carve-outs did not work due the impossibility
of reaching a widespread consensus on this topic.  On the other hand,
some contributors have been posting AI-generated patches or even larger
series, most likely in good faith as they predated the introduction
of an AGENTS.md file.  This shows that AI can be used for useful work
on QEMU, ranging from small incremental improvements to new device models.

This is not a free-for-all, which is not a good idea either.  Maintainers
will want to apply their own considerations (see [1] for a good list),
and contributors should take into account the maintainers' preferences.

This is an attempt at building a process for contributions that use AI,
heeding Conservancy's advice to not shun contributors or maintainers
belonging to either camp, and keeping in mind that maintainer burnout
is the one thing we have to avoid.  Some of these processes already
existed, but the possibility of AI contribution makes it all more
important to write them down for everyone.

There was not much discussion in the previous version.  I tried to rein
in some of the language that allowed too wide interpretations, to apply
the changes that were suggested, and to clarify those choices that drew
more remarks.

As usual, the text including the commit messages is informed by discussion
with plenty of people, mentioned in the Cc trailers of patch 1.

Paolo

v2->v3:
- remove parser example, replace with "adaptations of existing code"
- when LLMs are used for boilerplate, "highly recommend" disclosure
  for "non-trivial, functional code".  The idea here is to avoid
  having to disclose using AI to apply e.g. changes related to
  automatic code review, and leaving people some leeway.
- clarify split between DCO (legal right to submit code in general)
  and AI-used-for acknowledging that the submitter cannot audit LLM
  output against e.g. the training data.
- clarify the defense-in-depth/swiss-cheese approach to limit the
  risk of copyright violations from LLM output
- mention that pre-arrangement is not an entirely new concept
- mention that maintainers can demand larger changes than for human-written code
- do not mention inclusion of the prompt
- add checkpatch.pl hunk, changing the phrasing of "no AI" lint
- rebase AGENTS.md on top of existing file, split
- drop CLAUDE.md/GEMINI.md symlinks, already done via .claude/.gemini

[1] https://lore.kernel.org/qemu-devel/CAFEAcA860fF_+ffk=cXiYyFoQo0wCSUJ6b=7nVLLCwKhP6Nwxw@mail.gmail.com/

Paolo Bonzini (4):
  docs/devel: relax policy on AI-generated contributions
  AGENTS.md: add final instructions
  AGENTS.md: let agents know what the participation rules are
  AGENTS.md: make the human part of the design process

 docs/devel/code-provenance.rst |  71 +-----------
 docs/devel/index-process.rst   |   1 +
 docs/devel/llm-usage.rst       | 202 +++++++++++++++++++++++++++++++++
 AGENTS.md                      | 137 +++++++++++++++++++---
 scripts/checkpatch.pl          |   5 +-
 5 files changed, 336 insertions(+), 80 deletions(-)
 create mode 100644 docs/devel/llm-usage.rst

-- 
2.55.0