arXiv(opens in a new tab)cs.SEOct 2026Cited by 3 papers on PaperVantage

Manuscript Offprint

arXiv:2610.22039

WEAVE: Weaving Real-World Code Evolution into Dependency-Structured Tasks for Benchmarking and Training Code Agents

Weihao Li, Zihang Xu, Zhongqiu Wang, Songwei Yu, Wenqiang Zhu, Yuechen Luo, Jingxuan Xu, Yanan Wu, Haoyang Huang, Ken Deng

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

Abstract

Real-world software engineering rarely consists of isolated changes. Features, migrations, and systematic fixes often unfold across multiple pull requests (PRs), requiring coordinated modifications across a repository. Yet most executable repository-level benchmarks retain a single issue or PR as the task unit, while existing multi-PR settings rely on coarse aggregation and structure-agnostic evaluation. This mismatch obscures dependencies among changes and limits progress measurement and learning signals for long-horizon code agents. We introduce WEAVE, a framework that transforms verified PR histories into executable, dependency-structured tasks. WEAVE leverages repository-calibrated typed change loci to organize related PRs into bounded DAGs and instantiate each as a unified executable task. We further introduce Graph Credit, a deterministic, test-grounded metric that measures dependency-consistent partial progress and supports dense, verifiable rewards for reinforcement learning. Experiments on task construction, agent evaluation, supervised fine-tuning, and reinforcement learning show that WEAVE yields coherent executable tasks, enables more faithful progress measurement than flat scoring, and provides effective supervision and verifiable rewards for training code agents.

1 Introduction

Executable repository-level benchmarks have increasingly become a central testbed for software engineering agents. SWE-bench and its variants pair a natural-language issue with a repository state and an executable test oracle, enabling standardized, verifiable evaluation of generated patches (Jimenez et al. 2023; Zan et al. 2025; Deng et al. 2025). Most benchmarks, however, retain a single issue or pull request (PR) as the basic task unit. This abstraction captures isolated bug fixes and localized features, but only a restricted portion of real software development. In practice, a single feature, migration, dependency upgrade, or systematic fix often evolves across multiple PRs. These changes may be sequential, branch in parallel, or converge through later integration. The missing abstraction is therefore not merely longer context or a larger patch, but the dependency structure connecting multiple changes into a coherent engineering objective. Figure 1 summarizes this mismatch between dependency-structured development, proxy-based task construction, and structure-agnostic credit assignment.

Figure

Figure 1: Real-world objectives span dependent PRs, but existing proxies obscure task structure and credit assignment. WEAVE constructs executable dependency-structured tasks for verifiable evaluation and rewards.

Recent work has moved beyond isolated PRs by grouping changes through release windows, temporal spans, explicit cross-references, or object-level dependencies (Thai et al. 2025; Chen et al. 2026; Jiang et al. 2026; Zhou et al. 2026). These efforts advance long-horizon software engineering, yet two coupled challenges remain. First, these aggregation signals are imperfect proxies for task coherence: temporal proximity can merge unrelated changes, explicit references are sparse, and coarse overlap is often dominated by frequently modified utilities, configuration files, or dependency manifests. Moreover, a related change set does not itself define a reproducible task with a valid base state, task specification, and executable oracle. Second, current evaluation poorly captures structured partial progress. Binary resolution ignores progress on unsolved tasks, while flat test- or PR-level aggregation overlooks dependencies and may over-credit downstream behavior built on incomplete upstream changes. The same issue weakens reinforcement learning: binary rewards are sparse, whereas patch-similarity and learned rewards may

∗^{*}These authors contributed equally.

†^{\dagger}Corresponding author.

Table 1: Comparison of executable software-engineering benchmarks Struct. denotes task structure retained for evaluation; Exec. indicates an executable oracle; and Train indicates available executable training data. ~ denotes partial support.

BenchmarkUnitConstructionStruct.Exec.CreditTrainLang.
SWE-bench VerifiedIssue-PRIssue linkedAtomic✓Binary-Py
Multi-SWE-benchIssue-PRIssue linkedAtomic✓Binary✓Multi
SWE-GymIssue-PRReal issuesAtomic✓Binary✓Py
SWE-EVORelease deltaRelease basedFlat✓Flat F2P-Py
SWE-CICommit spanEvolution spanSequence✓EvoScore-Py
SWE-MilestoneMilestoneCommit + LLMDAG✓Milestone-Multi
daVinci-AgencyPR chainExplicit referencesChain~-✓Multi
WEAVE (Ours)Coupled PRsTyped-locus couplingDAG✓Graph Credit✓Multi

not align with executable task semantics (Tao et al. 2025; Wei et al. 2025; Wang et al. 2026; Shum et al. 2025). Addressing these limitations requires a unified, code-grounded representation for executable task construction, dependency-aware evaluation, and verifiable learning signals.

We introduce WEAVE, a framework for weaving real-world code evolution into executable, dependency-structured tasks for benchmarking and training code agents. As illustrated in Figure 1, WEAVE starts from verified atomic PRs, identifies code-grounded relations through typed change loci calibrated by repository-local frequencies, and organizes related changes into bounded dependency DAGs. Each DAG is instantiated as a reproducible repository-level task with a unified specification and executable oracle, while remaining evaluator-side metadata unavailable to the agent. Beyond task construction, the DAG provides a common interface for measuring and learning from structured progress. We introduce Graph Credit, a deterministic and test-grounded metric that complements binary resolution by rewarding dependency-consistent partial completion. The same structure supports dense, verifiable rewards for reinforcement learning, while the constructed corpus provides long-horizon trajectories for supervised fine-tuning. WEAVE thereby unifies executable task construction, structure-aware evaluation, and agent training over realistic multi-PR software evolution.

To assess both the benchmarking and training utility of WEAVE, we conduct a four-part empirical study covering task construction, agent evaluation, supervised fine-tuning, and reinforcement learning. WEAVE yields 3200 training tasks and 300 held-out benchmark tasks spanning six programming languages. Its code-grounded aggregation produces more coherent task groupings and a higher executable-task yield than temporal and coarse-overlap baselines. Evaluations of eight software engineering agents further show that Graph Credit exposes structurally inconsistent credit obscured by flat scoring. Under matched supervised-token budgets, WEAVE-based supervision improves downstream agent performance, while graph-structured rewards outperform binary and flat-reward baselines. Together, these results establish dependency-structured tasks as a principled foundation for both evaluating and improving code agents.

Contributions. Our contributions are threefold:

  • Executable dependency-structured task construction. We introduce WEAVE, a framework that constructs bounded dependency DAGs from verified PR histories using repository-calibrated typed change loci, and instantiates each graph as a unified executable task.

  • Structure-aware evaluation and verifiable credit. We introduce Graph Credit, a deterministic, test-grounded metric for evaluating dependency-consistent partial progress. By conditioning credit on upstream resolution, it complements binary and flat scoring while providing a dense, verifiable signal for agent optimization.

  • Empirical validation for benchmarking and training. Extensive experiments show that WEAVE yields coherent executable tasks, captures progress missed by structure-agnostic evaluation, and provides effective supervision and verifiable rewards for training code agents.

References (6)

  • We extract fully qualified names (e.g., module.Class.method) to disambiguate identically named entities across files
  • This captures entities that do not correspond to function bodies but serve as cross-module interfaces
  • Each entry is represented as a dot-separated key path (e.g., server.http.timeout)
  • These capture contract-level changes that downstream implementations depend on
  • The first condition requires near-complete resolution of the task graph
  • The resulting effective upper bound is 150 turns, $75\%$ of the interaction cap