One email each morning — yesterday's AI, sortedGet it in your inbox

METAL LAB

Repo0: Design-Driven Zero-to-All Code Generation

arXiv:2608.198542026-08-19

To have an AI build an entire software repository from scratch out of plain-language requirements, the design has to keep changing while the code is being written, not get locked in upfront

Existing code-generation agents are good at filling in code once a repository's file structure and module boundaries are already fixed, but they struggle when given only natural-language requirements and asked to invent the whole repository architecture themselves. Repo0 keeps two linked graphs, one for requirements and one for implementation components, and keeps splitting, merging, and revising the component structure as coding proceeds instead of freezing a blueprint upfront. Across six real-world repositories, it beat the strongest prior baseline by up to 20.08 percentage points in functionality coverage and up to 29.74 points in test pass rate.

What they did

  1. Prior approaches like RPG analyze the requirements once, produce a repository blueprint, and then generate code strictly following that fixed plan, but real development isn't like that: flawed module boundaries often only become apparent once code is actually being written.
  2. Repo0 maintains a requirement-level DAG (a graph of how requirement units relate to each other) and a separate component-level DAG (a graph of implementation modules and their dependencies), connected by an alignment relation; the requirement graph is kept relatively fixed while the component graph keeps evolving.
  3. Using cohesion (whether a component's grouped responsibilities are actually related) and coupling (whether two components overlap in responsibility) as metrics, Repo0 repeatedly applies four structural actions, split, merge, revise, and save, until no more changes are needed and the structure converges.
  4. After convergence, code is generated with test-driven development: tests are written from the aligned requirements first, then implementation is filled in to pass them, with failures triggering localized repairs.
  5. Tested on six benchmark repositories adapted from scikit-learn, pandas, sympy, statsmodels, requests, and django using GPT-5 mini and DeepSeek V3.2, Repo0 achieved the highest functionality coverage and pass rate in every setting.
Fig. 1: Previous methods treat the graph as a fixed planning artifact, whereas Repo0 continuously evolves repository architecture during generation.
Fig. 1: Previous methods treat the graph as a fixed planning artifact, whereas Repo0 continuously evolves repository architecture during generation.
TABLE I: Overview of the six repositories and their paraphrased counterparts (Para. Name) in RepoCraft. #Files denotes the total source files, LOC the effective lines of code, and Task Counts the evaluation tasks.
Real RepoPara. Name#FilesLOCTask Counts
scikit-learnMLKit-Py18565,972236
pandasTableKit217106,447175
sympySymbolicMath699218,924192
statsmodelsStatModeler27183,325234
requestsHttpEasy172,79350
djangoPyWebEngine681109,457165
Fig. 2: Overview of the continuous decision-driven structural evolution framework.
Fig. 2: Overview of the continuous decision-driven structural evolution framework.
TABLE II: RQ1 main results on three RepoCraft repositories. For each repository, we report Functionality Coverage (Cov.), Functionality Novelty (Nov.), and Pass./Vot., which combines Pass Rate and Voting Rate. GPT-5 mini marks the highest value among methods under GPT-5 mini, and DeepSeek V3.2 marks the highest value among methods under DeepSeek V3.2.
ModelMethodrequestsstatsmodelsdjango
Cov. (%)Nov. (%)Pass./Vot. (%)Cov. (%)Nov. (%)Pass./Vot. (%)Cov. (%)Nov. (%)Pass./Vot. (%)
GPT-5 minimini-SWE-agent68.182.634.11 / 27.4018.189.090.00 / 31.8647.926.9637.04 / 44.44
Paper2Code95.507.2024.66 / 24.6644.3224.134.42 / 30.0966.6715.3030.04 / 78.60
RPG90.9113.7031.51 / 95.8970.4013.8077.90 / 92.0060.4211.5847.33 / 74.07
Repo0100.0018.2050.98 / 100.0080.6811.4885.51 / 98.6580.5013.5974.36 / 97.12
DeepSeek V3.2mini-SWE-agent86.3615.3421.92 / 47.9559.0923.392.65 / 53.9833.339.3810.70 / 47.33
Paper2Code90.9111.804.11 / 56.1614.775.0049.56 / 61.9562.5043.467.82 / 53.50
RPG95.459.2361.64 / 90.4164.7013.7039.29 / 73.5768.7526.5046.50 / 69.55
Repo0100.0024.7778.08 / 100.0078.4114.1069.03 / 86.4679.1714.2974.07 / 93.83
Human DeveloperGold Project100.0094.12 / 100.0010094.15 / 100.00100.0096.34 / 100.00
Fig. 3: Illustrative construction of the initial architectural state.
Fig. 3: Illustrative construction of the initial architectural state.
TABLE III: RQ2 ablation results on requests, statsmodels, and django.
RepositorySettingCov. (%)Nov. (%)Pass./Vot. (%)
requestsRepo0100.0018.2050.98 / 100.00
w/o Requirement Context95.45 (-4.55)9.05 (-9.15)45.39 (-5.59) / 87.86 (-12.14)
w/o Component-Graph Ordering100.00 (0.00)12.85 (-5.35)50.98 (0.00) / 100.00 (0.00)
w/o Dual-DAG95.45 (-4.55)9.14 (-9.06)48.72 (-2.26) / 87.86 (-12.14)
w/o Structural Evolution94.32 (-5.68)8.94 (-9.26)42.51 (-8.47) / 82.14 (-17.86)
statsmodelsRepo080.6811.4885.51 / 98.65
w/o Requirement Context67.92 (-12.76)11.69 (+0.21)85.51 (0.00) / 98.65 (0.00)
w/o Component-Graph Ordering80.68 (0.00)15.57 (+4.09)55.51 (-30.00) / 88.65 (-10.00)
w/o Dual-DAG78.55 (-2.13)14.66 (+3.18)85.51 (0.00) / 95.32 (-3.33)
w/o Structural Evolution75.35 (-5.33)13.50 (+2.02)73.51 (-12.00) / 93.65 (-5.00)
djangoRepo087.5013.5974.36 / 100.00
w/o Requirement Context78.29 (-9.21)12.10 (-1.49)64.36 (-10.00) / 100.00 (0.00)
w/o Component-Graph Ordering83.56 (-3.94)11.58 (-2.01)67.70 (-6.66) / 100.00 (0.00)
w/o Dual-DAG82.24 (-5.26)12.40 (-1.19)64.36 (-10.00) / 93.33 (-6.67)
w/o Structural Evolution81.58 (-5.92)10.94 (-2.65)61.03 (-13.33) / 91.66 (-8.34)
Fig. 4: RQ3 structural-convergence analysis on statsmodels with GPT-5 mini.
Fig. 4: RQ3 structural-convergence analysis on statsmodels with GPT-5 mini.

Why it matters

For an AI agent that builds a whole project from scratch to be genuinely useful, it needs real software-design judgment about how to split files and modules, and this work provides evidence that such design must keep being revised during coding rather than fixed once at the start. It's directly relevant to anyone building developer tools or agents intended to scaffold new projects from requirements.

Fig. 5: Action distributions of different models across the six RepoCraft repositories during structural evolution.
Fig. 5: Action distributions of different models across the six RepoCraft repositories during structural evolution.

Terms in this paper

  • Dual-DAG · a pair of linked graphs, one tracking relationships among requirements and one tracking dependencies among implementation components
  • DAG (Directed Acyclic Graph) · a graph made of one-way connections that never loop back to where they started
  • Cohesion · a measure of how related the requirements grouped inside one component actually are; low cohesion means the component is doing unrelated things
  • Coupling · a measure of how much two components' responsibilities overlap; high coupling flags candidates for merging
  • Test-driven development (TDD) · writing tests before the implementation, then writing code to make those tests pass
  • Functionality Coverage / Pass Rate · metrics for how much of the required functionality the generated repository actually has, and how many reference tests it passes
Fig. 6: Case study of Repo0 on StatModeler. The figure shows how requirements are decomposed, aligned with components, updated through structural actions, and materialized into files.
Fig. 6: Case study of Repo0 on StatModeler. The figure shows how requirements are decomposed, aligned with components, updated through structural actions, and materialized into files.

Original abstract (English)

Large language model agents have made substantial progress in code generation, yet most existing systems assume a predefined repository architecture. This assumption does not hold in zero-to-all code generation, where an agent must construct an entire software project directly from natural-language requirements while maintaining a modular repository architecture throughout development. We present Repo0, a continuous structural evolution framework for zero-to-all code generation. Repo0 maintains an explicit architectural state instantiated as a Dual-Directed-Acyclic-Graph (Dual-DAG), consisting of a requirement-level DAG, a component-level DAG, and their alignment relation. Starting from natural-language requirements, it iteratively evolves component boundaries through structural actions guided by modularity metrics until structural convergence, after which the converged architecture guides test-driven development code generation. We evaluate Repo0 on six real-world repositories from RepoCraft using GPT-5 mini and DeepSeek V3.2. Repo0 achieves the highest Functionality Coverage and Pass Rate across all settings. Compared with RPG, the strongest repository-planning baseline, Repo0 improves Functionality Coverage by up to 20.08 percentage points and Pass Rate by up to 29.74 percentage points. Ablation and structural-evolution analyses further demonstrate the importance of the Dual-DAG architectural state, modularity-guided structural evolution, and explicit structural convergence.

Authors · Silin Chen

Read on arXiv

Latest papers

All papers →

Latest from METAL LAB

Figures: Silin Chen et al., arXiv:2608.19854, CC BY 4.0