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.
Figures & tables
Figure 1: Linear vs. Contract-Driven Parallelism. Unlike sequential workflows that suffer from context accumulation (Left), our Language Contract serves as a topological hypervisor, decoupling dependencies to enable parallel execution and global consistency via a hierarchical graph (Right).
Figure 2: Contract-driven execution. The Contract defines the global state matrix, which drives the Hierarchical Execution Graph (HEG) to schedule parallel agents.
Figure 3: Contract-Guided Self-Healing Case Study. When divergent assumptions (e.g., missing attributes) occur between parallel Backend/Algorithm agents, Contract Auditing detects schema violations during merging and triggers Normative Alignment to auto-correct semantic mismatches.
Method
Gomoku
Plane Battle
City Sim
Snake++
Roguelike
Overall
Files
Time
Overall
Files
Time
Overall
Files
Time
Overall
Files
Time
Overall
Files
Time
Legacy Multi-Agent Frameworks
MetaGPT
70
5.2
126s
50
4.0
129s
30
3.0
185s
10
4.0
210s
10
10.9
261s
ChatDev
93
4.4
88s
90
5.1
79s
45
6.0
140s
25
7.2
165s
10
13.9
144s
FLOW
96
1.0
155s
76
1.0
76s
60
1.0
110s
30
1.0
130s
0
1.0
90s
OpenHands
100
3.3
173s
90
4.9
182s
63
7.3
296s
50
13.7
267s
30
14.1
311s
Table 1: Main Results on Repository-Level Generation. Comparison across five tasks of decreasing complexity. Overall : Average of Executability, Interactivity, and Rule Adherence. Files : Generated file count (closer to ground truth is better). Time : End-to-end latency.
Figure 4: Token Decoupling Analysis. As project complexity grows, the Language Contract size remains stable. Red markers show the compression efficiency.
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
AI IDE
Version
VSCode Ver.
Backbone Model
Mode
Lingma
0.2.3
1.100.0
Default
Agent
CodeBuddy
4.1.1
1.100.0
GPT-5.1-Codex-Max
Craft
Trae
3.2.1
1.104.3
GPT-5 Medium
Solo Build
Gemini Studio
–
–
Gemini 3 Flash Preview
Build
Appendix
Table 2: Configuration of Commercial AI IDE Baselines. Detailed specifications of the IDE versions, underlying VSCode engines, and backbone models used in our comparative evaluation. All AI IDEs choose their corresponding Vibe coding mode.
Figure 5: Conflict Control via Differential Interval Analysis. Using Cbase as an immutable baseline, we decompose updates into Atomic Patches. Semantic conflicts are resolved via a Union-First Strategy, prioritizing information preservation to prevent silent data loss.
Task 1: Gomoku (Logic)
Task 2: Plane Battle (Action)
Method
Exec
Inter
Rule
Succ.
Time(s)
Files
Exec
Inter
Rule
Succ.
Time(s)
Files
Parallel
Legacy Multi-Agent Frameworks
MetaGPT
70
70
70
70%
126.0
5.2
50
50
50
50%
128.5
4.0
×
ChatDev
100
90
90
93%
87.9
4.4
90
90
90
90%
79.4
5.1
×
FLOW
100
90
100
97%
155.0
1.0
100
80
50
77%
75.7
1.0
✓
OpenHands
100
100
100
100%
173.2
3.3
100
100
100
100%
182.0
4.9
×
Appendix
Table 3: Detailed Metrics: Basic Tasks. Comparison on Logic-Oriented (Gomoku) and Action-Oriented (Plane Battle) tasks. Gemini Studio demonstrates high speed but produces bloated file structures compared to our optimized output.
Task 3: City Sim (11 Files)
Task 4: Snake++ (16 Files)
Method
Exec
Inter
Rule
Succ.
Time(s)
Files
Exec
Inter
Rule
Succ.
Time(s)
Files
Parallel
Legacy Multi-Agent Frameworks
MetaGPT
50
20
20
20%
185
3.0
20
10
0
0%
210
4.0
×
ChatDev
60
40
35
30%
140
6.0
30
30
15
10%
165
7.2
×
FLOW
60
60
60
40%
110
1.0
30
30
30
0%
130
1.0
✓
OpenHands
100
40
50
63%
296.4
7.3
60
50
40
50%
266.8
13.7
×
Appendix
Table 4: Detailed Metrics: Intermediate Tasks. Comparison on City Sim (Resource Management) and Snake++ (Event Driven). Note the sharp decline in Gemini Studio ’s rule adherence due to context drift, while Contract-Coding maintains high fidelity.
Method
Arch. Integrity (%)
Func. Fidelity (%)
Overall
Time
Qual.
Key Failure Mode
Struc.
Dep.
Exec.
Inter.
Rules
Success
(s)
Files
Legacy Multi-Agent Frameworks
MetaGPT
60
40
20
10
0
10%
261.0
10.9
Implementation Sparsity
ChatDev
0
10
20
10
0
10%
144.2
13.9
Flat Structure Fallacy
FLOW
–
–
0
0
0
0%
90.6
1.0
Aggregative Collapse
OpenHands
80
50
70
10
10
30%
310.7
14.1
Lost-in-the-Middle
Appendix
Table 5: Detailed Results on Roguelike. High-complexity tasks trigger distinct pathological behaviors in baselines.
Method
Overall Success (%)
Diagnostic
Plane Battle
Gomoku
Consistency (V(C))
Existence (E(C))
Ours w/o Contract
65
85
-
82%(Low)
Ours (Full)
100
100
100% (High)
100% (High)
Appendix
Table 6: Component Ablation Study. Removing the Language Contract significantly impacts Overall Success and Task Existence.
Task
Backbone Model
Success Rate
Diff.
Outcome
Plane Battle
GPT-4o (Main)
100%
-
Parity
Qwen-Plus (Variant)
100%
0%
Gomoku
GPT-4o (Main)
100%
-
Parity
Qwen-Plus (Variant)
100%
0%
Appendix
Table 7: Robustness Across Model Families. The framework achieves identical stability with Qwen-Plus, demonstrating model agnosticism.
Figure 6: Visualizing the Language Contract. The Contract bridges the Product Requirements Documents (PRD) and Technical Manifold (API Specs). This structure allows the Contract-Guided Auditing mechanism to strictly validate implementation compliance via parsing, ensuring parallel context consistency.
School of Computer Science, Wuhan University, China · School of Computer Science, Nanjing University of Science and Technology, China · School of Computer Science, Central China Normal University, China +2