知识卡片:SWE Refactor Bench——编码智能体能否完成长周期、全仓库栈迁移?
英文标题:SWE Refactor Bench: Can Coding Agents Complete a Long-Horizon, Whole-Repository Stack Migration?
英文关键词(根据正文提取):coding agents; whole-repository migration; long-horizon; technical debt; benchmark evaluation
一句话结论
现有编码智能体在“修 bug”上能力提升,但还不能可靠地自主完成整仓库技术栈迁移。SWE Refactor Bench 的 520 次前沿模型运行中,只有 28 次(5.4%)通过全部三阶段评估;最佳模型 claude-opus-5 得分为 47.0/100,20 个任务中有 13 个没有任何被接受解。
事件概述或研究问题
- 现代软件系统长期积累技术债,技术栈迁移成本高且大多依赖人工。
- 研究问题:编码智能体能否像修 bug 一样,自主完成长周期、全仓库的栈迁移?
- 指出已有评测基准的“Blindness”问题:它们只看行为正确性,不检查迁移是否真的发生,所以智能体可以复制原始实现来让测试通过。
- 为此提出 SWE Refactor Bench:包含 20 个全仓库迁移任务,覆盖 4 类技术债。
方法/产品要点
SWE Refactor Bench 使用三阶段评估协议:
- 迁移审计(Migration Audit):验证迁移确实发生,而非复制原实现。
- 行为测试(Behavioural Tests):用固定测试套件检查行为正确性。
- 智能体验证(Agentic Verification):由 6 个独立编码智能体生成针对性测试,检测隐藏行为差异。
实验设置:8 个前沿模型、26 种模型-努力配置,共 520 次运行。
主要结果或产业意义
- 全部通过率极低:520 次运行仅 28 次(5.4%)通过三阶段;20 个任务中 13 个无接受解。
- 迁移完整性与行为正确性是两种不同能力:少数运行通过“跳过迁移”保持行为,会在迁移审计阶段被拦下;大多数运行尝试迁移但破坏了行为,会在行为测试阶段被拦下。
- 智能体难以做到完美迁移:340 次通过迁移审计的运行中,58% 能达到固定检查项的 99%,但只有 26% 达到 100%。
- 迁移类别差异明显:构建工具链重写得分为 31.4,语言重写只有 5.6。
- 产业意义:当前前沿模型尚不足以替代人工完成整仓库技术债迁移;该基准可作为开发“可靠迁移型编码智能体”的测试场。
为什么重要
- 它把“代码是否真的迁移了”和“行为是否正确”分开评估,弥补了现有编码基准只看测试是否通过、从而被“复制原实现”作弊的盲区。
- 在长程智能体研究脉络中,它提供了一条可复用的严格评测路径:迁移审计 + 行为测试 + 智能体生成测试。
- 对后续研究而言,提高 99% 到 100% 的“最后一公里”表现,以及针对语言重写等低分类得分的改进,是关键方向。
与既有脉络的关系
已有相关卡片分别涉及长程智能体的训练策略(CompactionRL)、记忆机制(主动记忆代理)和回合级奖励分配(TRACE)。本条不是新的训练方法,而是一个面向“长周期、全仓库技术债迁移”的评测基准;增量信息是:评测应同时验证“迁移发生”与“行为正确”,并给出了当前前沿模型在该严格评测下的基线结果。
局限与不确定性
- 摘要未列出 4 类技术债具体是哪四类,待核实。
- 20 个迁移任务的具体来源、仓库规模和迁移类型未见细节,待核实。
- “47.0/100”的评分公式和“模型-努力配置”的具体含义,原文摘要未展开,待核实。
- 三阶段评估中人工参与程度、Agentic Verification 的生成质量与成本,待核实。
可用于图书/PPT/简报的角度
- “测试通过 ≠ 迁移完成”:用 Blindness 现象作为引入,说明为什么现有基准会高估编码智能体。
- “最后一公里落差”:99% 检查项通过率与 100% 通过率之间的巨大差距。
- “不同技术债迁移难度不均”:构建工具链重写 vs 语言重写的能力差异。
- “如何评估一个长程智能体真的完成了任务”:三阶段协议可作为案例。
原始材料
- 英文标题:SWE Refactor Bench: Can Coding Agents Complete a Long-Horizon, Whole-Repository Stack Migration?
- arXiv ID: 2608.23564v1
- URL: https://arxiv.org/abs/2608.23564v1
- PDF URL: https://arxiv.org/pdf/2608.23564v1
- Authors: Deyao Hong, Yizhe Chi, Wenyi Li, Xiaoqiu Wang, Mingju Gao, Kaisen Yang, Bingxiang He, Youjie Zheng, Calvin Xiao, Qinhuai Na
- Published/Updated: 2026-08-24T17:59:04Z
- Categories: cs.CL, cs.AI, cs.SE
原文摘要(英文):
Modern software systems accumulate technical debt over decades of development, which makes migration expensive and largely manual. As coding agents become increasingly capable at bug fixing, can they autonomously perform such migrations? Existing benchmarks cannot answer this question because they evaluate only behavioural correctness, not whether the migration actually occurred. This leads an easy hack: agents copy the original implementation to make tests pass. We call this Blindness. To address this problem, we introduce SWE Refactor Bench, a benchmark comprising 20 whole-repository migrations, covering 4 kinds of technical debt. A three-stage evaluation protocol measures both migration completeness and behavioural correctness. (1) Migration Audit verifies that the migration occurred. (2) Behavioural Tests measure correctness with a fixed test suite. (3) Agentic Verification uses 6 independent coding agents to generate targeted tests for hidden behavioural differences. Across 520 runs from 8 frontier models and 26 model-effort configurations, only 28 of 520 runs (5.4%) pass all three stages, 13 of the 20 tasks receive no accepted solution, and the best model (claude-opus-5) scores 47.0/100. Migration completeness and behavioural correctness are distinct abilities: a few runs preserve behaviour by skipping the migration and are stopped at Migration Audit; most attempt it and break behaviour, and are stopped at Behavioural Tests. Agents cannot deliver a perfect migration: among the 340 runs that pass Migration Audit, 58% reach 99% of the fixed checks, yet only 26% reach 100%. Agent capability differs across migration categories: agents score 31.4 on build toolchain rewrites but only 5.6 on language rewrites. Together, these findings position SWE Refactor Bench as a rigorous testbed for developing coding agents for reliable whole-repository migrations.