From Repositories to Training Environments: Scaling Long-Horizon Coding Agents with Environment Evolution Loop

Researchers from IQuest Research, Beihang University and Shanghai Jiao Tong University present RepoFactory, which converts real repositories into 10,159 verifiable environments where an agent must build a complete project from a language specification.
Ask this paper
Task. Each environment asks the agent to build a full, working repository from scratch given a specification, verified by tests. This is longer-horizon than issue-fixing tasks.
Environment Evolution Loop. A construction agent revises the oracle implementation, specification and tests to maximize a multiplicative objective of validity, structural coupling and implementation scope. These proxies give feedback without having a model solve each candidate task.
Results. Training Qwen3.5-35B-A3B on the environments gives RepoHorizen-35B-A3B, which gains 22.6 points on NL2Repo-Bench and 8.5 points on average across five long-horizon coding and agentic benchmarks.
Effect of evolution. Without the evolution loop the gains are 17.5 and 6.4 points, so environment evolution adds 5.1 and 2.1 points. The loop also recovers repositories whose first conversion failed. Coverage is currently mostly Python.
Abstract
Training coding agents for long-horizon tasks requires environments with verifiable feedback. Existing pipelines often follow a linear process that ends with validation, establishing usability but providing little guidance on improving training value. Recursive self-improvement (RSI) often requires model rollouts or model training followed by downstream evaluation, with costs and feedback delays amplified on long-horizon tasks. How can we use timely, reliable proxy signals to improve training value and synthesize environments at scale? We present RepoFactory, an automated pipeline that converts real repositories into verifiable environments where agents build complete projects from scratch given a language specification. Its Environment Evolution Loop optimizes a multiplicative objective combining validity, structural coupling, and implementation scope through proxy feedback. RepoFactory produces 10,159 environments across 17 software domains. Training Qwen3.5-35B-A3B on these environments yields RepoHorizen-35B-A3B, which achieves gains of 22.6 percentage points on NL2Repo-Bench and 8.5 points on average across five benchmarks covering long-horizon coding and agentic tasks in real-world production settings, compared with 17.5 and 6.4 points without environment evolution. These results highlight the training value of RepoFactory environments and the additional gains from the Environment Evolution Loop.