将仓库初始化知识固化为可复用的代理契约,提升开发效率。
BootstrapAgent: Distilling Repository Setup into Reusable Agent Knowledge

- 通过多代理协作提取并结构化仓库配置经验,生成可验证的 .bootstrap 合约
- 在三个基准上实现92.9%成功率,下游代理调用减少25.9%,构建时间降22.3%
- 适合需要频繁处理陌生代码库的自动化开发工具或智能编码助手
代码代理在帮助开发者使用陌生仓库时日益重要,但每次任务都需昂贵的前置步骤:将仓库配置为可用状态。该过程依赖大量试错探索,而获得的知识——如依赖项解决策略、修复方法——仅存在于单次对话中,无法复用。为此,我们将仓库启动问题建模为可复用的启动知识问题,提出 BootstrapAgent 多代理框架,将探索中发现的启发式规则提炼为持久、可验证、代理可用的 .bootstrap 合约。通过证据提取、结构化规划、基于 Docker 的确定性验证和追踪驱动修复,BootstrapAgent 生成涵盖环境设置、诊断检查、最小验证及累积修复知识的合约。我们进一步提出温修复与干净重放机制,加速迭代调试而不牺牲冷启动可重现性;以及增量修复与合理性校验,防止奖励劫持。在三个基准上的实验表明,BootstrapAgent 达到 92.9% 成功率,较基线提升超 10%,同时减少下游代理 25.9% 的令牌使用量和 22.3% 的构建时间。代码已开源。
原文摘要 · Abstract (English)
Code agents increasingly help developers work with unfamiliar repositories, but every such task depends on a costly prerequisite: bootstrapping the repository into a usable development state. This process requires substantial trial-and-error exploration, yet the resulting knowledge--resolved dependencies, repair strategies--stays trapped in a single conversation, unavailable to future agents. We therefore formulate repository bootstrapping as a reusable startup knowledge problem and introduce BootstrapAgent, a multi-agent framework that distills the heuristics discovered during bootstrap exploration into a persistent, verifiable, agent-consumable .bootstrap contract. Through evidence extraction, structured planning, deterministic Docker-based verification, and trace-driven repair, BootstrapAgent generates a contract covering environment setup, diagnostic checks, minimal verification, and accumulated repair knowledge. We further propose warm repair with clean replay to accelerate iterative debugging without sacrificing cold-start reproducibility, and a delta repair with sanity check to prevent reward hacking. Experiments on three benchmarks show that BootstrapAgent achieves a 92.9% success rate, outperforming the baseline by over 10% while reducing downstream agent token usage by 25.9% and build time by 22.3%. Our code is available at https://github.com/Vossera/BootstrapAgent.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。