Skip to content

Commit b7443e3

Browse files
docs(ai_policy): add an AI attribution policy to CONTRIBUTING.rst
Require AI generated contributions to indicate so in commit messages. Also add the CONTRIBUTING.rst file to the generated documentation.
1 parent a4cbecb commit b7443e3

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

CONTRIBUTING.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ This creates a clearer project history, and automates our `Releases`_ and change
7575
* Bad: ``Update documentation for projects``
7676
* Good: ``docs(projects): update example for saving project attributes``
7777

78+
Also see the :ref:`AI attribution section <ai_attribution_section>` for
79+
information on attributing contributions from AI.
80+
7881
Coding Style
7982
------------
8083

@@ -90,6 +93,30 @@ To format your code according to our guidelines before committing, run:
9093
cd python-gitlab/
9194
tox -e black,isort
9295
96+
.. _ai_attribution_section:
97+
98+
AI Attribution
99+
--------------
100+
101+
When an AI coding assistant contributed meaningfully to a commit (writing or
102+
significantly modifying code, suggesting the fix, generating tests, etc.),
103+
add an ``Assisted-by`` trailer to the commit footer::
104+
105+
Assisted-by: <AgentName>:<ModelVersion>
106+
107+
Place it alongside any ``Closes:`` or ``BREAKING CHANGE:`` lines. Omit it when
108+
the AI contribution was trivial (e.g. a one-word suggestion or only
109+
autocomplete) or purely mechanical (running linters, reformatting).
110+
111+
Example::
112+
113+
fix(cli): correct the --spam flag
114+
115+
The --spam flag now says spam three times.
116+
117+
Closes: #1234
118+
Assisted-by: Claude:claude-sonnet-4-6
119+
93120
Running unit tests
94121
------------------
95122

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
changelog
1717
release-notes
1818
faq
19+
../CONTRIBUTING.rst
1920

2021

2122
Indices and tables

0 commit comments

Comments
 (0)