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

TL;DR

Repo0 uses continuous structural evolution with Dual-DAG to improve code coverage by 20%.

cs.SE 🔴 Advanced 2026-08-20 91 views
Silin Chen Haoyi Teng Xiaodong Gu Yuling Shi Jiale Huang Yongpan Wang Hongyu Zhang Haibing Guan
software engineering code generation structural evolution large language models modularity

Key Findings

Methodology

This paper introduces Repo0, a framework based on Dual-DAG that guides continuous architecture evolution through structural actions like split, merge, and revise, driven by modularity metrics. The process involves extracting requirements, generating initial architecture, iteratively refining component boundaries, and validating through feedback until convergence. The architecture state comprises requirement-level DAG, component-level DAG, and their alignment, ensuring traceability. Experiments on six real-world repositories with GPT-5 mini and DeepSeek V3.2 demonstrate superior performance over static planning baselines like RPG, with notable improvements in functionality coverage and pass rate.

Key Results

  • Across six repositories, Repo0 achieved up to 20.08 percentage points higher in functionality coverage and 29.74 percentage points in pass rate compared to RPG. The multi-round structural evolution effectively refined component boundaries, reduced coupling, and enhanced modularity. Ablation studies confirmed the importance of Dual-DAG and metrics-guided convergence. Results indicate that continuous architecture refinement significantly boosts code correctness and maintainability, especially in dependency-rich scenarios.
  • The experiments showed that the architecture's iterative refinement led to more cohesive modules, fewer dependency issues, and better alignment with requirements. Validation feedback during code synthesis prevented architecture-code mismatches, demonstrating the robustness of the approach.
  • Overall, the results validate that explicit, metrics-guided structural evolution outperforms static planning, paving the way for more autonomous, adaptive software generation systems.

Significance

This work addresses a fundamental limitation in existing code generation methods by enabling dynamic, requirement-driven architecture evolution. It bridges the gap between static design assumptions and real-world development, where architectures evolve as requirements are decomposed and implemented. The framework enhances the capability of AI agents to autonomously generate complex, modular software systems from natural language, reducing manual effort and increasing development speed. Its implications extend to automated software engineering, AI-assisted development, and future self-adaptive systems, marking a significant step toward fully autonomous software creation.

Technical Contribution

The core innovation lies in modeling architecture as a Dual-DAG, separating requirement-level and component-level dependencies, and guiding their evolution through modularity metrics. The multi-phase process integrates requirement decomposition, structural evolution, and test-driven code synthesis into a unified pipeline. The metrics-based convergence ensures architecture stability, while feedback-driven repairs maintain correctness. This approach differs from prior static planning methods by enabling continuous, adaptive architecture refinement, supported by rigorous experimental validation showing substantial performance gains.

Novelty

This is the first framework to formalize zero-to-all code generation as a continuous structural evolution process driven by explicit metrics. Unlike previous static graph planning or single-pass methods, Repo0 dynamically adjusts architecture boundaries during development, ensuring modularity and robustness. The combination of Dual-DAG representation, metrics-guided evolution, and integrated code validation constitutes a novel paradigm in AI-driven software engineering.

Limitations

  • The current approach may be computationally intensive for very large projects, as multiple evolution cycles are needed. The effectiveness heavily depends on the quality of requirement extraction and the accuracy of metrics, which may vary across domains. Handling complex dependency graphs with cyclical dependencies remains challenging. Further research is needed to improve scalability and robustness in diverse real-world scenarios.

Future Work

Future directions include integrating reinforcement learning to optimize structural actions, expanding to multi-language and multi-platform environments, and enhancing requirement understanding with multimodal inputs. Developing adaptive metrics that better capture architectural quality and automating the entire pipeline for real-time development are also promising avenues. These efforts aim to realize fully autonomous, scalable software engineering systems.

AI Executive Summary

The rapid advancement of large language models (LLMs) has revolutionized code generation, enabling AI agents to produce increasingly complex software snippets. However, most existing systems rely on predefined repository architectures, limiting their flexibility and adaptability. In real-world software development, architecture is rarely static; it evolves continuously as requirements are decomposed, components are refined, and validation feedback is incorporated. Recognizing this, the authors propose Repo0, a novel framework that models software architecture as a Dual-DAG structure, facilitating continuous, metrics-guided evolution.

Repo0 begins with natural language requirements, extracting high-level features and decomposing them into sub-requirements. An initial architecture is generated by translating these into components and establishing their dependencies. The core innovation lies in the iterative structural evolution loop, where components are split, merged, or revised based on modularity metrics such as cohesion and coupling. This process ensures architecture convergence, balancing functional coverage and structural quality.

Once the architecture stabilizes, code is synthesized incrementally using test-driven development, with validation feedback guiding localized repairs. Extensive experiments on six real-world repositories demonstrate that Repo0 significantly outperforms static planning baselines like RPG, achieving up to 20% higher functionality coverage and nearly 30% higher pass rates. These results confirm that explicit, continuous architecture evolution enhances the correctness, modularity, and maintainability of generated software.

This work marks a paradigm shift in AI-driven software engineering, emphasizing dynamic, requirement-driven architecture refinement rather than static upfront planning. It opens avenues for fully autonomous, adaptive software systems capable of evolving alongside changing needs, with broad implications for industry and research. Future work will focus on scalability, multimodal input integration, and reinforcement learning to further optimize structural decisions, pushing the frontier of automated software development.

Deep Analysis

Background

软件工程经历了从手工设计到自动化生成的演变。早期工具如模板和规则引擎逐步发展出基于大模型的代码生成技术(如OpenAI Codex、GPT-4),极大提升了开发效率。Graph-based架构规划(如RPG)强调架构的合理性,但多假设架构已定,缺乏动态调整能力。近年来,强调架构连续优化的研究逐渐兴起,试图解决静态设计的局限性,推动自动化软件工程向更高层次发展。然而,现有方法仍未充分结合需求驱动的结构调整机制,难以应对复杂、多变的实际场景。

Core Problem

核心问题在于如何在没有预先定义架构的情况下,从自然语言需求出发,自动构建符合软件工程原则的模块化架构。传统静态规划方法难以适应需求变更,导致架构不合理,影响代码质量和维护性。零到全代码生成面临的难题包括需求理解、架构划分、组件依赖管理等多方面挑战。缺乏持续优化机制,限制了自动化水平的提升,亟需一种动态调整、持续演化的架构生成方法。

Innovation

本文的创新主要体现在:1)提出Dual-DAG结构,明确需求层与实现层的关系,增强追溯性和可调节性;2)引入连续结构演化机制,通过模块度指标引导架构边界调整,避免静态规划的僵化;3)结合内聚、耦合等指标实现自动化架构优化,确保架构合理性;4)在代码生成中融入验证反馈,形成闭环优化流程。这些创新共同推动了从需求到代码的自动化、动态化全过程,显著优于传统静态规划方法。

Methodology

  • �� 需求分析:利用LLM提取高层需求,细化为子需求,构建需求层DAG。
  • �� 初始架构:基于需求生成初步组件,建立组件层DAG及其对齐关系。
  • �� 结构演化:通过拆分、合并、修订等动作,结合模块度指标(如内聚、耦合)调整组件边界。
  • �� 指标引导:利用内聚度、耦合度、连通性等指标评估架构合理性,驱动演化。
  • �� 结构收敛:持续演化直到满足收敛条件,确保架构稳定。
  • �� 代码生成:在验证反馈基础上,逐步实现组件,采用测试驱动开发(TDD)确保正确性。
  • �� 反馈机制:验证失败时进行局部修复,保证架构与代码一致性。

Experiments

在六个RepoCraft真实仓库上,采用GPT-5 mini和DeepSeek V3.2模型,比较Repo0与RPG、Paper2Code等基线。指标包括功能覆盖率、通过率和任务完成度。多轮结构演化验证指标引导的收敛效果。通过消融实验分析Dual-DAG和指标的重要性。评估模型在复杂依赖、多模块场景下的表现,确保结果的稳健性和泛化能力。

Results

实验显示,Repo0在六个仓库中,功能覆盖率最高提升20.08个百分点,Pass Rate最高提升29.74个百分点,优于RPG。多轮演化后,架构边界更合理,组件内聚增强,耦合降低。指标引导的收敛机制有效避免过度拆分或合并,提升代码质量和维护性。ablation验证确认Dual-DAG和指标的关键作用,验证连续演化的优越性。

Applications

该方法适用于自动化软件开发、智能代码生成工具、AI辅助IDE等场景,尤其在需求频繁变动、复杂系统设计中表现优越。可降低开发成本,加快迭代速度。未来结合多模态需求理解、多语言支持,拓展到多平台、多场景的自动化软件生成,推动行业智能化升级。

Limitations & Outlook

目前在大规模项目中仍存在效率瓶颈,演化轮次多可能导致时间成本上升。指标设计在极端场景下可能误导架构调整。对LLM的依赖带来理解偏差风险,未来需引入更鲁棒的评估机制。此外,复杂依赖关系和多团队协作场景仍需优化,确保架构演化的稳定性和适应性。

Plain Language Accessible to non-experts

想象你在厨房做饭,没有提前准备好所有食材和步骤,而是根据每一步的情况不断调整。比如,发现某个调料用多了,就换个调料,或者发现某个菜太多,就分成两个锅继续炒。这个过程就像Repo0在开发软件时不断调整架构,确保每个部分都合理,最后做出一盘美味的菜。它不是一开始就设计好全部菜单,而是边做边改,直到所有菜都做好,味道正宗。这种灵活调整让整个厨房操作更高效,也更符合实际需求。

ELI14 Explained like you're 14

你知道做饭的时候,有时候会突然发现需要多点盐,或者发现某个菜放太多了,要换个锅继续炒?其实,做软件也差不多。以前的人会提前把所有步骤都计划好,然后一股脑儿照着做,但这样不太灵活。如果需求变了,架构也得重新设计,太麻烦了。现在的办法像是边做边调整,发现哪里不对就改一改,把菜炒得更好。Repo0就是用这种“边做边改”的方法,自动调整软件的结构,让它更符合需求,最后做出一份完美的软件菜肴。

Glossary

Dual-DAG (双向有向无环图)

一种同时表示需求层和组件层关系的图结构,确保需求与实现的追溯性与可调节性。

在论文中用以描述软件架构的核心状态,支持连续演化。

模块度指标

衡量软件架构中组件的内聚性和耦合度,用于指导架构优化。

引导结构拆分、合并等动作,确保模块合理性。

结构演化

在软件开发过程中不断调整和优化架构的过程,以适应需求变化。

核心机制,确保架构持续收敛到最优状态。

TDD (测试驱动开发)

一种开发流程,先编写测试用例,再实现代码,确保功能正确。

在代码生成阶段用以验证架构合理性。

Open Questions Unanswered questions from this research

  • 1 如何在极大规模项目中保持演化效率?未来是否能实现完全自动化的架构收敛?
  • 2 指标设计如何适应不同软件类型和复杂度?
  • 3 多模态需求理解在架构演化中的作用和潜力。

Applications

Immediate Applications

自动化软件开发工具

结合Repo0实现从自然语言需求到完整代码的自动生成,降低开发门槛,提升效率。

智能集成开发环境(IDE)

在IDE中集成结构演化机制,实时优化架构设计,支持快速原型开发。

Long-term Vision

自主软件工程系统

实现完全自主的需求理解、架构设计和代码生成,推动软件行业向自动化迈进。

Abstract

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.

cs.SE cs.AI