Source-linked AI summary
Repo0: Design-Driven Zero-to-All Code Generation
Silin Chen, Haoyi Teng, Xiaodong Gu, Yuling Shi, Jiale Huang, Yongpan Wang, Hongyu Zhang, Haibing Guan
TL;DR
Existing code-generation systems often assume a predefined repository architecture, but zero-to-all generation must infer both functionality and structure while maintaining modularity. Repo0 uses a Dual-DAG and metrics-guided structural evolution to refine architecture before TDD-based code generation. Across six RepoCraft repositories and two backbone models, it achieves the highest Functionality Coverage and Pass Rate in all settings, outperforming RPG by up to 20.08 and 29.74 percentage points on those metrics.
Problem
Existing methods assume predefined repository architectures, leaving zero-to-all generation to jointly infer functionality and architecture while maintaining modularity.
Method
Repo0 maintains a Dual-DAG linking requirement-level functionality, implementation components, and their alignment, then evolves component boundaries with modularity metrics until convergence before TDD code generation.
Results
Repo0 achieves the highest Functionality Coverage and Pass Rate across six RepoCraft repositories and both GPT-5 mini and DeepSeek V3.2 settings, improving over RPG by up to 20.08 and 29.74 percentage points.
Takeaways & Limitations
The results support treating repository generation as continuous structural evolution, with explicit architectural state and metrics-guided convergence contributing to effective repository generation.
Takeaways & Limitations
Evaluation covers six Python repositories from one benchmark, so effectiveness on other programming languages and benchmarks remains uninvestigated.
Abstract
from arXiv · showhide
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.
I. INTRODUCTION
Zero-to-all code generation requires agents to establish and maintain repository modularity, not merely synthesize code within a predefined architecture. Repo0 addresses this by continuously evolving a Dual-DAG architecture before and during generation, then evaluating it across real-world repositories.
- Existing repository-generation methods largely assume predefined architecture, overlooking component boundaries, package organization, and dependency design.
- Zero-to-all generation jointly requires inferring software functionality and architecture while preserving high cohesion, low coupling, and coordinated dependencies.
- Repo0 represents requirements, implementation components, and their alignment in a Dual-DAG that preserves traceability while allowing architecture to evolve.
- Across six RepoCraft repositories and both backbone models, Repo0 achieves the highest Functionality Coverage and Pass Rate in every setting.Compared with RPG, it improves Functionality Coverage by 4.55–20.08 percentage points and Pass Rate by 7.61–29.74 percentage points.
- Metrics-guided structural evolution improves repository quality, whereas unconstrained structural actions tend to over-decompose architectures and degrade downstream correctness.
- Repo0 evolves component boundaries through explicit structural actions guided by modularity metrics and requirement coverage until structural convergence, rather than using one-shot planning.
B. Phase I: Requirement Decomposition and Initial Architecture
Repo0 converts uneven natural-language requirements into an initial architecture by organizing requirements hierarchically, aligning sub-requirements with bounded components, and inferring implementation dependencies.
- Repo0 extracts capability-level requirements and merges redundant or subsumed items before further decomposition.
- Each high-level requirement is enriched with behavior, inputs, outputs, constraints, interfaces, error cases, and ambiguous scope before sub-requirements are identified.
- Sub-requirements represent functional units without specifying packages, files, classes, or component dependencies.
- Repo0 translates sub-requirements into bounded components with names, responsibility descriptions, and explicit served-sub-requirement lists.
- Alignment pairs connect each component to its served sub-requirements, while implementation dependencies are inferred separately rather than copied directly from requirement-level edges.
C. Phase II: Modularity-Guided Structural Evolution Loop
Repo0 iteratively refines the initial component DAG using modularity metrics and structural actions, stopping when no eligible split or merge remains and then performing semantic alignment checks.
- Split, merge, revise, and save actions respectively partition diffuse responsibilities, consolidate overlapping components, rewrite boundaries without changing them, or preserve stable components.
- Responsibility measures the sub-requirements assigned to a component, with |RS(c)| indicating how many requirement-side units it covers.
- Cohesion measures the density of requirement-level coordination relations within a component; low cohesion indicates diffuse responsibilities.
- A split is triggered by low cohesion and sufficient responsibility-set size, while a merge candidate requires high coupling and connectivity greater than 1.
- The evolution loop recomputes modularity metrics and applies eligible structural actions to refine component boundaries.
- Structural convergence occurs when a complete round yields no eligible split or merge actions, followed by a semantic alignment pass that can apply revisions.
D. Phase III: Code Generation
After structural convergence, Repo0 derives a dependency-aware generation plan and generates each component incrementally through a test-driven development workflow with validation after each step.
- The converged component DAG yields package assignments, file paths, exported symbols, and dependency-aware generation order.
- Each component’s generation context combines its responsibility, aligned requirements, and upstream components needed before implementation.
- Repo0 generates an importable skeleton, synthesizes aligned tests, fills in the implementation, and validates imports, interfaces, and pytest execution.
A. Research Questions
The evaluation asks whether Repo0 is effective overall, whether its core components contribute to performance, and whether modularity metrics improve structural convergence, using a diverse six-repository benchmark.
- Research Questions: The study evaluates Repo0’s overall effectiveness in zero-to-all code generation.
- Research Questions: The ablation question examines how each core Repo0 design component contributes to zero-to-all code generation.
- Research Questions: The structural-evolution question compares proposed modularity metrics with LLM-decided structural actions for improving convergence.
- Evaluation Setup: Repo0 is evaluated on six real-world Python repositories in RepoCraft, with paraphrased names used to reduce potential pretraining leakage.
- Evaluation Setup: The benchmark spans compact and dependency-intensive systems across scikit-learn, pandas, sympy, statsmodels, requests, and django.
C. Baseline Methods
The evaluation compares Repo0 with direct coding, staged generation, and graph-based planning baselines under a shared downstream generation and validation protocol.
- Baseline Methods: The comparison includes mini-SWE-agent, Paper2Code, and RPG, representing direct coding, staged generation, and graph-based repository planning.RPG constructs a static Repository Planning Graph to guide code generation.
- Evaluation Metrics: Functionality Coverage measures the fraction of reference functional categories matched by generated functionality descriptions.
- Evaluation Metrics: Pass Rate counts benchmark tasks whose adapted ground-truth tests pass, while Voting Rate counts tasks with a majority-vote matched functional interface.
- Evaluation Protocol: Experiments use GPT-5 mini and DeepSeek V3.2 with deterministic decoding; Repo0 settings are repeated across three independent runs and averaged.The main experiment reports requests, statsmodels, and django, while results for three additional repositories appear in supplementary material.
- Evaluation Protocol: All methods share the same downstream code-generation, validation, and repair scaffold under an identical test-driven development protocol.The methods differ in how they construct repository structure before downstream generation.
IV. RESULTS
Repo0 achieves the strongest repository-generation results across evaluated repositories and backbone models, while ablations show that its architectural components support functionality coverage and implementation correctness.
- RQ1: Main Results: Repo0 consistently achieves the best overall repository-generation performance across both backbone models and repositories of different scales.
- RQ1: Main Results: 100.00% Functionality Coverage is achieved on requests under GPT-5 mini, with Repo0 also leading coverage on statsmodels and django and across DeepSeek V3.2 settings.The reported GPT-5 mini values are 80.68% on statsmodels and 80.50% on django.
- RQ1: Main Results: +19.47 points, +7.61 points, and +27.03 points are Repo0’s Pass Rate advantages over RPG on requests, statsmodels, and django under GPT-5 mini.Repo0 achieves the highest Voting Rate in all six settings.
- RQ1: Main Results: Because methods share downstream generation, validation, and repair, the consistent gains indicate that continuous architectural refinement improves functionality realization and implementation correctness.
- RQ2: Ablation Study: Removing Structural Evolution causes the largest overall degradation, including requests drops of 5.68 Coverage points, 8.47 Pass Rate points, and 17.86 Voting Rate points.On django, the corresponding drops are 5.92 Coverage, 13.33 Pass Rate, and 8.34 Voting Rate points.
- RQ2: Ablation Study: Removing Requirement Context lowers Pass Rate, particularly by 10.00 points on django and 5.59 points on requests.The full system also conditions components on functionally coordinated requirement nodes in the requirement-level DAG.
- RQ2: Ablation Study: Removing dependency-aware generation order leaves Functionality Coverage unchanged on requests and statsmodels but lowers statsmodels Pass Rate by 30.00 points.The result indicates that generation order becomes more important as repository complexity grows.
- RQ2: Ablation Study: Replacing Dual-DAG with a unified graph consistently reduces either functional coverage or implementation accuracy.Dual-DAG separates requirement-level functional coordination from component-level implementation dependencies.
C. RQ3: Structural Convergence Analysis
Repo0 uses cohesion- and coupling-guided structural evolution to reach convergence, outperforming unconstrained or fixed-budget alternatives. Structural evolution is dominated by localized component-boundary updates, with model differences partly reflecting the initial architecture.
- Metrics-Guided Convergence: Repo0 increases Functionality Coverage from 75.90% to 80.68%, Functionality Novelty from 11.05% to 11.48%, Pass Rate from 81.90% to 85.51%, and Voting Rate from 93.00% to 98.65% versus w/o evolution.It also outperforms budgeted LLM-decided variants despite their additional structural-action rounds.
- Metrics-Guided Convergence: Unconstrained LLM-decided refinement slightly increases novelty but degrades coverage, pass rate, and voting rate after one round.Repeated actions can continue beyond structural convergence, causing unnecessary fragmentation and compensatory restructuring.
- Action Distribution: Split is the dominant structural action across both backbone models, followed by save, while merge, revise, and add occur less frequently.The distribution indicates localized component-boundary updates and suggests many initial architectures contain stable components requiring limited modification.
- Action Distribution: GPT-5 mini triggers revise and add more often, while DeepSeek V3.2 produces fewer such updates, consistent with a more complete initial architecture.Manual inspection links revise to underspecified responsibilities and interface assumptions, and add to missing requirements or components.
- Action Distribution: Under a shared GPT-5-mini-generated initial architecture, DeepSeek V3.2 produces nearly the same number of revise actions as GPT-5 mini.This controlled comparison indicates that revise frequency depends substantially on the initial architectural state.
- Metrics-Guided Convergence: Metrics-guided convergence improves repository quality beyond unconstrained LLM-decided structural actions.Repo0 uses cohesion and coupling metrics to guide split and merge decisions and determine when refinement stops.
D. Case Study
The StatModeler case study traces Repo0 from requirements through Dual-DAG construction, structural revision, and file realization. The study also reports repository-generation costs and relates lower redundancy and conflict to reduced repair overhead.
- Case Study: Repo0 begins from README capabilities and extracts 39 high-level requirements for StatModeler.The requirements include regression modeling, generalized linear models, timeseries analysis, statistical testing, data backends, result serialization, and model diagnostics.
- Case Study: The system organizes 92 sub-requirements into a requirement-level DAG and grounds them into 86 implementation components in the component-level DAG.An explicit alignment relation connects sub-requirements to the components that realize them.
- Case Study: Structural actions revise the Dual-DAG before code realization by splitting Experimental Namespace Manager and merging Numerical Core & Sparse Backend with another component.These actions update component boundaries and the alignment relation rather than treating the architecture as a fixed blueprint.
- Cost Analysis: Under DeepSeek V3.2, Repo0’s total costs are $21.28 for requests, $41.12 for statsmodels, and $100.06 for django.Evaluation costs dominate for larger repositories, particularly django at $72.82.
- Cost Analysis: Under GPT-5 mini, Repo0 achieves consistently lower generation cost across all repositories while evaluation costs remain comparable across methods.The analysis attributes lower direct cost to reduced redundant or conflicting code and fewer costly TDD repair iterations.
VI. THREATS TO VALIDITY
The paper’s validity threats concern backbone-LLM dependence and limited evaluation scope. Repo0’s contribution is positioned against repository-generation methods that use fixed structural priors or static planning blueprints.
- Internal Validity: Structural-update quality depends partly on the backbone LLM’s architectural reasoning capability.Metrics select candidate split and merge actions, but the LLM still rewrites boundaries, responsibilities, alignments, and interface assumptions.
- Internal Validity: Iterative reevaluation, boundary-preserving revise actions, and TDD validation provide mitigation for inaccurate architectural descriptions or interface assumptions.Validation feedback can trigger localized repair within the fixed repository architecture.
- External Validity: The experiments cover six Python repositories from RepoCraft, so effectiveness on other language ecosystems remains to be investigated.The authors state that evaluating generality on additional languages and benchmarks is future work.
- Positioning: Repo0 differs from RPG by treating repository architecture as a persistent, evolving state rather than a blueprint for subsequent generation.Repo0 updates component boundaries and alignments using modularity metrics.
- Conclusion: The conclusion argues that repository generation requires explicit architectural reasoning and continuous structural refinement in addition to code synthesis.This conclusion follows the reported RepoCraft experiments, ablations, and convergence analysis.