Hierarchical Specification-to-Patch Synthesis for Large-Scale Repository Changes
A modular planning framework that translates complex multi-file requirement sets into interface contract graphs and localized AST-level edit plans before generating code.
Time
Compute level
Resources
What the paper used
Prerequisites
Scope
The Gap
Section 6.2 and Section 6.3.1 analyze the Oracle-Spec condition and implementation bottleneck, showing that 56% of failed tests occur after requirements have already reached the agent.
“However, among failed F2P test nodes with linked requirements, 56% are assigned to implement: the requirement reached the agent, but the tested behavior remains unsatisfied.”
Limitation
Frontier models fail to translate known specifications into working implementations on large refactoring tasks (median 2,955 lines across 60 files), with Oracle-Spec providing full requirements upfront but failing to improve complete task success beyond 7.92%.
Proposed Solution
Develop a multi-phase implementation pipeline: first, parse the acquired or oracle requirements into an explicit symbolic dependency graph of interface signatures and contract invariants; second, perform static symbol resolution to map requirements to exact AST nodes across files; third, generate code edits sequentially within localized scopes while checking compiler and linter diagnostics at each step before moving to dependent modules.
Why This Matters
Overcoming the implementation bottleneck is necessary for whole-task completion, as even perfect requirement gathering leaves over 20-40% of test nodes unsatisfied in large-scale changes.
How to Get Started
How to test it: Compare the contract-graph synthesis pipeline against direct agent editing on SWE-CoWork under the Oracle-Spec setting; verify an increase in complete task pass rate over the 7.92% baseline, stopping if AST decomposition overhead causes timeouts on tasks with over 100 modified files.
- Set up tree-sitter parsers for the top 4 languages in the benchmark (JavaScript, Python, TypeScript, PHP) to extract dependency graphs of declarations.
- Build a pipeline component that maps informal specification sentences to affected classes and functions via semantic code search and static call graphs.
- Implement a staged code synthesizer that writes type stubs and interfaces first, runs build checks, and then fills method bodies.
- Evaluate on the 22 developer-tool and compiler tasks in SWE-CoWork to measure gains in F2P pass rate.
Suggested by AI. Adapt it to your setup.
Has This Been Done?
The idea of hierarchical repository-level repair is explored in 'MemRepair: Hierarchical Memory for Agentic Repository-Level Vulnerability Repair' and 'CodePlan: Repository-Level Coding using LLMs and Planning', which discuss sequential planning for code changes. However, these papers focus more on general planning or specific vulnerability repair rather than the exact proposed three-phase pipeline of symbolic dependency graph generation, AST-node mapping, and incremental linter-checked sequential synthesis.
- MemRepair: Hierarchical Memory for Agentic Repository-Level Vulnerability Repair · 2026 · 2 citations
- CodePlan: Repository-Level Coding using LLMs and Planning · 2024 · 310 citations
We searched OpenAlex and arXiv for “hierarchical code generation AST contract planning multi file” and “Hierarchical Specification-to-Patch Synthesis for Large-Scale Repository Changes” and an AI compared the idea with the top 10 results. A small search can miss relevant work.
Source Paper
SWE-CoWork: Benchmarking Coding Agents as Digital Employees in OrganizationsXinping Lei, Minghao Liu, Ruijie Zhu +23 more · 2026
The paper introduces SWE-CoWork, a benchmark evaluating software engineering agents as digital employees within simulated organizations of 26 rule-governed colleagues across 101 repositories, 11 languages, and 12 domains. Agents must inspect evolving records, converse with colleagues to recover distributed requirements, implement complex changes, and deliver a verified handoff. The study reveals a critical gap between partial code generation (~63% fail-to-pass tests) and end-to-end task success (<8%), primarily caused by breakdowns in long-horizon requirement tracking, abandoned clarifications, and hallucinated handoff completion.
Related Ideas
- Cross-Interface Harness Adaptation via Abstract Contract SynthesisSelf-Improvement Memory Enables Continual Recursive Self-Improvement🔴Hard
- Subgraph-Decomposed Curriculum RL for Hard Repository-Level Software EngineeringSage S2.1 Flash Technical Report🔴Hard
- Requirement-Coverage and Execution-Trace-Aware Candidate Deliverable SelectionHarness^2: Recursive Agent Harnessing for an Open World🟢Easy
- Bidirectional Dynamic Planning for Evolving SpecificationsDeepCode: Open Agentic Coding🟠Medium
- Automated Linter for Agent-Code SynchronizationAgent READMEs: An Empirical Study of Context Files for Agentic Coding🟡Fairly easy