ChatPaper.aiChatPaper

超級程式庫代理器:超越單一程式碼庫之多應用程式聯合生成與維護

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

August 29, 2026
作者: Daegyu Sung, Yukyeong Lee, Geon Park, Yumin Choi, Sung Ju Hwang
cs.AI

摘要

組織經常開發並維護相關應用程式的組合:這些可獨立部署的程式碼庫共享大量領域邏輯、介面模式或運作慣例。隨著 LLM 編碼代理日益被用於生成和維護此類軟體,逐一應用程式的樸素工作流程會在程式碼庫之間重複共享邏輯,並使長期的代理式維護逐漸累積冗長度、死程式碼與結構侵蝕。我們提出「超級函式庫代理問題」(Super Library Agent problem),其中代理依序生成 N 個相關應用程式的組合,同時維護一個共享的「超級函式庫」,內含可跨應用程式重複使用的元件。原則上,一個最簡的順序式骨架可以抽取共享程式碼並將應用程式遷移到不斷演進的函式庫,但在實務上卻存在抽取召回率低與依賴遷移脆弱的問題。我們透過以下方式解決這些失敗:對程式碼區塊摘要進行候選導向抽取、在抽取前進行程式碼庫整併,以及利用抽取軌跡與呼叫圖資訊進行上下文感知遷移。在 WebGen-Bench 與 PaperBench 上,我們的方法在保留應用程式功能之餘,相較於零次學習顯著降低了冗餘與 token 佔用量(冗長度、token 長度),並避免了由樸素函式庫建構所引入的結構侵蝕,同時在 LOC 與 MDL 上也有進一步的減少。我們的程式碼位於 https://github.com/sbigstar0310/super-library-agent。
English
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.