Manuscript Offprint

arXiv:2610.40256

When Requirements Interact: Scaling Long-Horizon Coding via Interdependent Specifications

Yishuo Cai, Minzheng Wang, Liang Zhao, Linghao Zhang, Lei Li, Shicheng Li, Xu Sun, Fuli Luo

Abstract

To succeed in real-world long-horizon software development, coding agents must satisfy multidimensional task specifications, such as interface compatibility and error handling, and do so without breaking existing dependencies. However, current works lack specification in both quantity and diversity, often emphasizing primary goals while ignoring complex constraints. Synthesizing tasks to bridge this gap presents two challenges: naively adding specifications risks reducing tasks to trivial checklists rather than compelling joint reasoning, and verifying these subtle interactions risks overlooking hidden flaws or rejecting valid alternatives. To address these challenges, we introduce CODESPECWEAVE, a framework for synthesizing tasks with rich, interdependent specifications. Grounded in real developer seeds, a synthesis agent iteratively develops both coupled task requirements and executable tests, while a review agent audits solution trajectories from multiple models to guarantee test reliability. Using this pipeline, we construct 4,670 training tasks across 2,865 repositories. Applying Reinforcement learning on these tasks significantly improves performance over the base model on DeepSWE-v1.1, largely outperforming existing baselines. Furthermore, we curate CODESPECWEAVE-BENCH, a rigorous benchmark comprising 100 tasks and 1,044 specifications, which clearly separates frontier models and reveals significant headroom in handling interdependent engineering constraints.

1 Introduction

Recent advances in large language models (LLMs) have enabled coding agents to explore repositories, modify code, execute tests, and iteratively refine their solutions (Yang et al., 2024; Jimenez et al., 2024; Deng et al., 2026; Tan et al., 2026b). As these agents navigate the increasing complexity of real-world software architectures, they must implement changes without breaking behavior that other components already depend on (Jimenez et al., 2024; Deng et al., 2026). In practice, these expectations span multiple requirements, such as interface compatibility, state consistency, and error handling (Han et al., 2024; Ruan et al., 2025). Together, they form concrete task specifications that an agent must satisfy throughout exploration, coding, and testing.

∗^{*}Equal contribution. †^{\dagger}Corresponding authors. ‡^{\ddagger}Work done during an internship at Xiaomi.

Distribution comparison

Figure

Example comparison

Figure 1 Comparison of task specifications across datasets. Top: Mean extracted specifications and distinct behavioral categories per task across existing SWE training datasets and CODESPECWEAVE, with 95% bootstrap confidence intervals. Category counts follow the taxonomy in Table 5. Bottom: Example task structures. Prior datasets typically contain few independent rules (left), whereas CODESPECWEAVE tasks feature multiple interdependent specifications tied together by shared execution contexts and lifecycle constraints (right).

Developing this capability requires a large number of executable tasks that encompass these diverse engineering requirements. Existing works typically construct executable tasks by mining issues and pull requests (Pan et al., 2025), with limited attention to the role and properties of task specifications. Our empirical analysis reveals that existing data fall significantly short in both specification density and structural diversity (Figure 1, top), often emphasizing the primary development goal while leaving compatibility, state consistency, and error handling unaddressed. Consequently, agents trained on such partial specifications often fail in practice, as they struggle to satisfy the intricate constraints inherent in real-world repositories. This deficiency underscores the need for a scalable pipeline to synthesize tasks grounded in realistic and diverse specifications.

However, synthesizing such tasks presents two connected challenges. First, purely adding specifications may inadvertently reveal solution paths (Kim et al., 2026) or reduce the task to a checklist of independent edits. Specification design should therefore organize requirements into interdependent specifications where individual implementation choices constrain one another, compelling agents to coordinate across requirements through joint reasoning to achieve globally coherent implementations (Figure 1, bottom). Second, verifying such interdependent specifications is uniquely challenging: the subtle interactions among requirements make it easy for tests either to miss hidden flaws (Sun et al., 2026; Tan et al., 2026a) or to reject valid solutions (Chowdhury et al., 2024). Reliable verification requires strict alignment with both individual requirements and their interactions, while accommodating different implementations that satisfy them.

To this end, we introduce CODESPECWEAVE, a framework for synthesizing coding tasks with rich, interdependent specifications. Grounded in specification seeds derived from real developers, a synthesis agent explores the repository context and develops the task requirements and executable test suites together in an iterative loop, intentionally designing coupled constraints that require simultaneous satisfaction while refining the tests to strictly align with them. To ensure test reliability, a review agent further examines the solution trajectories and patches from multiple models, filtering out tests that accept incomplete implementations or reject valid alternatives. Using this pipeline, we construct 4,670 training tasks across 2,865 repositories. Applying Reinforcement learning on these tasks significantly improves performance over the base model on DeepSWE-v1.1. In addition, we curate CODESPECWEAVE-BENCH through careful manual review, compiling 100 tasks with 1,044 specifications to evaluate coding agents under interdependent specifications. Benchmarking leading models clearly separates their capabilities, revealing shared failure modes and significant room for improvement.

Our contributions are as follows:

• We introduce CODESPECWEAVE, a synthesis framework that builds on real developer specification seeds to generate coding tasks with interdependent specifications and reliable verifiers.

• We construct a scalable training set of 4,670 tasks across 2,865 repositories and demonstrate its effectiveness through reinforcement learning, yielding substantial performance gains on DeepSWE-v1.1 over strong training baselines.

• We present CODESPECWEAVE-BENCH, a benchmark comprising 100 tasks with 1,044 specifications. Evaluations across leading coding agents reveal notable performance gaps and substantial headroom under interdependent requirements.

References (36)