Skip to content

Commit

Permalink
Merge pull request #20803 from 0xdaryl/aipolicy
Browse files Browse the repository at this point in the history
Eclipse OpenJ9 Generative AI (GenAI) Usage Guidelines
  • Loading branch information
pshipton authored Dec 13, 2024
2 parents 5d9f84b + 75c1df5 commit f6e6334
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 2 deletions.
118 changes: 116 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,15 @@ Following these guidelines will help us merge your pull requests smoothly:
A [pull request](https://github.com/eclipse-openj9/openj9-docs/pulls) to update the documentation is required. Do your best
to make appropriate updates, and the reviewers will help guide the necessary doc changes.

5. Please carefully read and adhere to the legal considerations and
5. Contributions from generative artificial intelligence (GenAI) coding assistants
are permitted subject to the
[GenAI Usage Guidelines](#Generative-Artificial-Intelligence-Usage-Guidelines)
described below.

6. Please carefully read and adhere to the legal considerations and
copyright/license requirements outlined below.

6. Ensure your changes are compatible with the checks that will be applied to your pull request.
7. Ensure your changes are compatible with the checks that will be applied to your pull request.
- Text files should use the proper line-endings and there should be no unwanted whitespace. You can enable the sample `pre-commit` hook created by `git init` to ensure you adhere to expectations.

## Building and testing
Expand Down Expand Up @@ -183,6 +188,115 @@ improperly referenced, and the commit is not signed off by the author.

- https://cbea.ms/git-commit/

## Generative Artificial Intelligence Usage Guidelines

The Eclipse OpenJ9 project acknowledges that some contributions may be authored in
whole or in part from generative artificial intelligence coding
assistants. Such contributions are permitted per the
[Eclipse Foundation Generative AI Usage Guidelines](https://www.eclipse.org/projects/guidelines/genai/)
which describes contributor and committer responsibilities, copyright and
licensing considerations, and attribution requirements for GenAI assisted
contributions.

All contributors are encouraged to read and understand the advice and
guidelines therein before submitting a contribution to Eclipse OpenJ9 even
partially generated by an AI coding assistant.

The Eclipse OpenJ9 project is subject to those policies and provides additional
guidelines described below for contributors and committers governing
GenAI-assisted contributions.

### Attribution

Contributions that include GenAI-assisted content must disclose that authorship
in each file where GenAI content is present. Contributors must include a
statement like the following just below the copyright header at the beginning
of the file that acknowledges their AI assistant (assuming such a statement
does not already exist).

```
// Some sections generated by <YOUR AI ASSISTANT>
```

In addition, individual commits that include GenAI authored content must
attribute that at the end of the commit message (before any human authorship
signatures).

```
Co-authored by <YOUR AI ASSISTANT>
```

### Tagging

Some contributors' employers may require their AI-generated code and
documentation contributions to be annotated with inline tags providing
additional metadata about the generated content for legal and license
attribution reasons. Eclipse OpenJ9 will accept contributions that include such
metadata with some guidance below for contributors and committers.

#### Tag Usage

Inline tagging of code or documentation generated by coding assistants is not
mandatory.

If tags are used, they must clearly demarcate the boundaries of GenAI-assisted
content (e.g., via paired "begin" and "end" code comments). These boundaries
may span consecutive lines, functions, paragraphs, or entire files. The term
"assisted" is an important qualifier to describe the enclosed content because
it may contain a blend of AI-generated content and human contributions. The
"assisted" distinction is necessary because it may not be possible to clearly
identify just the AI-generated content in the contribution, and it allows for
human changes to the demarcated contribution over time while preserving the
meaning of the tags.

#### Tag Format

At this time, Eclipse OpenJ9 does not specify the format of the tags, except that
they must not contain any corporate-specific information or other identifiers
that have no meaning beyond the original contributor (e.g., internal issue
numbers or URLs). Information about the model used to generate the code or
documentation is permitted, however.

Tags must be concise and as minimally-invasive as possible. Tags that are
excessively verbose or impact the readability of the code or documentation may
be rejected by committers at their discretion.

For consistency, tags produced for the same coding assistant must use the same
format regardless of the contributor or pull request.

#### Tag Maintenance

If the contents of a tagged region are modified by a human then any enclosing
tags should remain in place.

If code or documentation within a tagged region is copied in whole or in part
elsewhere in the project, the original surrounding tags should accompany the
copy to its destination. If such code or documentation is copied to a file
that does not already have the Eclipse Foundation GenAI attribution after the
copyright header, such attribution must be added.

Eclipse OpenJ9 implements a good-faith policy for contributors and committers to
maintain GenAI tags in the code and documentation for as long as possible.
Existing tags and their boundaries will be maintained on a best-effort basis,
and they should not be removed simply for the sake of removing them.

However, there are legitimate situations where GenAI tagging may be considered
for removal, including if the tags:

* interfere with the readability or understandability of the code or
documentation,
* become difficult or unwieldy to maintain (e.g., through code refactoring or
code sharing),
* become obsolete (e.g., information within a tagged section is removed
entirely),
* become redundant (e.g., an inner set of tags is completely consumed by an
outer set)

This list is not exhaustive, and the disposition of GenAI tags in a pull
request will ultimately be at the discretion of Eclipse OpenJ9 committers who will
balance the spirit of these tagging guidelines with the best interests of the
Eclipse OpenJ9 project.

## Legal considerations

Please read the [Eclipse Foundation policy on accepting contributions via Git](https://wiki.eclipse.org/Development_Resources/Contributing_via_Git).
Expand Down
4 changes: 4 additions & 0 deletions doc/GuideForCommitters.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ follow when reviewing and merging pull requests and issues. It also provides
a checklist of items that committers must ensure have been completed prior to
merging a pull request.

Committers should be aware of the
[Eclipse Foundation Generative Artificial Intelligence Usage Guidelines](https://www.eclipse.org/projects/guidelines/genai/)
as well as the
[Eclipse OpenJ9 Generative Artificial Intelligence Usage Guidelines](/CONTRIBUTING.md#Generative-Artificial-Intelligence-Usage-Guidelines).

## General Guidelines

Expand Down

0 comments on commit f6e6334

Please sign in to comment.