Research arXiv cs.CL

Large-scale Repository Engineering via Agent-Native Reusable Code Primitives

code generationrepository engineeringagent frameworksbenchmark

Large language models with development environments have pushed code generation toward repository-scale construction, but building complete repositories remains hard because interacting modules, interfaces, configurations, tests, and dependencies all have to work together.

The paper introduces Code Primitives: agent-native reusable executable components that carry interface contracts, dependency closures, validation tests, and provenance. Each primitive uses a resident LLM to assess its relevance and adapt its implementation, interfaces, and dependencies to the target repository; 1,424 validated primitives are organized into CodeFace, a searchable library for repository construction.

The accompanying system, LEGO (Large-scale repository Engineering via aGent-native reusable cOde primitives), activates the task-relevant primitives, integrates their adapted implementations with task-specific code while resolving cross-component constraints, and then revises the result against executed tests. To measure construction end to end, the authors built LEGO-REPO, a benchmark of 522 executable reconstruction tasks spanning seven software domains, 22 capability tracks, and five difficulty levels, scored against native test suites on a scale bounded by an empty-package floor and an original-source ceiling.

Results: the strongest of 13 evaluated backbones reaches a delivery score of 0.318 and scores zero on 41.0% of tasks, while LEGO improves all 13 backbones by 0.1474 on average and raises GPT-5.6-terra from 0.3180 to 0.5134 (+61.4%). In controlled comparisons, adapted primitives outperform retrieved code supplied as context or vendored unchanged, and the effect persists against independent repository agents, across three external benchmarks, and with a disjointly re-mined CodeFace. Using GPT-OSS-20B for adaptation and diagnosis retains 95.1% of the homogeneous score at 24.0% lower cost.

Read original →

← Back to home