Skip to content
AI-generated research idea🟠Medium🔬Significant ResearchRelated work found

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

a couple of months

Compute level

Single GPU or less

Resources

Multi-GPU workstation or cloud instance for running open-source code models or commercial LLM APIs, plus SWE-CoWork environment.

What the paper used

Tasks require modifying a median of 60 production files and 2,955 lines of code, evaluated against a median of 32 executable verifier nodes per task across 11 languages.

Prerequisites

AST manipulation, static analysis, software engineering agents, compilers

Scope

build from scratch

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.”
From the paper, Section 6.3.1, page 16. Matched against the PDF text.

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.

  1. Set up tree-sitter parsers for the top 4 languages in the benchmark (JavaScript, Python, TypeScript, PHP) to extract dependency graphs of declarations.
  2. Build a pipeline component that maps informal specification sentences to affected classes and functions via semantic code search and static call graphs.
  3. Implement a staged code synthesizer that writes type stubs and interfaces first, runs build checks, and then fills method bodies.
  4. 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?

Related work found

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.

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 Organizations

Xinping 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

Is this a good idea?

Share onXLinkedIn