diff --git a/AI_ASSISTED_CONTRIBUTIONS.md b/AI_ASSISTED_CONTRIBUTIONS.md new file mode 100644 index 0000000..8f12845 --- /dev/null +++ b/AI_ASSISTED_CONTRIBUTIONS.md @@ -0,0 +1,126 @@ +# AI-assisted contributions + +Generative AI tools such as ChatGPT, Claude, Claude Code, GitHub Copilot, +Codex, Gemini, Cursor, and similar tools may be used when contributing to +Multi Theft Auto projects. + +AI assistance does not reduce the contributor's responsibility for a +contribution. The person submitting the contribution remains its author and +is responsible for its correctness, quality, security, licensing, and impact +on the project. + +## Contributor responsibilities + +Before submitting AI-assisted work, contributors must: + +- review and understand every submitted change +- verify that the change is appropriate for the project +- test the change to the same standard as any other contribution +- be able to explain and defend the design and implementation +- verify claims made in commit messages, pull request descriptions, and review + responses +- ensure that the contribution can legally be submitted under the project's + license +- ensure that secrets, credentials, private data, unpublished security + information, or other sensitive material were not shared with an external AI + service + +Do not submit generated code, tests, documentation, or explanations that you +have not personally reviewed and understood. AI-generated statements claiming +that a build or test passed are not acceptable unless the contributor actually +performed that verification. + +Fully autonomous or bot-submitted pull requests are not accepted unless the +project maintainers have explicitly approved the automation in advance. + +## When disclosure is required + +Disclosure is required when a generative AI tool materially contributed to the +submitted work. This includes AI that generated or substantially modified: + +- source code or scripts +- tests or test data +- documentation +- configuration or build files +- architecture or implementation incorporated into the contribution +- commit messages or pull request descriptions containing substantive technical + explanations + +Disclosure is not normally required for trivial spelling corrections, +formatting suggestions, search queries, or small editor completions that did +not materially influence the contribution. + +When uncertain, disclose the assistance. + +## Commit disclosure + +Add an `Assisted-by:` trailer to every affected commit. Identify the tool, and +include the model when it is known: + +```text +Fix checkpoint validation for duplicate elements + +Reject duplicate checkpoint elements before adding them to the lookup table. + +Assisted-by: Claude Code (Claude Sonnet) +``` + +Other valid examples include: + +```text +Assisted-by: ChatGPT +Assisted-by: GitHub Copilot +Assisted-by: Codex (GPT-5) +``` + +Add a separate trailer for each tool that materially contributed: + +```text +Assisted-by: Claude Code +Assisted-by: ChatGPT +``` + +An automatically generated `Co-authored-by:` trailer that clearly identifies +an AI tool is also accepted as disclosure. `Assisted-by:` is preferred because +the human contributor remains the author and responsible party. + +Do not identify an AI tool using `Signed-off-by:`, `Reviewed-by:`, or +`Tested-by:`. Those trailers represent certifications or actions performed by +people. + +## Pull request disclosure + +The pull request description must also briefly state: + +- which AI tools were used +- which parts of the contribution were AI-assisted +- what review and testing the contributor performed + +For example: + +```text +AI assistance: Claude Code produced the initial implementation and unit-test +scaffolding. I reviewed and modified the generated code and ran the relevant +test suite. +``` + +A short disclosure is sufficient. Do not paste prompts, complete AI transcripts, +or generated walls of text unless they are directly relevant to the review. + +## Review and enforcement + +AI-assisted contributions are held to the same coding, testing, licensing, +security, and review standards as all other contributions. The use of AI is not +an exception to any project rule. + +Reviewers may ask contributors to explain design decisions, unusual code, or +the verification they performed. A contribution may be rejected when the +contributor cannot adequately explain or support the submitted work. + +Maintainers should review the contribution itself and should not rely on +automated AI-content detectors to determine whether disclosure was required. + +Missing disclosure should normally be corrected by updating the pull request +and affected commits. Repeated submission of undisclosed, unreviewed, or +low-quality AI-generated work may result in the contribution being closed or +repository privileges being restricted. diff --git a/CODE_REVIEW.md b/CODE_REVIEW.md index 0161e9c..c439d3d 100644 --- a/CODE_REVIEW.md +++ b/CODE_REVIEW.md @@ -4,6 +4,7 @@ - [Everyone](#everyone) - [As a code submitter](#as-a-code-submitter) - [As a reviewer](#as-a-reviewer) + - [Reviewing AI-assisted contributions](#reviewing-ai-assisted-contributions) - [Responding to feedback](#responding-to-feedback) _These aren't necessarily "rules", it is just a guide on how to review code effectively._ @@ -110,6 +111,21 @@ experience, refactors the existing code). Then: If the pull request author has merge permissions prefer review approvals instead of merging the PR for them. +### Reviewing AI-assisted contributions + +Review AI-assisted contributions using the same correctness, security, testing, +and maintainability standards as any other contribution. + +The contributor, not the AI tool, is responsible for the submitted work. +Reviewers may ask contributors to explain design decisions, unusual code, or the +tests they performed. A contribution may be rejected when the contributor cannot +adequately explain or support the submitted changes. + +Verify that meaningful AI assistance was disclosed according to the +[AI-assisted contributions policy](AI_ASSISTED_CONTRIBUTIONS.md). Do not rely on +automated AI-content detectors. Review the actual implementation and the +contributor's demonstrated understanding of it. + ## Responding to feedback * Try to respond to every comment. Be grateful for the reviewer's suggestions. ("Good call. I'll make that change.") diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8035cc2..2296624 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,6 +33,8 @@ as well as information on best practices. Coding guidelines (exploring real code snippets and scenarios) should be kept in `CODING_GUIDELINES.md` +Policies that apply to all Multi Theft Auto projects should be stored at the repository root and linked from each applicable project guide. This includes the [AI-assisted contributions policy](AI_ASSISTED_CONTRIBUTIONS.md) and the [Code review](CODE_REVIEW.md) guide. + If a document requires a large snippet of code, it's best to store the code snippet separately under `examples/` For example (pun not intended), if writing the section on "Securing element data" for the [Script security](#) guide, the script example would be under `mtasa-resources/examples/securing_element_data.lua` and you'd link to that file in the guide. diff --git a/README.md b/README.md index ddef127..0364811 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,9 @@ Or you can go directly to the `CODING_GUIDELINES.md`, exploring real code snippe - [mtasa-resources](mtasa-resources/CODING_GUIDELINES.md) +## AI-assisted contributions +The use of generative AI tools is permitted, subject to our [AI-assisted contributions policy](AI_ASSISTED_CONTRIBUTIONS.md). Meaningful AI assistance must be disclosed, and contributors remain responsible for reviewing, understanding, and testing their submissions. + + ## Code reviews Not looking to contribute with lines of code, but instead with your code review skills? See our [Code review](CODE_REVIEW.md) document, applicable to all of our projects, which may guide and inspire you to submitting great code reviews! diff --git a/mtasa-blue/CONTRIBUTING.md b/mtasa-blue/CONTRIBUTING.md index 74c464b..fd8e45d 100644 --- a/mtasa-blue/CONTRIBUTING.md +++ b/mtasa-blue/CONTRIBUTING.md @@ -52,6 +52,7 @@ the mod will be reverted other than in exceptional circumstances. - be consistent - always give a clear indication of what has been changed without having to look at the code - include issue numbers, using [GitHub keywords](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) where necessary +- disclose meaningful AI assistance as described in the [AI-assisted contributions policy](../AI_ASSISTED_CONTRIBUTIONS.md) - [follow the seven rules identified here](http://chris.beams.io/posts/git-commit/) The most important of the [seven rules](http://chris.beams.io/posts/git-commit/) has been copied below, but please read the article: @@ -118,6 +119,20 @@ leaving the pull request clean. Addendum to a80f8d6: fix Windows build error ``` +## AI-assisted contributions + +The use of generative AI tools is permitted, but meaningful AI assistance +must be disclosed. Contributors remain fully responsible for all submitted +changes and must review, understand, and test any AI-assisted work. + +Add an `Assisted-by:` trailer to each affected commit and include a brief +AI-assistance disclosure in the pull request description. Automatically +generated `Co-authored-by:` trailers that clearly identify the AI tool are +also accepted. + +See the [AI-assisted contributions policy](../AI_ASSISTED_CONTRIBUTIONS.md) +for the complete requirements. + ## Reviewing code Contributors should try to review other contributor's commits and provide diff --git a/mtasa-resources/CONTRIBUTING.md b/mtasa-resources/CONTRIBUTING.md index 1d5514e..34e2c3b 100644 --- a/mtasa-resources/CONTRIBUTING.md +++ b/mtasa-resources/CONTRIBUTING.md @@ -4,6 +4,19 @@ This document mostly contains guidelines as to how your contributions should be If you're looking for more specific coding conventions or style guidelines, see the [Coding Guidelines](CODING_GUIDELINES.md). +## AI-assisted contributions + +The use of generative AI tools is permitted, but meaningful AI assistance +must be disclosed. Contributors remain fully responsible for reviewing, +understanding, and testing all submitted changes. + +Add an `Assisted-by:` trailer to each affected commit and include a brief +AI-assistance disclosure in the pull request description. Automatically +generated `Co-authored-by:` trailers that clearly identify the AI tool are +also accepted. + +See the [AI-assisted contributions policy](../AI_ASSISTED_CONTRIBUTIONS.md) +for the complete requirements. ### Submitting issues