|
| 1 | +# AI Contribution Policy |
| 2 | + |
| 3 | +Apache Fory is a performance-critical foundational serialization framework with cross-language compatibility requirements. |
| 4 | +AI tools are welcome as assistants, but project quality, legal safety, and maintainability standards are unchanged. |
| 5 | + |
| 6 | +The key words MUST, MUST NOT, REQUIRED, SHOULD, and MAY are interpreted as described in RFC 2119. |
| 7 | + |
| 8 | +## 1. Core Principle |
| 9 | + |
| 10 | +- AI tools MAY assist contribution work. |
| 11 | +- AI tools MUST NOT replace contributor accountability. |
| 12 | +- The human submitter is responsible for correctness, safety, performance, and maintainability of all submitted changes. |
| 13 | +- AI-assisted code MUST be reviewed carefully by the contributor line by line before submission. |
| 14 | +- Contributors MUST be able to explain and defend design and implementation details during review. |
| 15 | + |
| 16 | +## 2. Disclosure (Privacy-Safe) |
| 17 | + |
| 18 | +For substantial AI assistance, PR descriptions MUST include a short `AI Usage Disclosure` section. |
| 19 | + |
| 20 | +Required disclosure fields: |
| 21 | + |
| 22 | +- Whether substantial AI assistance was used (`yes` or `no`) |
| 23 | +- Scope of assistance (for example: design drafting, code drafting, refactor suggestions, tests, docs) |
| 24 | +- Affected files or subsystems (high-level) |
| 25 | +- Human verification performed (commands/tests/benchmarks executed) |
| 26 | +- Provenance and license confirmation (see Section 6) |
| 27 | + |
| 28 | +To protect privacy and enterprise security: |
| 29 | + |
| 30 | +- Contributors are NOT required to disclose model names, provider names, private prompts, or internal workflow details. |
| 31 | +- Maintainers MAY request additional clarification only when necessary for legal or technical review. |
| 32 | + |
| 33 | +## 3. Human Communication Requirements |
| 34 | + |
| 35 | +The following MUST be human-authored (translation and grammar correction tools are acceptable): |
| 36 | + |
| 37 | +- Review responses |
| 38 | +- Design rationale and tradeoff discussion |
| 39 | +- Risk analysis and production impact explanation |
| 40 | + |
| 41 | +Generated filler text, evasive responses, or content that does not reflect contributor understanding may result in PR closure. |
| 42 | + |
| 43 | +## 4. Scope Alignment Before Implementation |
| 44 | + |
| 45 | +For non-trivial changes (especially architecture/protocol/performance-sensitive work), contributors SHOULD align scope in an issue or discussion before implementation. |
| 46 | + |
| 47 | +This expectation applies to all contributors, whether AI-assisted or not. |
| 48 | +For AI-assisted non-trivial work without prior alignment, maintainers MAY request scope alignment before continuing review. |
| 49 | + |
| 50 | +## 5. Verification Requirements |
| 51 | + |
| 52 | +Every AI-assisted PR MUST provide verifiable evidence of local validation: |
| 53 | + |
| 54 | +- Confirmation that contributor performed line-by-line self-review of AI-assisted code changes |
| 55 | +- Build/lint/test commands run locally |
| 56 | +- Targeted tests for changed behavior |
| 57 | +- Results summary (pass/fail and relevant environment context) |
| 58 | + |
| 59 | +Additional REQUIRED checks for Fory-critical paths: |
| 60 | + |
| 61 | +- Protocol, type mapping, or wire-format changes: |
| 62 | + - Update relevant docs under `docs/specification/**` |
| 63 | + - Add or update cross-language compatibility tests where applicable |
| 64 | +- Performance-sensitive changes (serialization/deserialization hot paths, memory allocation behavior, codegen, buffer logic): |
| 65 | + - Provide benchmark or regression evidence |
| 66 | + - Justify any measurable performance or allocation impact |
| 67 | + |
| 68 | +Claims without evidence may be treated as incomplete. |
| 69 | + |
| 70 | +## 6. Licensing, Copyright, and Provenance |
| 71 | + |
| 72 | +Contributors MUST follow ASF legal guidance and project licensing policy, including: |
| 73 | + |
| 74 | +- ASF Generative Tooling Guidance |
| 75 | +- ASF third-party licensing requirements |
| 76 | +- Apache-2.0 compatibility obligations |
| 77 | + |
| 78 | +Contributors MUST ensure: |
| 79 | + |
| 80 | +- No incompatible third-party code is introduced |
| 81 | +- Reused material has compatible licensing and required attribution |
| 82 | +- AI-generated output does not include unauthorized copyrighted fragments |
| 83 | + |
| 84 | +If provenance is uncertain, contributors MUST remove or replace the material before submission. |
| 85 | +Maintainers MAY request provenance clarification when needed. |
| 86 | + |
| 87 | +## 7. Quality Gate and Non-Acceptance Conditions |
| 88 | + |
| 89 | +Maintainers MAY close or return PRs that materially fail project standards, including: |
| 90 | + |
| 91 | +- Contributor cannot explain key implementation logic |
| 92 | +- Missing required disclosure for substantial AI assistance |
| 93 | +- Missing verification evidence for changed behavior |
| 94 | +- Redundant implementation of existing utilities without clear necessity |
| 95 | +- Introduction of dead code, unused helpers, or placeholder abstractions without justification |
| 96 | +- Protocol or performance claims without reproducible evidence |
| 97 | +- Large unfocused changes with unclear scope or ownership |
| 98 | + |
| 99 | +This is not a ban on AI usage; it is a quality and maintainability gate. |
| 100 | + |
| 101 | +## 8. Review and Enforcement Process |
| 102 | + |
| 103 | +Before merge, maintainers MAY request: |
| 104 | + |
| 105 | +- Additional tests, benchmarks, or spec updates |
| 106 | +- PR split into smaller verifiable commits |
| 107 | +- Clarification of technical rationale, provenance, or licensing |
| 108 | +- Rework of sections that do not meet standards |
| 109 | + |
| 110 | +Maintainers MAY close PRs that remain non-compliant after feedback. |
| 111 | + |
| 112 | +Any long-term contribution restrictions MUST follow Apache project governance and community process, and SHOULD be documented with clear rationale. |
| 113 | + |
| 114 | +## 9. Contributor Checklist (for AI-Assisted PRs) |
| 115 | + |
| 116 | +- [ ] I can explain and defend all important changes. |
| 117 | +- [ ] I reviewed AI-assisted code line by line before submission. |
| 118 | +- [ ] I provided `AI Usage Disclosure` without exposing private/internal details. |
| 119 | +- [ ] I ran relevant local build/lint/test checks and reported outcomes. |
| 120 | +- [ ] I added/updated tests and specs where required. |
| 121 | +- [ ] I validated protocol/performance impacts with evidence when applicable. |
| 122 | +- [ ] I verified licensing and provenance compliance. |
| 123 | + |
| 124 | +## 10. Governance Note |
| 125 | + |
| 126 | +This policy complements, but does not replace, existing ASF and Apache Fory governance, contribution, and legal policies. |
| 127 | +If conflicts arise, ASF legal and project governance rules take precedence. |
0 commit comments