docs: add AI usage policy for contributors#2111
Conversation
|
What reviewer looks at during PR reviewThe following are ideal points maintainers look for during review. Reviewing these points yourself beforehand can help streamline the review process and reduce time to merge.
|
|
Ready to act? Review this PR in Change Stack to turn feedback into patch suggestions you can inspect and refine. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughThis PR establishes an AI disclosure policy and enforcement system: adds AI-POLICY.md, updates CONTRIBUTING.md and README, adds AI-assistance checkboxes to the PR template, and adds a GitHub Actions workflow that verifies PR disclosure and posts guidance or fails the check. ChangesAI Disclosure Policy and Enforcement
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/verify-ai-disclosure.yml (1)
65-76: ⚡ Quick winEnforce mutually exclusive declarations to match template intent.
Current logic accepts both “No AI assistance” and a non-empty
Generated-by, but the template requires exactly one declaration. Consider failing when both are present and guiding the author to choose one.Suggested fix
- if (noAiChecked || hasGeneratedBy) { + if (noAiChecked && hasGeneratedBy) { + const conflictMessage = [ + MARKER, + '### ⚠️ Conflicting AI-assistance disclosure', + '', + 'Please choose exactly one option:', + '- either check **"No AI assistance was used"**', + '- or provide a non-empty `Generated-by:` declaration.', + ].join('\n'); + if (existing) { + await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body: conflictMessage }); + } else { + await github.rest.issues.createComment({ owner, repo, issue_number, body: conflictMessage }); + } + core.setFailed(`Conflicting AI-assistance disclosure. See ${policyUrl}`); + return; + } + + if (noAiChecked || hasGeneratedBy) { core.info( hasGeneratedBy ? `AI assistance disclosed: Generated-by: ${generatedByValue}` : 'Declared: no AI assistance used.' );Also applies to: 93-100
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/verify-ai-disclosure.yml around lines 65 - 76, Update the acceptance logic so the declarations are mutually exclusive: replace the current if check that allows noAiChecked OR hasGeneratedBy with an exclusive condition that requires exactly one to be true (XOR between noAiChecked and hasGeneratedBy); if both are present (noAiChecked && hasGeneratedBy) treat it as a failure path that posts/retains a guidance comment instructing the author to choose either “No AI assistance” or a single non-empty Generated-by value (use generatedByValue for the message) and do not delete existing failure comments; apply the same XOR enforcement change to the duplicate block that currently mirrors this logic (the block around the later occurrence referenced in the review).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@AI-POLICY.md`:
- Around line 41-44: The fenced code block containing the lines "Generated-by:
Claude Code 1.x" and "Generated-by: GitHub Copilot" is missing a language tag
and triggers markdownlint MD040; update the opening fence (the triple backticks
before those lines) to include a language identifier such as text (i.e., change
``` to ```text) so the block is properly tagged and linting passes.
---
Nitpick comments:
In @.github/workflows/verify-ai-disclosure.yml:
- Around line 65-76: Update the acceptance logic so the declarations are
mutually exclusive: replace the current if check that allows noAiChecked OR
hasGeneratedBy with an exclusive condition that requires exactly one to be true
(XOR between noAiChecked and hasGeneratedBy); if both are present (noAiChecked
&& hasGeneratedBy) treat it as a failure path that posts/retains a guidance
comment instructing the author to choose either “No AI assistance” or a single
non-empty Generated-by value (use generatedByValue for the message) and do not
delete existing failure comments; apply the same XOR enforcement change to the
duplicate block that currently mirrors this logic (the block around the later
occurrence referenced in the review).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d63dfab8-6028-4323-880e-a429eb84b651
📒 Files selected for processing (5)
.github/pull-request-template.md.github/workflows/verify-ai-disclosure.ymlAI-POLICY.mdCONTRIBUTING.mdREADME.md
|
@derberg I can't merge the PR needs your or other maintainer review. |
|



Description
Adds an AI usage policy for contributors:
AI-POLICY.md— human authorship/accountability, contributor responsibilities, requiredGenerated-by:disclosure, functions off-limits for automation, and consequences.Generated-by:line + "no AI" checkbox).verify-ai-disclosureworkflow — checks each PR declares one of the two and comments with fix instructions when it doesn't.AI assistance
Summary by CodeRabbit
Documentation
Chores