Skip to content

Add AI_POLICY for clarification how to use AI agents#1740

Open
leborchuk wants to merge 4 commits into
apache:mainfrom
leborchuk:AddAIPolicy
Open

Add AI_POLICY for clarification how to use AI agents#1740
leborchuk wants to merge 4 commits into
apache:mainfrom
leborchuk:AddAIPolicy

Conversation

@leborchuk
Copy link
Copy Markdown
Contributor

@leborchuk leborchuk commented May 12, 2026

See detailed discussion in https://lists.apache.org/thread/3kq1391n3n0rzo0wchygmt0cyy59rzq9

As for the discussion results I've added:

  1. AI_GUIDELINE.md - note for the developer what using AI agents means
  2. AGENTS.md.template - template to create your own AGENTS.md file
  3. .github/pull_request_template.md - new flag "This PR contains AI-assisted code generation"
  4. README.md - link to guideline from README file

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


@leborchuk leborchuk marked this pull request as ready for review May 12, 2026 11:36
Copilot AI review requested due to automatic review settings May 12, 2026 11:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds project documentation and process guardrails for AI-assisted contributions, including a new AI policy doc, agent guidance for working in the repository, and a PR-template disclosure checkbox.

Changes:

  • Add AI_POLICY.md describing expectations for responsible AI-assisted development.
  • Add AGENTS.md with repository map and rules for agent-style coding tools.
  • Update the PR template and README to surface AI policy/disclosure.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
README.md Adds a link to the new AI policy in the contribution resources table.
AI_POLICY.md New AI policy document for AI-assisted development expectations.
AGENTS.md New guidance for agent tools working in this repo (layout, principles, workflow).
.github/pull_request_template.md Adds an AI-assisted code generation disclosure checkbox.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AI_POLICY.md Outdated
Comment thread AI_POLICY.md Outdated
Comment thread AI_POLICY.md Outdated

### 6. LLM code review

So far, it is not possible to use paid LLM models for code review in open source ASF projects. However, one could use personal licenses for LLMs to do the same.
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 think we need to improve the description here, like:

Some AI review tools (for example, GitHub Copilot review or CodeRabbit)
may not currently be enabled for ASF-hosted repositories due to operational, budget, or permission considerations. Contributors may still use personal AI tools locally, but remain responsible for code quality, licensing, and review outcomes.

Comment thread AI_POLICY.md Outdated

- [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) - Official Apache guidance on AI tool usage
- [GitHub Copilot](https://github.com/features/copilot) - AI pair programmer and code reviewer we use
- [LLM Leaderboard](https://llm-stats.com/) - LLM Stats Score, it's better to use high-ranked models No newline at end of file
@jiaqizho
Copy link
Copy Markdown
Contributor

Hi @leborchuk, I don't think that adding a project-level AGENTS.md or CLAUDE.md in project is a good idea.

My first concern is that these files are not just passive documentation. For tools like Codex or Claude Code, project-level instruction files can be loaded automatically and affect every local AI session in this repository. As far as Codex is concerned, AGENTS.md is project-scoped; there is no separate global AGENTS.md file that each developer can maintain independently. If the repository ships one, it effectively becomes part of the local agent behavior for everyone who checks out the project. I would prefer each contributor to define their own AI agent style, level of autonomy, communication pattern, and workflow preferences.

My second concern is the content. A good project-level agent file should mainly capture hard project constraints and practical project knowledge: required license/header rules, build and test commands, high-risk subsystems, generated files ... It should constrain or assist the agent where the project has real requirements. It should not try to tune the agent's general coding style, personality, or workflow. Many items in the proposed AGENTS.md read more like agent prompting or personal preferences about how an AI assistant should behave, rather than Cloudberry-specific rules. Those preferences can vary by developer and by tool, and I do not think the project should freeze one particular AI-agent behavior into the repository.

@my-ship-it Please consider this change seriously.

@yjhjstz
Copy link
Copy Markdown
Member

yjhjstz commented May 12, 2026

AGENTS.md is not suitable for committing to git, as it is platform- and user-specific.

leborchuk added 2 commits May 12, 2026 18:18
See detailed discussion in https://lists.apache.org/thread/3kq1391n3n0rzo0wchygmt0cyy59rzq9

As for the discussion results I've added:
1. AI_POLICY.md - note for the developer what using AI agents means
2. AGENTS.md - description for LLM models how to work with project code
3. .github/pull_request_template.md - new flag "This PR contains AI-assisted code generation"
4. README.md - link to policy from README file
@leborchuk
Copy link
Copy Markdown
Contributor Author

Thank you, got it, remove AGENTS.md

Copy link
Copy Markdown
Member

@tuhaihe tuhaihe left a comment

Choose a reason for hiding this comment

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

One more small suggestion: it may be good to follow a formatting style similar to README.md or CONTRIBUTING.md, especially for line wrapping. Limiting line length to around 76–80 characters would make the document more consistent with other markdown documentation and improve readability in terminal/editor views.

Comment thread AI_POLICY.md Outdated

### 6. LLM code review

So far, it is not possible to use paid LLM models for code review in open source ASF projects. However, one could use personal licenses for LLMs to do the same.
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 think we need to improve the description here, like:

Some AI review tools (for example, GitHub Copilot review or CodeRabbit)
may not currently be enabled for ASF-hosted repositories due to operational, budget, or permission considerations. Contributors may still use personal AI tools locally, but remain responsible for code quality, licensing, and review outcomes.

Comment thread AI_POLICY.md Outdated
Comment thread AI_POLICY.md Outdated
Comment thread AI_POLICY.md Outdated
Comment thread AI_POLICY.md Outdated
@tuhaihe
Copy link
Copy Markdown
Member

tuhaihe commented May 13, 2026

A couple of additional suggestions that may help improve the overall developer workflow around AI-assisted contributions:

  1. It may be useful to add an optional attribution line in the git commit message template, similar to the approach discussed in the Linux kernel coding assistants guidance:
    https://docs.kernel.org/process/coding-assistants.html

For example:

Assisted-by: ChatGPT
Assisted-by: GitHub Copilot

This could provide lightweight transparency/provenance information without making AI disclosure a strict requirement. If this direction looks reasonable, we could also update .gitmessage accordingly.

  1. Regarding AGENTS.md, I think the idea itself is still useful for contributor onboarding, especially for developers who are newer to AI-assisted workflows. To avoid conflicts with local developer files, perhaps we could rename it to something like:

AGENTS.md.template

This would position it more as a reference/example template rather than a required project file, while still helping contributors quickly get started with AI-assisted development practices.

Some other ASF projects also ship AGENTS.md:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants