规范优先协议下AI智能体拆除717k行代码库核心架构不变量案例研究

HuggingFace Daily Papers(社区热门论文)·2026-08-12 08:00·13天前
AI 导读

一项案例研究显示,AI编程智能体在规范优先协议下成功拆除了717,725行TypeScript代码库中的核心生命周期不变量,全程无人工代码审查且无预存测试预言机。任务涉及189个文件,两笔提交共34,770行插入和16,422行删除,耗时三天,成本2,430美元。协议经14轮规范审计和17轮验证循环,修正201个缺陷后达到连续两轮零发现的收敛标准。

HuggingFace Daily Papers(社区热门论文)
61AI 编辑部评分,满分 100

规范优先协议下AI智能体拆除717k行代码库核心架构不变量案例研究

2026-08-12 08:00· 13天前
AI 导读

一项案例研究显示,AI编程智能体在规范优先协议下成功拆除了717,725行TypeScript代码库中的核心生命周期不变量,全程无人工代码审查且无预存测试预言机。任务涉及189个文件,两笔提交共34,770行插入和16,422行删除,耗时三天,成本2,430美元。协议经14轮规范审计和17轮验证循环,修正201个缺陷后达到连续两轮零发现的收敛标准。

This paper reports a single, fully instrumented case study of a large-scale architectural refactoring by an AI coding agent under a specification-first protocol, with no human review of the generated code and no pre-existing oracle to validate the target behaviour. The task, dismantling a central invariant across a large interdependent codebase, was assessed by the author as effectively infeasible through incremental refactoring, the kind of change that conventionally calls for a rewrite instead. Under the protocol described here, the agent completed it successfully. The system is a 717,725-line production TypeScript application across 3,648 files. The task required dismantling a core lifetime invariant: the guarantee that a UI panel remains open for the duration of an AI request. The target behaviour was that a streaming generation survives the closing of its panel and can be reattached, on reopening, to the same live stream with no loss or duplication. The protocol: formal specification by the agent, 14 refinement cycles auditing that specification against the source code, atomic implementation, a compile/test feedback loop, then 17 verification cycles auditing the code against the frozen specification. Across 31 audit passes, 201 defects were corrected before any human executed the program. The convergence criterion was empirical: two consecutive verification passes returning zero findings. The change touched 189 files (31 new); with the extraction phase, the two commits total 288 files, 34,770 insertions, 16,422 deletions. Across the first and roughly thirty later sessions, the software behaved as specified, no bug observed. Elapsed: three days; cost: USD 2,430. The full specification and raw session logs, 1,500+ pages in French, are published as evidence, allowing inspection of the process and submission to a language model for consistency checking.

来源:HuggingFace Daily Papers(社区热门论文)· arxiv.org