Skip to content

Commit 8b8c41a

Browse files
committed
make the policy more accurate to reduce ambiguity
1 parent 2ba34fc commit 8b8c41a

3 files changed

Lines changed: 64 additions & 14 deletions

File tree

.github/pull_request_template.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,33 @@ Is there any related issue? If this PR closes them you say say fix/closes:
3030

3131
## AI Contribution Checklist (required when AI assistance = `yes`)
3232

33-
- [ ] AI assistance was used in this PR: `yes` / `no`
34-
- [ ] I can explain and defend all important changes without AI help.
35-
- [ ] I reviewed AI-assisted code changes line by line before submission.
36-
- [ ] I summarized AI assistance scope in `What does this PR do?`.
37-
- [ ] I listed affected files/subsystems in `What does this PR do?`.
38-
- [ ] I recorded human verification evidence (commands/tests/benchmarks and pass/fail summary) in this PR.
39-
- [ ] I added/updated tests and specs where required.
40-
- [ ] I validated protocol/performance impacts with evidence when applicable.
33+
<!-- Please read: https://github.com/apache/fory/blob/main/AI_CONTRIBUTION_POLICY.md -->
34+
<!-- Mark `yes` when AI materially influenced technical content.
35+
Examples: non-trivial code/test logic generated by AI (even one function), about 20+ added/changed lines influenced by AI, or AI influence on API/protocol/performance/architecture decisions.
36+
Mark `no` for minor/narrow assistance only (spelling/grammar/formatting/trivial comment or wording edits with no behavior impact). -->
37+
38+
- [ ] Substantial AI assistance was used in this PR: `yes` / `no`
39+
- [ ] If `yes`, I included the standardized AI Usage Disclosure block below.
40+
- [ ] If `yes`, I can explain and defend all important changes without AI help.
41+
- [ ] If `yes`, I reviewed AI-assisted code changes line by line before submission.
42+
- [ ] If `yes`, I ran adequate human verification and recorded evidence (checks run locally or in CI, pass/fail summary, and confirmation I reviewed results).
43+
- [ ] If `yes`, I added/updated tests and specs where required.
44+
- [ ] If `yes`, I validated protocol/performance impacts with evidence when applicable.
45+
- [ ] If `yes`, I verified licensing and provenance compliance.
46+
47+
AI Usage Disclosure (only when substantial AI assistance = `yes`):
48+
49+
<!-- Use this standard template to keep reviews consistent and low-overhead. -->
50+
51+
```text
52+
AI Usage Disclosure
53+
- substantial_ai_assistance: yes
54+
- scope: <design drafting | code drafting | refactor suggestions | tests | docs | other>
55+
- affected_files_or_subsystems: <high-level paths/modules>
56+
- human_verification: <checks run locally or in CI + pass/fail summary + contributor reviewed results>
57+
- performance_verification: <N/A or benchmark/regression evidence summary>
58+
- provenance_license_confirmation: <Apache-2.0-compatible provenance confirmed; no incompatible third-party code introduced>
59+
```
4160

4261
## Does this PR introduce any user-facing change?
4362

AI_CONTRIBUTION_POLICY.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,45 @@ The key words MUST, MUST NOT, REQUIRED, SHOULD, and MAY are interpreted as descr
1010
- AI tools MAY assist contribution work.
1111
- AI tools MUST NOT replace contributor accountability.
1212
- The human submitter is responsible for correctness, safety, performance, and maintainability of all submitted changes.
13+
- 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).
1314
- AI-assisted code MUST be reviewed carefully by the contributor line by line before submission.
1415
- Contributors MUST be able to explain and defend design and implementation details during review.
1516

1617
## 2. Disclosure (Privacy-Safe)
1718

1819
For substantial AI assistance, PR descriptions MUST include a short `AI Usage Disclosure` section.
20+
For minor or narrow AI assistance, full disclosure is not required.
21+
22+
Definition of substantial AI assistance:
23+
24+
- Substantial means AI materially influenced technical content, not only writing style.
25+
- Contributors MUST mark AI assistance as substantial (`yes`) if any of the following apply:
26+
- AI generated or rewrote non-trivial code/test logic (even for a small change or a single function).
27+
- AI-generated or AI-refactored content is about 20 or more added/changed lines in aggregate.
28+
- AI materially influenced API, protocol, type mapping, performance, memory, or architecture decisions.
29+
- AI produced substantive technical text used in PR rationale (beyond grammar/translation cleanup).
30+
- 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.
1931

2032
Required disclosure fields:
2133

2234
- Whether substantial AI assistance was used (`yes` or `no`)
2335
- Scope of assistance (for example: design drafting, code drafting, refactor suggestions, tests, docs)
2436
- Affected files or subsystems (high-level)
25-
- Human verification performed (commands/tests/benchmarks executed)
37+
- Human verification performed (checks run locally or in CI, and results reviewed by the contributor)
2638
- Provenance and license confirmation (see Section 6)
2739

40+
Standard disclosure template (recommended):
41+
42+
```text
43+
AI Usage Disclosure
44+
- substantial_ai_assistance: yes
45+
- scope: <design drafting | code drafting | refactor suggestions | tests | docs | other>
46+
- affected_files_or_subsystems: <high-level paths/modules>
47+
- human_verification: <checks run locally or in CI + pass/fail summary + contributor reviewed results>
48+
- performance_verification: <N/A or benchmark/regression evidence summary>
49+
- provenance_license_confirmation: <Apache-2.0-compatible provenance confirmed; no incompatible third-party code introduced>
50+
```
51+
2852
To protect privacy and enterprise security:
2953

3054
- 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
4973

5074
## 5. Verification Requirements
5175

52-
Every AI-assisted PR MUST provide verifiable evidence of local validation:
76+
Every AI-assisted PR MUST provide verifiable evidence of local or CI validation:
77+
78+
Definition of adequate human verification:
79+
80+
- The contributor personally runs the relevant checks locally or in project CI and reviews the results.
81+
- Verification includes concrete evidence (exact commands and pass/fail outcomes), not only claims.
82+
- Verification covers the changed behavior with targeted tests where applicable.
83+
- For protocol or performance-sensitive changes, verification includes the required compatibility tests and/or benchmark/regression evidence.
5384

5485
- Confirmation that contributor performed line-by-line self-review of AI-assisted code changes
55-
- Build/lint/test commands run locally
86+
- Build/lint/test checks run locally or in CI
5687
- Targeted tests for changed behavior
5788
- Results summary (pass/fail and relevant environment context)
5889

@@ -90,7 +121,7 @@ Maintainers MAY close or return PRs that materially fail project standards, incl
90121

91122
- Contributor cannot explain key implementation logic
92123
- Missing required disclosure for substantial AI assistance
93-
- Missing verification evidence for changed behavior
124+
- Missing or inadequate human verification evidence for changed behavior
94125
- Redundant implementation of existing utilities without clear necessity
95126
- Introduction of dead code, unused helpers, or placeholder abstractions without justification
96127
- Protocol or performance claims without reproducible evidence

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ Key points:
3333

3434
- AI tools are allowed as assistants, but contributors remain fully responsible for all submitted changes.
3535
- AI-assisted code must be reviewed carefully line by line before submission, and contributors must be able to explain and defend it during review.
36-
- For substantial AI assistance, provide privacy-safe disclosure in the PR and complete the AI checklist in the PR template.
37-
- Include human verification evidence (for example build/lint/test commands and results), and add/update tests and specs where required.
36+
- 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.
37+
- Include adequate human verification evidence (for example exact build/lint/test commands and pass/fail outcomes), and add/update tests and specs where required.
3838
- For protocol/type-mapping/wire-format or performance-sensitive changes, provide the required compatibility/performance validation evidence.
3939
- 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.
4040

0 commit comments

Comments
 (0)