Functionality-correct repository setup aims to configure execution environments (e.g., dependencies, build scripts) to successfully execute a repository's documented features. It presents significant challenges due to diverse, repository-specific failures, including dependency incompatibilities, missing toolchains, incomplete installations, and verification-strategy mismatches. Existing LLM agents struggle to robustly resolve these issues, specifically failing to support (1) cross-repository experience transfer, (2) multi-step trial-and-repair under non-invertible state changes, and (3) robust verification of setup outcomes to distinguish setup-induced failures from repository bugs. To address this, we introduce SetupX, an experiential learning-based setup framework. First, we construct a Self-Evolving Experience Representation (XPU), a dual-modality knowledge unit encoding setup signals, textual guidance, executable actions to dynamically transfer verified environment fixes to unseen repositories. Second, we employ Experience-Augmented Speculative Execution backed by a LIFO Docker snapshot stack, enabling the agent to proactively trial fixes and safely roll back to known-good states. Third, we introduce a Prosecutor-Judge Verification Protocol that separates evidence collection from final judgment, enabling more reliable setup verification beyond superficial build-time metrics. Evaluation results on carefully-crafted benchmarks show SetupX achieves highest performance (e.g., 92% pass rate) and outperforms the strongest baseline by over 19%. Crucially, SetupX excels in complex multi-repository setup requiring coordinating multiple interconnected services across different containers. The code repository is available at https://github.com/OpenDataBox/SetupX.
翻译:功能正确的仓库设置旨在配置执行环境(例如依赖项、构建脚本),以成功执行仓库文档中记载的功能。由于存在多样化的、针对特定仓库的失败,包括依赖不兼容、缺少工具链、安装不完整以及验证策略不匹配,该任务面临重大挑战。现有的大语言模型代理难以鲁棒地解决这些问题,具体表现在无法支持:(1)跨仓库经验迁移,(2)在不可逆状态变更下的多步试错修复,以及(3)对设置结果进行鲁棒验证以区分设置引发的失败与仓库自身缺陷。为此,我们提出了SetupX——一种基于经验学习的设置框架。首先,我们构建了一种自进化经验表示(XPU),这是一种双模态知识单元,编码了设置信号、文本指导和可执行动作,能够将已验证的环境修复方案动态迁移至未见过的仓库。其次,我们采用由后进先出(LIFO)Docker快照栈支撑的经验增强推测执行,使代理能够主动尝试修复手段,并在必要时安全回滚至已知良好状态。第三,我们引入了一种检察官-法官验证协议,该协议将证据收集与最终判决相分离,实现了超越表面编译时度量指标的更可靠设置验证。在精心设计的基准测试上的评估结果表明,SetupX取得了最高性能(例如,92%的通过率),并以超过19%的幅度优于最强基线。关键的是,SetupX在需要跨多个容器协调多种互联服务的复杂多仓库设置任务中表现出色。代码仓库可在https://github.com/OpenDataBox/SetupX获取。