arXiv:2606.17099cs.SEcs.AI2026-06

用契约提升AI代码审查可读性,代价是多花13%算力和38%时间。

Software Delegation Contracts: Measuring Reviewability in AI Coding-Agent Work

  • 设计带证据链的代码委托契约,强制生成审查所需信息。
  • 契约使审查依据更充分,模糊度下降,但未提升代码正确性。
  • 适合关注代码可审计性的研发团队或高可靠性系统项目。

AI代码代理越来越多地接受软件任务,在限定权限下修改仓库并提交工作包供审查。已有研究提出软件委托契约(包含任务、权限、返回成果与验收上下文)作为分析单位,但未量化其影响。本文报告一项受控试点研究,评估显式委托契约在代码代理中的应用。构建了一个无依赖的TypeScript API任务环境,含预设缺陷与文档缺失,设计了十个跨五个类别的任务,对两种模型层级在三种条件下执行64次:真实问题风格提示、显式契约、带强制证据包的契约。每项运行通过隐藏验收测试、变异检测与范围分析评分,并由三位独立、条件盲审的模型评审员按固定量表评审,共完成192次评审。结果显示,显式契约未改善客观任务结果:全部64次运行通过隐藏验收测试,无范围违规。但显著提升了审查可读性:22/30组对比中证据充分性提升,无恶化(5分制+0.83,p<0.0001,Cliff's delta=0.66);评审模糊度下降(p=0.035);变更文件列表、已知限制、残余风险及评审清单仅在契约要求时出现。契约增加13%代理令牌消耗与38%实际耗时,弱模型层级影响更大。在小规模任务中,委托契约换取的是审查可读性而非正确性。

原文摘要 · Abstract (English)

AI coding agents increasingly accept assigned software tasks, modify repositories under bounded authority, and return work packages for review. Prior work proposed the software delegation contract, covering the task, authority, returned work package, and acceptance context, as the unit of analysis for delegated coding work, but did not measure its effects. This paper reports a controlled pilot study of explicit delegation contracts for coding agents. We built a dependency-free TypeScript API task environment with seeded defects and documentation gaps, authored ten tasks across five families, and ran 64 agent executions across two model tiers under three conditions: a realistic issue-style prompt, an explicit delegation contract, and a contract with a required evidence bundle. Each run was scored with hidden acceptance tests, mutation checks, and scope analysis, then reviewed by three independent condition-blinded model-based reviewers using a fixed rubric, for 192 reviews. Explicit contracts did not improve objective task outcomes: all 64 runs passed hidden acceptance checks, with zero scope violations. They did improve reviewability. Evidence sufficiency improved in 22 of 30 paired comparisons and worsened in none (+0.83 on a 5-point scale, p < 0.0001, Cliff's delta = 0.66); reviewer ambiguity decreased (p = 0.035); changed-file lists, known-limitations sections, residual-risk sections, and reviewer checklists appeared mostly or only when demanded by the contract. Contracts cost +13% agent tokens and +38% wall-clock time, with larger effects for the weaker model tier. On these small tasks, delegation contracts bought reviewability rather than correctness.

AI编程代码审查可信代理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。