From 2ba34fc520b76fe9576f9677ad9d9dcba3f9181f Mon Sep 17 00:00:00 2001 From: chaokunyang Date: Sat, 28 Feb 2026 19:22:34 +0800 Subject: [PATCH 1/2] add ai contributing policy --- .github/pull_request_template.md | 11 +++ AI_CONTRIBUTION_POLICY.md | 127 +++++++++++++++++++++++++++++++ CONTRIBUTING.md | 13 ++++ 3 files changed, 151 insertions(+) create mode 100644 AI_CONTRIBUTION_POLICY.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 950f23dd1f..bae5ccdd15 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -28,6 +28,17 @@ Is there any related issue? If this PR closes them you say say fix/closes: - Fixes #xxxx2 --> +## AI Contribution Checklist (required when AI assistance = `yes`) + +- [ ] AI assistance was used in this PR: `yes` / `no` +- [ ] I can explain and defend all important changes without AI help. +- [ ] I reviewed AI-assisted code changes line by line before submission. +- [ ] I summarized AI assistance scope in `What does this PR do?`. +- [ ] I listed affected files/subsystems in `What does this PR do?`. +- [ ] I recorded human verification evidence (commands/tests/benchmarks and pass/fail summary) in this PR. +- [ ] I added/updated tests and specs where required. +- [ ] I validated protocol/performance impacts with evidence when applicable. + ## Does this PR introduce any user-facing change? + + +- [ ] Substantial AI assistance was used in this PR: `yes` / `no` +- [ ] If `yes`, I included the standardized AI Usage Disclosure block below. +- [ ] If `yes`, I can explain and defend all important changes without AI help. +- [ ] If `yes`, I reviewed AI-assisted code changes line by line before submission. +- [ ] If `yes`, I ran adequate human verification and recorded evidence (checks run locally or in CI, pass/fail summary, and confirmation I reviewed results). +- [ ] If `yes`, I added/updated tests and specs where required. +- [ ] If `yes`, I validated protocol/performance impacts with evidence when applicable. +- [ ] If `yes`, I verified licensing and provenance compliance. + +AI Usage Disclosure (only when substantial AI assistance = `yes`): + + + +```text +AI Usage Disclosure +- substantial_ai_assistance: yes +- scope: +- affected_files_or_subsystems: +- human_verification: +- performance_verification: +- provenance_license_confirmation: +``` ## Does this PR introduce any user-facing change? diff --git a/AI_CONTRIBUTION_POLICY.md b/AI_CONTRIBUTION_POLICY.md index a7dcca6057..32352f7b1b 100644 --- a/AI_CONTRIBUTION_POLICY.md +++ b/AI_CONTRIBUTION_POLICY.md @@ -10,21 +10,45 @@ The key words MUST, MUST NOT, REQUIRED, SHOULD, and MAY are interpreted as descr - AI tools MAY assist contribution work. - AI tools MUST NOT replace contributor accountability. - The human submitter is responsible for correctness, safety, performance, and maintainability of all submitted changes. +- License/provenance confirmation: contributors MUST confirm submitted material is legally compatible and traceable, and MUST comply with [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html). - AI-assisted code MUST be reviewed carefully by the contributor line by line before submission. - Contributors MUST be able to explain and defend design and implementation details during review. ## 2. Disclosure (Privacy-Safe) For substantial AI assistance, PR descriptions MUST include a short `AI Usage Disclosure` section. +For minor or narrow AI assistance, full disclosure is not required. + +Definition of substantial AI assistance: + +- Substantial means AI materially influenced technical content, not only writing style. +- Contributors MUST mark AI assistance as substantial (`yes`) if any of the following apply: + - AI generated or rewrote non-trivial code/test logic (even for a small change or a single function). + - AI-generated or AI-refactored content is about 20 or more added/changed lines in aggregate. + - AI materially influenced API, protocol, type mapping, performance, memory, or architecture decisions. + - AI produced substantive technical text used in PR rationale (beyond grammar/translation cleanup). +- Contributors MAY mark substantial AI assistance as `no` for minor or narrow assistance only, such as spelling/grammar fixes, formatting, trivial comment wording edits, or other non-technical edits with no behavior impact. Required disclosure fields: - Whether substantial AI assistance was used (`yes` or `no`) - Scope of assistance (for example: design drafting, code drafting, refactor suggestions, tests, docs) - Affected files or subsystems (high-level) -- Human verification performed (commands/tests/benchmarks executed) +- Human verification performed (checks run locally or in CI, and results reviewed by the contributor) - Provenance and license confirmation (see Section 6) +Standard disclosure template (recommended): + +```text +AI Usage Disclosure +- substantial_ai_assistance: yes +- scope: +- affected_files_or_subsystems: +- human_verification: +- performance_verification: +- provenance_license_confirmation: +``` + To protect privacy and enterprise security: - Contributors are NOT required to disclose model names, provider names, private prompts, or internal workflow details. @@ -49,10 +73,17 @@ For AI-assisted non-trivial work without prior alignment, maintainers MAY reques ## 5. Verification Requirements -Every AI-assisted PR MUST provide verifiable evidence of local validation: +Every AI-assisted PR MUST provide verifiable evidence of local or CI validation: + +Definition of adequate human verification: + +- The contributor personally runs the relevant checks locally or in project CI and reviews the results. +- Verification includes concrete evidence (exact commands and pass/fail outcomes), not only claims. +- Verification covers the changed behavior with targeted tests where applicable. +- For protocol or performance-sensitive changes, verification includes the required compatibility tests and/or benchmark/regression evidence. - Confirmation that contributor performed line-by-line self-review of AI-assisted code changes -- Build/lint/test commands run locally +- Build/lint/test checks run locally or in CI - Targeted tests for changed behavior - Results summary (pass/fail and relevant environment context) @@ -90,7 +121,7 @@ Maintainers MAY close or return PRs that materially fail project standards, incl - Contributor cannot explain key implementation logic - Missing required disclosure for substantial AI assistance -- Missing verification evidence for changed behavior +- Missing or inadequate human verification evidence for changed behavior - Redundant implementation of existing utilities without clear necessity - Introduction of dead code, unused helpers, or placeholder abstractions without justification - Protocol or performance claims without reproducible evidence diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e01b605c49..a8e7ec88b4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,8 +33,8 @@ Key points: - AI tools are allowed as assistants, but contributors remain fully responsible for all submitted changes. - AI-assisted code must be reviewed carefully line by line before submission, and contributors must be able to explain and defend it during review. -- For substantial AI assistance, provide privacy-safe disclosure in the PR and complete the AI checklist in the PR template. -- Include human verification evidence (for example build/lint/test commands and results), and add/update tests and specs where required. +- For substantial AI assistance, provide privacy-safe disclosure in the PR using the standard template in `.github/pull_request_template.md`. Minor/narrow AI assistance does not require full disclosure. +- Include adequate human verification evidence (for example exact build/lint/test commands and pass/fail outcomes), and add/update tests and specs where required. - For protocol/type-mapping/wire-format or performance-sensitive changes, provide the required compatibility/performance validation evidence. - Ensure licensing and provenance compliance with [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) and do not submit content with uncertain provenance.