Source-linked AI summary

Super Library Agent: Joint Generation and Maintenance of Multiple Applications Beyond the Single Codebase

Daegyu Sung, Yukyeong Lee, Geon Park, Yumin Choi, Sung Ju Hwang

arXiv:2608.29310v1cs.SEcs.AIcs.CL

TL;DR

LLM-generated portfolios can duplicate shared logic and accumulate verbosity, dead code, and structural erosion, while naive shared-library construction struggles with extraction and migration. The paper introduces the Super Library Agent with candidate-guided extraction, consolidation, and context-aware migration. Across WebGen-Bench and PaperBench, it preserves functionality while improving maintainability, library utilization, and abstraction quality, although evaluation remains limited by benchmark artifacts, proxy metrics, and single-round maintenance.

  • Problem

    LLM coding agents may generate portfolios whose independently maintained applications duplicate shared logic and accumulate verbosity, dead code, and structural erosion.

  • Method

    The Super Library Agent sequentially generates related applications while maintaining a shared library, using candidate-guided extraction, codebase consolidation, extraction traces, and call-graph-conditioned migration.

  • Results

    Across WebGen-Bench and PaperBench, the method preserves functionality while improving maintainability, library utilization, and abstraction quality over other baselines.

  • Takeaways & Limitations

    A shared library can support more sustainable generation and maintenance of larger, evolving portfolios, with post-patch results showing fewer cross-application edits.

  • Takeaways & Limitations

    The evaluation uses adapted benchmark artifacts, proxy maintainability metrics, and a single maintenance round rather than repeated maintenance on real applications.

Abstract

from arXiv · show

Organizations often develop and maintain portfolios of related applications: independently deployable codebases that share substantial domain logic, interface patterns, or operational conventions. As LLM coding agents are increasingly used to generate and maintain such software, a naive application-by-application workflow duplicates shared logic across codebases and allows prolonged agentic maintenance to accumulate verbosity, dead code, and structural erosion. We introduce the Super Library Agent problem, where an agent sequentially generates a portfolio of N related applications while maintaining a shared Super Library of reusable cross-application components. A minimal sequential scaffold can in principle extract shared code and migrate applications to the evolving library, but in practice suffers from low extraction recall and fragile dependency migration. We address these failures with candidate-guided extraction over code chunk summaries, pre-extraction codebase consolidation, and context-aware migration using extraction traces and call-graph information. Across WebGen-Bench and PaperBench, our method preserves application functionality while significantly reducing redundancy and token footprint (verbosity, token length) over zero-shot, and avoiding the structural erosion introduced by naive library construction, with additional reductions in LOC and MDL. Our code is available at https://github.com/sbigstar0310/super-library-agent.

1 Introduction

The Super Library Agent addresses portfolio-scale duplication and agent-induced structural degradation by maintaining reusable shared components across sequentially generated applications. It targets low extraction recall and fragile dependency migration with candidate-guided extraction and context-aware migration.

  • Organizations maintain related, independently deployable applications that share domain logic, interface patterns, data processing, and operational conventions.
  • Independent generation duplicates shared concerns, requiring manual propagation of bug fixes, design changes, and policy updates across near-duplicates.
  • Prolonged agentic coding can preserve functionality while accumulating verbosity, dead code, and structural convolution across independently maintained applications.
  • The Super Library Agent generates related applications sequentially while maintaining a shared library of reusable cross-application components.
  • Naive sequential construction fails through low extraction recall and fragile dependency migration, motivating explicit candidate selection and migration context.
  • Across WebGen-Bench and PaperBench, the method preserves functionality while improving maintainability, library utilization, and abstraction quality over other baselines.

2 Related Work

Prior work studies maintainability, library learning, and common-logic refactoring, but largely treats a single codebase or post-hoc corpora rather than online cross-application abstraction.

  • Maintainability research shows that coding agents can preserve behavior while accumulating verbosity, duplication, and architectural debt, often through local cleanups.
  • Library-learning methods mine abstractions from fixed code corpora or existing snippets, commonly framing construction as post-hoc compression or refactoring.
  • Prior work reports that library-learning gains can be confounded by extra inference budget and that learned artifacts may be rarely reused.
  • Common-logic extraction systems provide structure for corpus-level grouping, refactoring, planning, execution, and repair, but do not address online cross-application abstraction.

3 Methods

The method models sequential portfolio construction with an evolving shared library, then augments a minimal scaffold using candidate-guided extraction, consolidation, and context-aware dependency migration.

  • 3.1 Problem Definition: The agent receives each new application request, previous codebases, and the current library, producing a new codebase, an updated library, and patched prior codebases.
  • 3.1 Problem Definition: The ideal library contains every component used by at least two implemented applications, while application-specific components remain local.
  • 3.1 Problem Definition: The sequential objective seeks a Pareto trade-off between final portfolio functionality and joint-codebase maintainability.
  • 3.2 Minimal Scaffold: The minimal scaffold alternates coding with joint library extraction and migration, but assigns both tasks to one general-purpose agent without dedicated candidate selection or structured hand-off.
  • 3.3 Library Extraction and Dependency Migration Strategies: The augmented scaffold separates library extraction from dependency migration and adds index-based candidate extraction with context-aware migration.
  • 3.3 Library Extraction and Dependency Migration Strategies: Natural-language summaries index AST-defined blocks, enabling matching by function rather than surface syntax for extraction and migration candidates.
  • 3.3 Library Extraction and Dependency Migration Strategies: Pre-extraction consolidation refactors duplicated local implementations into shared application modules before Super Library extraction.
  • 3.3 Library Extraction and Dependency Migration Strategies: Extraction traces communicate provenance and replacement procedures, while call-graph context directs updates to imports, callers, callees, and obsolete implementations.

4 Experiments

The experiments evaluate Super Library Agent methods on WebGen-Bench and PaperBench, measuring functionality, maintainability, and shared-policy maintenance. SLA-FULL preserves comparable functionality while improving portfolio maintainability and reducing maintenance edits.

  • Evaluation Setup: The evaluation uses WebGen-Bench and PaperBench suites to assess application functionality and complete-portfolio maintainability.WebGen-Bench includes website-generation accuracy and appearance metrics, while PaperBench reports Code-Dev Score; maintainability covers applications and the shared library.
  • Initial Portfolio Construction: SLA-FULL achieves the best WebGen-Bench scores on LOC, token length, Erosion, and Verbosity while maintaining comparable functionality.Its reductions in LOC, token length, and Verbosity relative to zero-shot are statistically significant.
  • Initial Portfolio Construction: SLA-NAIVE reduces some size metrics but increases Structural Erosion, whereas LIBRARIAN lowers MDL while raising Erosion above zero-shot on WebGen-Bench.These results indicate risks from unguided extraction and selection strategies despite functionality preservation.
  • Initial Portfolio Construction: SLA-FULL achieves the lowest values on all five PaperBench maintainability metrics while retaining a comparable Code-Dev Score.LIBRARIAN’s post-hoc MDL selection improves neither MDL nor functionality over Zero-Shot.
  • Further Evaluation: Paired t-tests show significant improvements in several maintainability metrics, while functionality differences are not statistically significant.The study also reports inference cost and evaluates cost-reduction strategies and comparisons with recent agentic software-engineering scaffolds.
  • Post-Construction Maintenance: SLA-FULL achieves the smallest Patch Size across all three WebGen-Bench suites while preserving functionality and visual quality comparable to baselines.Centralizing shared changes in the Super Library substantially reduces application-level edits.

5 Analysis

The analysis finds that candidate selection, local consolidation, and call-graph conditioning improve library extraction, migration, maintainability, and reuse. SLA-FULL reduces app-local code over sequential rounds and captures broader behavioral and page/domain abstractions, while library access also improves application generation.

  • Candidate selection: Natural-language summary matching gives the best scores in four of five maintainability metrics by extracting the largest number of shared components.The comparison covers no explicit candidates, Ward clustering, and index-based candidate selection in SLA-NAIVE.
  • Pre-extraction codebase consolidation: Without local consolidation, Verbosity, Erosion, and LOC increase because shared components within individual codebases are not abstracted before extraction.The MDL metric does not capture this difference, possibly because of the training data used for its evaluator.
  • Call-graph conditioning: Removing call-graph conditioning lowers migration accuracy and leaves dead code after local implementations are replaced with Super Library calls.The ablation attributes the accuracy decrease to failures in handling structural dependency updates.
  • LOC dynamics: SLA-FULL tends to reduce app-local code as more applications are added, whereas the naive scaffold shows flatter LOC trajectories.Figure 3 reports values relative to each app’s first round, with shaded areas showing ±1 std over three trials across WebGen suites 1–3.
  • Library utilization: SLA-FULL exposes 13.3 components, 5–6 more than naive variants on average, indicating a larger reusable library rather than reuse concentrated in a small component set.Table 4 averages utilization over three suites and three trials.
  • Abstraction quality: SLA-FULL captures substantially more behavioral hooks/utilities and page/domain patterns beyond primitive UI components than the other methods.Representative examples show additional interaction/state-management hooks and composed page/domain components, while naive variants mostly reuse shallow widgets or thin utilities.
  • Library as a prior: Library access raises average accuracy from 80.95 to 84.35 and reduces total LOC by approximately 11%, with only a marginal change in MDL.This task-informed ablation disables extraction, migration, candidate selection, and detailed layout inputs.

6 Conclusion

The paper formulates Super Library Agent as joint generation and maintenance of related applications with a shared reusable library. Across WebGen-Bench and PaperBench, SLA preserves functionality while improving maintainability, utilization, and abstraction quality, with fewer cross-application edits after patching.

  • SLA addresses missed abstractions and incomplete migration through candidate-guided extraction and context-aware dependency migration.
  • Across WebGen-Bench and PaperBench, SLA preserves functionality while improving maintainability, library utilization, and abstraction quality.
  • Post-patch results show fewer cross-application edits, pointing toward more sustainable LLM coding for larger, evolving codebases.

Limitations

The evaluation lacks SLA-native benchmarks and relies on proxy maintainability metrics plus a single maintenance round. Consequently, performance on real applications and under repeated requirement drift remains untested.

  • The adapted single-task benchmarks do not evaluate long-horizon library growth, cross-application reuse, or codebase maintenance as directly as SLA-native benchmarks would.The maintained applications are benchmark artifacts without users, commit history, or production constraints.
  • The study measures one postdeployment maintenance round, so it does not observe library behavior under continuing requirement drift or compounded errors.
  • Code size, duplication, verbosity, and library utilization provide useful maintainability signals but do not fully measure understandability, modifiability, or extensibility.The paper calls for multi-round maintenance on real applications, cross-application consistency, regression frequency, and human judgments.

Ethical Considerations

Automated portfolio-wide code modification can propagate a faulty edit through every application importing a shared library. Deployment beyond benchmarks therefore requires human diff review and stronger regression testing, while released artifacts are not deployable software.

  • A migration that passes functional checks may still alter behavior those checks do not cover.
  • A faulty shared-library edit can propagate to all dependent applications at once.
  • Applying the method to software people depend on requires human review of generated diffs and stronger regression testing than benchmarks provide.
  • Released applications and Super Libraries are evidence for the paper’s claims, not deployable software, and lack security, accessibility, and data-handling review.
  • Generated components may resemble public-code implementations, so downstream users should verify licensing before reuse.

A Initial-Construction Results

The evaluation compares functionality and maintainability across benchmark suites, using paired statistical tests and controlled task construction. Qualitative examples illustrate how SLA-FULL centralizes repeated behavior in shared components rather than duplicating it across applications.

  • A.1 Paired Statistical Tests: Paired tests use task-level differences, bootstrap 95% confidence intervals from 10,000 resamples, and two-sided paired t-tests.
  • A Initial-Construction Results: Token length and Verbosity reductions over zero-shot are significant on both benchmarks, while SLA-FULL significantly reduces Erosion relative to naive baselines.
  • A.1 Paired Statistical Tests: No functionality metric differs significantly between methods, indicating maintainability gains do not come at the cost of task performance.
  • A Initial-Construction Results: SLA-FULL extracts a repeated localStorage persistence cycle into one library hook reached by four applications through an import and call.

B.2 Expanded Results

Expanded results examine post-construction maintenance, change-specific testing, and the cost–quality trade-off of migration strategies. The method centralizes shared policy behavior, lowers migration cost when sessions or rounds are reduced, but aggressive round reduction harms quality.

  • B.3 Qualitative Example: SLA-FULL adds the shared email validator once, leaving five of six applications unchanged for the policy update.
  • B.4 Change-Specific Test Cases: Change-specific evaluation reproduces WebVoyager actions and expected results for each target application.
  • B.2 Expanded Results: Table 11 adds files touched, portfolio-level structural changes, and Patch Size to post-construction maintenance results.
  • B.2 Expanded Results: SLA-FULL’s separate migration agents cost more than naive variants that extract and migrate in a single call.
  • B.2 Expanded Results: Reusing migration sessions significantly reduces total cost and migration turns while leaving all six quality metrics statistically indistinguishable.
  • B.2 Expanded Results: Reducing rounds from the m=2, four-round configuration to m=8 in one round lowers cost from 8.3× to 4.9× Zero-Shot, but accuracy drops by 3.6%.

D Backbone Robustness

Robustness experiments test a different coding backbone and a low-reuse portfolio. SLA-FULL retains maintainability advantages with minimax-m3, but functionality degrades when applications share little reusable structure.

  • D Backbone Robustness: With minimax-m3, SLA-FULL again produces the lowest LOC, token length, and Verbosity, while appearance is indistinguishable from the best.
  • E Low-Reuse Suite Stress Test: The low-reuse stress test constructs 16 applications spanning 13 topical groups, making shared-library reuse unfavorable.
  • E Low-Reuse Suite Stress Test: SLA-FULL falls below Zero-Shot on both accuracy and appearance in the low-reuse setting.
  • E Low-Reuse Suite Stress Test: Despite reduced functionality, SLA-FULL still leads library-building methods on LOC, token length, and Verbosity in the stress test.

F Agentic SE Scaffold Comparison

The paper compares agentic software-engineering scaffolds and details the Super Library Agent pipeline, including staged generation, extraction, consolidation, and migration. Scaffold comparisons indicate that shared-library construction targets redundancy and token footprint beyond stronger isolated coding agents.

  • Scaffold comparison: CLAUDE CODE attains the best accuracy and MDL, while OPENHANDS attains the best appearance and Erosion in the scaffold comparison.
  • Scaffold comparison: SLA-FULL leads on LOC, token length, and Verbosity because one-codebase-at-a-time agents cannot see redundancy across applications.The passage states that removing this redundancy requires a shared library rather than only a stronger scaffold.
  • Minimal scaffold: The minimal scaffold generates m codebases in parallel per round, then one Library agent extracts shared symbols into Lr and migrates existing codebases to use Lr.
  • SLA-FULL: SLA-FULL uses two-level extraction with pre-extraction consolidation and trace-guided dependency migration.Its procedure includes a code-block index Nr and accumulated extraction trace Tr.
  • SLA-FULL: SLA-FULL runs coding, local extraction, global extraction, and migration subagents per round.The local extract agent consolidates within each new codebase, while the global extract agent grows the shared Super Library from recurring cross-codebase patterns.
  • Candidate-guided extraction: Candidate selection uses one-line natural-language summaries of AST-delimited code chunks, while hashes enable incremental index updates and chunks shorter than five lines are skipped.The extraction prompt requests top-K distinct, high-value patterns appearing in at least two applications and emphasizes conservative selection.

J.2 AI Assistants

The paper distinguishes AI assistants used as research subjects from those used as bounded research and engineering aids. The experimental setup also includes figure-based evaluation of UI-test accuracy and appearance grade.

  • AI assistants as research subjects: The compared agents use deepseek-v4-flash as backbone, while other models handle code summaries, appearance judging, report parsing, and reference-layout rendering.
  • AI assistants as research and engineering aids: ChatGPT and Claude were used in bounded auxiliary roles for argument checks, idea stress-testing, related-work discovery, and implementation-level code generation.The paper states that scientific claims, experimental designs, and analyses remained subject to the project’s research process.
  • Evaluation: Figure 7 reports UI-test accuracy and appearance grade for eight Content-Presentation tasks, comparing each task without and with a library.
Loading 2608.29310v1…