Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions ai_policy/AI_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# AI Contribution Policy

We welcome AI-assisted contributions. This policy exists to ensure that all contributions remain the work of an accountable human contributor and that our community has the transparency it needs to collaborate effectively.

## Human Accountability

Every pull request (PR) must be submitted by a named individual who assumes full responsibility for the contribution. While we recognize that automation and AI can be part of a modern workflow, we do not accept fully automated or agentic submissions.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "full responsibility" mean in this context? I'm asking because I'm not sure what that implies for non-AI pull requests.


## Licensing and Copyright

Every contributor must agree to the [Developer Certificate of Origin (DCO) 1.1](https://developercertificate.org) within the GitHub PR template. This certifies that each contributor has the right to submit the code under the project's open-source license. This applies regardless of how the code was produced. It is the contributor's responsibility to ensure that any AI-assisted output is compatible with the project's license and that they hold or have cleared the rights to submit it.

## Mandatory AI Use Disclosure
To maintain transparency and trust within our community, contributors are required to disclose whether AI tools were used in preparing their contribution. We included a corresponding mandatory section in the GitHub PR template. If AI tools were used, the contributor additionally affirms that they have reviewed every change, fully understand the logic and security implications, and are prepared to explain or defend the technical decisions therein during the review process.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a security expert and I don't understand all of the security implications of code I contribute that does not involve AI. Also, if I "fully understand the logic" there would never be bugs.


### Acknowledgement
This policy was inspired by the [CloudNativePG AI Policy](https://github.com/cloudnative-pg/governance/blob/main/AI_POLICY.md) and developed with the practical guidance and support of [NumFOCUS](https://numfocus.org) in creating the initial draft. In the spirit of transparency and the "Disclosure" section of this policy, an initial draft of this document was generated using Google Gemini and was subsequently reviewed, edited, and approved by the Stan maintainers.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It helps to keep lines to 80 characters so that we can make more specific PR comments. As is, I'm commenting on the last sentence:

In the spirit of transparency and the "Disclosure" section of this policy, an initial draft of this document was generated using Google Gemini and was subsequently reviewed, edited, and approved by the Stan maintainers.

This shouldn't be in the document, it should be in the PR. We do not want our code submissions and documents to be cluttered with this stuff.


---

This policy is effective as of [date]. It will be reviewed periodically as AI tools and community norms evolve.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is not ready for approval until [date] is replaced with an actual date.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need to say that we'll review this periodically. It goes without saying that we continually review everything we have in the way of policy.


Questions or suggestions? Join the discussion in our [community channel](https://discourse.mc-stan.org).
75 changes: 75 additions & 0 deletions ai_policy/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Pull Request

> 💡
> **Does your PR contain only a trivial change?**
>
> If your PR consists of minor updates, such as fixing a typo, updating a link,
> or making small documentation tweaks, you can use our **[Lightweight PR Template](?template=trivial-pr.md)** to save time.
>
> (Note: Switch to Preview mode to click the link. It will redirect you to open a new PR using the shorter template.)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd help someone like me to understand what you mean by "Switch to Preview mode". Is this something done on GitHub? If so, where?

## Compliance & AI Disclosure
> This section is mandatory. Do not delete this section. PRs that leave it blank will not be reviewed.
- [ ] I have read the [Contributing Guidelines](../blob/main/.github/CONTRIBUTING.md).
- [ ] I accept the [Developer Certificate of Origin](https://developercertificate.org).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this developer certificate interact with GitHub's terms of use for submission. I believe they're also agreeing to those when submitting a PR.

For case (b), we should be providing the relevant license if the work is based on another licensed work.

- [ ] I have read and comply with the [AI Contribution Policy](../blob/main/AI_policy.md).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have versioning in case it changes so we know which version of the AI policy was agreed to?


**AI Tool Usage Disclosure:**
*Did you use AI tools (e.g. GitHub Copilot, ChatGPT, Claude, Cursor, etc.) for this PR?*
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is always a comma after "e.g.".


- [ ] **No AI used.** This PR consists entirely of my own original work.
- [ ] **AI-Assisted (Minor).** AI was used for boilerplate, syntax, or autocomplete.
- [ ] **AI-Generated (Major).** AI generated significant logic or entire sections.

> **Note:** If AI was used, I affirm that I have reviewed every line, fully understand the logic and security implications, and am prepared to explain or defend the technical decisions therein during the review process.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we say this already in the AI policy? I do not think we should duplicate things like this if possible because it introduces dependencies and consistency issues downstream.

## Pre-Review Checklist
> Please ensure these steps are completed before requesting a review.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a > here? Won't that render that first line like a quote?

- [ ] **Coordination:** For non-trivial changes, an issue was opened and approved by a maintainer. (Link: #____)
- [ ] **Alignment:** The PR delivers the specific result agreed upon in the linked issue.
- [ ] **Sync:** Branch is up-to-date with `main` / `develop`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are also a bunch of master repos still around.

"up to date" is not hyphenated

- [ ] **Quality:** All existing tests pass locally, and I have added new tests for my changes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes do not always require new tests if the change is just refactoring and not fixing a bug.

- [ ] **Docs:** Documentation (README, inline comments, or changelogs) has been updated.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, doc doesn't need to change.

We should be discouraging inline comments in favor of clearly written, modular code.

If there is specific documentation that must be updated, we should include that (e.g., a change log). Also "change log" is two words.

- [ ] **Notebooks:** If applicable, all `.qmd` / `.Rmd` files render end-to-end in a clean environment without machine-specific paths.
---

## Summary

<!-- Why is this change needed? What problem does it solve? (1-3 sentences.) -->
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these comments somehow get picked up and rendered? All this markdown is sooo broken.


Closes # <!-- issue number -->

### Type of Change

- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change (requires behaviour change/migration)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implication of a breaking change is that we update the major semantic version. We should strongly discourage this without discussion.

- [ ] Refactoring (no functional change)
- [ ] Documentation / Tooling / CI
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what "Tooling" is, but both CI and whatever tooling is feel different than documentation.

We should allow users to select more than one of these.


## What Changed

<!--
Describe the technical changes in enough detail for a reviewer to understand
the approach without reading every line of code.
Tip: if you cannot explain a section without re-reading AI output, that section
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a section here? What does AI output have to do with his? Shouldn't we be describing the technical change here whether AI was involved or not?

needs more review before this PR is ready.
-->

-
-
-

## Expected Result

<!--
Describe concretely what "done" looks like for this PR.
This should match what was agreed upon in the linked issue.
Include screenshots, logs, or demo output where helpful.
-->

**Additional Context**

<!-- Links to design docs, related PRs, Slack discussions, etc. -->
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slack discussions are transient. We should only be linking to things that will have stable links. Otherwise, we need to bring the relevant discussion into GitHub.