Chiosa
Software & Code

Reusable code components adapt themselves to build full repositories

2 min ·

In plain words

The paper introduces LEGO, a system for building complete software packages with reusable code components. Each component can adjust its code and connections to fit a target package; LEGO then runs tests and uses failures to guide revisions.

On 522 Python package tasks, LEGO scored higher on average than a system that built packages with test feedback but no reusable component library. The score reflects how many original package tests the reconstruction passed, relative to a task-specific reference.

The research

Can reusable code help language models build complete software packages, where modules must fit together and pass the package’s own tests? On LEGO-REPO, the strongest of 13 systems building from scratch with execution feedback scored zero on 41% of tasks. The paper tests whether components that adapt to a target repository can address that difficulty.

The authors introduce Code Primitives and LEGO, which retrieve reusable components, adapt them to a target repository, then use executed tests to guide integration and revision.

With GPT-5.6-terra, LEGO averaged 0.5134 on the 522 tasks, versus 0.3180 for construction with execution feedback but no library or diagnosis.

Each task score reflects native tests passed between that package’s empty-package floor and original-source result, and the reported value is the mean across tasks.

The comparison keeps the task set, grading, feedback, and attempt budget the same. The higher mean supports an improvement for this setup, while not implying that every package improved.

These results concern Python package reconstruction under fixed native test suites; passing those tests does not establish complete correctness or design quality. The authors also note that their provenance checks cannot rule out all source overlap.

Analysis

Deep