Papers
Topics
Authors
Recent
Search
2000 character limit reached

Contract-Coding: Towards Repo-Level Generation via Structured Symbolic Paradigm

Published 10 Apr 2026 in cs.SE and cs.AI | (2604.13100v1)

Abstract: The shift toward intent-driven software engineering (often termed "Vibe Coding") exposes a critical Context-Fidelity Trade-off: vague user intents overwhelm linear reasoning chains, leading to architectural collapse in complex repo-level generation. We propose Contract-Coding, a structured symbolic paradigm that bridges unstructured intent and executable code via Autonomous Symbolic Grounding. By projecting ambiguous intents into a formal Language Contract, our framework serves as a Single Source of Truth (SSOT) that enforces topological independence, effectively isolating inter-module implementation details, decreasing topological execution depth and unlocking Architectural Parallelism. Empirically, while state-of-the-art agents suffer from different hallucinations on the Greenfield-5 benchmark, Contract-Coding achieves 47\% functional success while maintaining near-perfect structural integrity. Our work marks a critical step towards repository-scale autonomous engineering: transitioning from strict "specification-following" to robust, intent-driven architecture synthesis. Our code is available at https://github.com/imliinyi/Contract-Coding.

Authors (3)

Summary

  • The paper introduces a Language Contract that decouples architectural complexity to enable parallelized repo-level synthesis.
  • Its dual-layer symbolic projection and dynamic hierarchical execution graph achieve sub-linear context scaling and robust self-healing.
  • Experimental results demonstrate 100% structural integrity and competitive functional success against legacy multi-agent frameworks.

Contract-Coding: Structured Symbolic Paradigm for Repo-Level Generation

Introduction and Motivation

Contract-Coding introduces an intent-first symbolic orchestration framework addressing systemic context-fidelity bottlenecks in automated repo-level synthesis. Traditional chain-of-thought multi-agent pipelines (MetaGPT, ChatDev) exhibit multiplicative error propagation and linear context accumulation, sharply limiting scalability as user intent diffuses into semantic noise and exceeding the available attention span for complex repositories. Specification-driven approaches, while rigorously architectural, presuppose complete design blueprintsโ€”a rare practical occurrence. Contract-Coding formalizes a Language Contract that autonomously projects ambiguous user intents into an architectural โ€œthumbnailโ€ (SSOT), enforcing information hiding and topological independence. This transforms the generative process into parallel execution grounded in a contract-driven hierarchical graph, mitigating architectural collapse. Figure 1

Figure 1: Language Contracts enforce parallel architectural orchestration by decoupling module dependencies, avoiding context accumulation inherent in linear workflows.

Methodological Details

Symbolic Projection

The Language Contract operates as a dual-layer semantic barrier, comprising high-dimensional constraint projections (requirements, APIs, dependencies) and an executable symbolic kernel encoded as file-module mappings, strict type signatures, and state spaces. Construction is restricted to atomic mutations ("Add", "Update"), prohibiting semantic drift. A two-stage pipeline (Generator proposal, Discriminator audit) ensures architectural soundness (e.g., acyclicity, completeness), dynamically propagating residual ambiguity to downstream execution agents for adaptive contract patching. Figure 2

Figure 2: The global state matrix, formalized by the Language Contract, drives the Hierarchical Execution Graph for agent scheduling and workflow resolution.

Hierarchical Execution Graph (HEG)

Repo-level synthesis is restructured into a Dynamic HEG, where execution topology and scheduling are contract-conditioned. Atomic tasks are directly mapped from contract sections, each with status lifecycles (Todo, Done, Error, Verified). Workers operate strictly on contract contextโ€”never on noisy implementation historyโ€”ensuring conditional independence (as formalized), unlocking parallelism and sub-linear reasoning context scaling. Normative critics verify implementations against contract constraints, iteratively converging under bounded topological depth.

Contract Auditing and Self-Healing

The Contract Auditor synchronizes structure, status, and consistency through three metrics:

  • Structural Alignment: Missing symbols in implementations trigger dynamic task injection.
  • State Synchronization: Logic errors prompt status regression and agent repair.
  • Consistency Control: Signature mismatches enforce corrective synchronization or contract amendments. Figure 3

    Figure 3: Self-healing mechanisms auto-correct schema mismatches detected during parallel execution and merging.

Appendix describes conflict repair and aggregation via a Differential Interval Analysis protocol and a union-first conflict resolution strategy prioritizing information preservation. Figure 4

Figure 4: Atomic patches based on the immutable baseline contract resolve semantic conflicts while avoiding silent data loss.

Experimental Evaluation

Complexity Spectrum and Context Scaling

Contract-Coding is evaluated on Greenfield-5, spanning logic scripts, event-driven games, resource management, and a Roguelike requiring modular scale (>15>15 files). Baselines include legacy academic multi-agent frameworks and commercial AI IDEs. Metrics combine executed/interacted/rule-adherence benchmarks and architectural/topological analysis.

Contract-Coding achieves 100% structural integrity throughout, with a 47% functional success rate and significant context compression: complexity growth yields sub-linear Language Contract size, downgrading repository synthesis to manageable single-file tasks. Legacy frameworks collapse under context saturation; commercial tools rely on high-latency, brute-context scaling, which yields diminishing returns. Figure 5

Figure 5: The Language Contract exhibits sub-linear token scaling relative to repository complexity, substantiating semantic compression.

Forensic Failure Analysis

Legacy multi-agent frameworks manifest hollow skeletons (MetaGPT), reflection-action gaps (ChatDev), and context collapse (FLOW). Commercial tools escalate logical drift and interface mismatch as complexity increases. Contract-Coding's failures are strictly local logic bugs, never architectural collapse, validating the claim that structural integrity is achieved via symbolic decoupling.

Practical and Theoretical Implications

Contract-Coding formally separates architectural orchestration from implementation, enforcing global consistency and parallel efficiency through the symbolic SSOT. Practically, this paradigm differentially compresses reasoning space, enabling scalable repo-level generation without exorbitant context windows or infrastructure. Theoretically, the approach validates that conditional independence and information hiding (via contracts) fundamentally resolve the scalability wall observed in chain-of-thought systems.

The model-agnostic ablation confirms robustness, with non-proprietary models (Qwen-Plus) achieving parity in functional success, indicating that the architectural topologyโ€”not model capacityโ€”is paramount for scalable repo generation.

Limitations and Future Directions

Contract-Codingโ€™s O(1)O(1) dependency depth applies to parallel execution, but system latency may scale with synchronization/repair rounds in cases of extreme semantic coupling. Benchmark limitations persist, as no standardized suite exists for greenfield, multi-file synthesis. Commercial IDEsโ€™ internal changes deter reproducibility. Future research directions include automated benchmarks for large-scale contract-driven paradigms, conflict-aware merging using arbiter LLMs, and optimizing union-first strategies for ultra-large teams.

Conclusion

Contract-Coding operationalizes structured-symbolic repo generation, decoupling architectural complexity from implementational context. Through Language Contracts and auditable graph orchestration, it achieves near-optimal structural integrity, efficient parallelism, and robust self-healing in real-world, intent-driven engineering. Empirical results validate sub-linear context scaling and competitive efficiency, marking contract-driven symbolic paradigms as a viable path beyond brute-force context expansion for autonomous software synthesis (2604.13100).

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.