Haskell编译器Glasgow Haskell Compiler(GHC)的维护者近期正式确立了针对大语言模型(LLM)辅助代码贡献的具体政策,旨在平衡技术效率与维护者资源,并防止出现让项目付出更高审查成本而贡献者单方面获益的“提取式贡献”1。鉴于GHC目前面临超过6,500个开放工单且维护者时间是主要瓶颈,该政策采取了务实的中间路线,既未完全禁止AI工具的使用,也严格把控审查质量与责任归属1。新规包含四个强制点和一个强烈偏好:P1优先人与社区;P2使合并请求易于审查;P3要求人类作者身份与完全责任;P4规定披露直接LLM生成内容;以及P5偏好自己撰写最终版本1。其中,P3明确要求人类作者必须对每一行提交的代码负全责且能解释其逻辑1。
在合规细节方面,政策明确规定若LLM生成了任何提交审查的代码、文档或测试,必须在Issue/MR描述及Commit Message中通过Assisted-By:行进行披露1。这一做法与Linux内核允许辅助但需签署DCO并标记Assisted-by的策略相似,但区别于Zig项目为保护新手成长而禁止AI生成贡献的立场,以及OpenJDK更为严格的排除态度1。实际案例显示,Sylvain Henry曾利用Claude Fable为“Coercion zapping”问题提供概念验证,随后由Sam Derbyshire进行重写和优化,这印证了AI在复杂编译器问题上应作为灵感来源而非独立解决者的角色定位1。此外,GHC核心人物Simon Peyton Jones指出,大量准确但泛滥的AI生成Bug报告已淹没了维护者,表明AI正在改变工作流的性质而不仅仅是提高速度1。
The maintainers of the Glasgow Haskell Compiler (GHC) have formalized a new policy governing contributions assisted by Large Language Models (LLMs), aiming to balance technical efficiency with the limited resources of project maintainers 1. The framework prioritizes human and community values, requires that merge requests remain easy to review, and mandates that human authors retain full responsibility for every line of code they submit 1. While the policy does not ban AI tools, it imposes strict disclosure requirements for directly generated content and expresses a strong preference for contributors to write the final versions themselves 1.
A central component of the regulation is the requirement for transparency regarding AI involvement. If an LLM generates any portion of code, documentation, or tests submitted for review, this fact must be disclosed in the issue or merge request description as well as in the commit message using an "Assisted-By:" line 1. This measure is designed to prevent "extractive contributions," where individual contributors benefit while the project incurs higher costs due to increased reviewer burden 1. Currently, GHC faces over 6,500 open tickets, making maintainer time the primary bottleneck for development 1. Simon Peyton Jones noted that accurate but voluminous AI-generated bug reports have begun to overwhelm maintainers, indicating that AI is altering the nature of workflows rather than simply increasing speed 1.
The policy represents a pragmatic middle ground compared to other major software projects' approaches to AI. For instance, Zig prohibits AI-generated contributions entirely to protect the learning process of newcomers, while OpenJDK maintains a stricter exclusionary stance 1. In contrast, the Linux kernel allows AI assistance provided that developers sign a Developer Certificate of Origin (DCO) and mark submissions with "Assisted-by" 1. To illustrate acceptable usage within GHC, a case study highlighted how Sylvain Henry used Claude Fable to create a proof-of-concept for a "Coercion zapping" problem, which was subsequently rewritten and optimized by Sam Derbyshire, demonstrating AI's role as a source of inspiration rather than an independent solver 1.
评论
还没有评论,欢迎留下第一条。