arXiv:2609.04898cs.CLSep 2026

Manuscript Offprint

arXiv:2609.04898

RefactorPlatform: An Open-Source Harness for Controlled Evaluation of Repository-Scale Refactoring Agents

Aziz Ben Amor, Drish Mali, Mann Acharya, Vijayasri Iyer, Sébastien Bratières

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Repository-scale refactoring requires coding agents to propagate a single change across many interdependent files without altering program behavior, yet to our knowledge no existing harness isolates the design choices that determine agent success on this task. We present RefactorPlatform, an open-source evaluation harness that holds the environment fixed and varies each design axis explicitly: model backbone (via OpenRouter and GitHub Copilot CLI), execution regime (baseline, retrieval-augmented, and multi-agent), and prompt specificity. Each run executes in an isolated workspace with live terminal streaming, per-task logging of tokens, diffs, and transcripts, AST-based verification, and exportable telemetry for audit and reproduction. Demonstrating the platform on 100 multi-file RefactorBench tasks across four model families, we illustrate the analyses it supports: AST-aware chunking outperforms naive token-window chunking by 25–30 percentage points (pp) across prompt modes, whereas naive retrieval falls below the retrieval-free baseline; a lean retrieval-augmented single agent (86%) beats multi-agent execution (66%) on matched tasks, with no task passing under delegation that fails under retrieval; and retrieval's accuracy gains absorb its token overhead, leaving cost per successful refactoring unchanged. RefactorPlatform is open-sourced to make refactoring-agent evaluation reproducible and auditable.

1 Introduction

Refactoring, “improving the internal structure of software without altering its external behavior” (Fowler et al., 1999), has shifted from localized IDE transformations to repository-scale campaigns that propagate a single change across many interdependent files, where manual propagation is error-prone and a persistent source of technical debt (Fernandes et al., 2020). Function-level benchmarks reveal little about this regime (Liu et al., 2023), and while repository-scale suites like SWE-bench better reflect production engineering (Jimenez et al., 2023), refactoring imposes a stricter requirement: edits must be behavior-preserving while still propagating across files. RefactorBench targets exactly this setting with AST-verified multi-file tasks (Gautam et al., 2025), and SWE-Refactor (Xu et al., 2026) verifies developer-written refactorings through compilation, tests, and RefactoringMiner (Tsantalis et al., 2022).

Current agents remain inadequate at this scale (Siddeq et al., 2025; Guan et al., 2025). A single agent perceives only a small slice of the repository at any moment, and most Retrieval-Augmented Generation (RAG) pipelines are example-based, retrieving historical snippets rather than performing structural discovery over the live code a refactoring must touch (Xu et al., 2026), despite evidence that AST-aware chunking retrieves more coherent units (Zhang et al., 2025). The result is structural blindness: systems propose a change but miss sites where it must be applied. A common response is adding more agents in specialized roles (He et al., 2024; Qian et al., 2023; Phan et al., 2024; Dong et al., 2025), yet the evidence is mixed: multi-agent systems lose to single agents on executability and consistency while adding handoffs, tokens, and drift (Yin et al., 2025; Guo et al., 2025). Evidence on repository-scale refactoring specifically remains fragmented. Mature harnesses exist for issue resolution: SWE-agent defines agent–computer interfaces (Yang et al., 2024), OpenHands provides an open platform with a pluggable evaluation harness (Wang et al., 2025b), and Agentless (Xia et al., 2025) shows that lean pipelines can rival agentic scaffolds. To our knowledge, however, no compa-

∗^{*}Equal contribution.

†^{\dagger}Corresponding author: vijayasri.iyer@picampus-school.com

github.com/PiSchool/refactor-platform rable infrastructure isolates retrieval, prompting, orchestration, and model routing for repository-scale refactoring under controlled, auditable logging.

We close this gap with RefactorPlatform, an open-source evaluation harness that holds the environment fixed and varies each design axis explicitly, across three cumulative regimes (Section 2.2): a baseline terminal assistant (S1S_1), a retrieval-augmented configuration (S2S_2), and an orchestrated multi-agent workflow (S3S_3). The platform targets researchers benchmarking coding agents and practitioners auditing agent configurations before deployment. Figure 1 shows the dashboard view of a completed 100-task campaign. The platform lets an operator answer questions like Q1: how much does AST-aware chunking improve pass rates over baseline execution and token-window chunking? Q2: does multi-agent execution recover what it costs, relative to lean single-agent retrieval? Q3: how far does structural retrieval compensate for under-specified prompts?

Our contributions are: (i) RefactorPlatform isolates per-task workspaces, four independently configurable design axes, live terminal streaming, and exportable per-task telemetry; (ii) an AST verification pipeline, AST-based unit tests for Python and extraction-compilation-test-RefactoringMiner gates for Java, so that reported pass rates reflect behavior-preserving change rather than plausible-looking diffs; and (iii) a 100-task demonstration campaign across four model families illustrating the analyses the platform enables: a prompt-sensitivity map, a context-layer comparison in which AST-aware retrieval dominates LSP diagnostics, and a best-case pass rate of 86% at $0.13 per success.