arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2610.17197cs.SEcs.AI
收藏

不丢失知识的代码删除:Python库的再生式软件

Regenerative Coding: Deleting Code Without Losing Knowledge? A Case Study with babregen and Local Small Language Models

Thomas Bartz-Beielstein, Marcel Samuel Klimm, Alexander Hinterleitner

AI总结:

本研究将Fowler的7种原语应用于安全关键型Python库spotforecast2-safe,通过开源工具spotregen实现再生式软件,解决代码删除不丢失知识的问题,实验推动转向本地模型架构。

摘要:

在“软件3.0”时代,智能体可在数分钟内重写完整程序,将代码作为唯一事实来源的传统方法变得存疑。Fowler提出了7种原语,为再生式软件奠定框架,使程序可被删除并重建而不丢失知识。知识存储在跟踪目录的机器可读记录中,从中为每个单元构建“再生包”。该包是单个文件,包含模块的架构、意图、决策、公共契约、评估和使用者,但无实现代码,仅含其可能导入的一个依赖模块。开源包spotregen实现了这些原语并提供图形用户界面。本报告展示了Fowler原语在安全关键型预测库spotforecast2-safe上的首次应用。首次实验中,协调研究的Claude Code会话消耗了超过4300万token,几乎全是每次请求重发的自身历史,这促使转向基于本地模型的架构。确定性检查和维护人员对结果进行了判断。报告包含每个原语的可执行示例,每个示例均针对仓库或其临时副本运行spotregen。

英文摘要:

This report presents a case study of regenerative software, a concept that Fowler introduced: a module of a program is deleted and rebuilt by local small language models from the records of the module, its public signatures and docstrings, and the source of its durable evaluations. The open-source tool babregen implements the seven primitives of Fowler in an approach that is referred to as regenerative coding. The primitives keep the intent, the architecture, and the evaluations of a module as durable records. A static check compares these records with the source code. A mutation analysis and a strict acceptance rule test the strength of the evaluations. No generation of a module has access to the old code. Two human steps examine the surviving mutants and the rejected regenerations, so that the causes of a failure can be traced. In the study, two local small language models rebuilt working modules: the larger model was accepted at the first attempt in every run, the smaller one after a repair in every run but one. The acceptance rule rejected one rebuild that violated a documented input contract. A check after the freeze found that one accepted rebuild exposed an additional name through a star import. The results indicate that the knowledge that the evaluations exercise can outlive the implementation. Whether this holds for the knowledge that the maintenance of a mature module needs remains open. The contributions are (1) the tool, which maps each primitive to a record, checks, and a command, (2) a protocol for a deletion test and its results, (3) two human steps as commands, (4) a comparison of drafted records with records that the maintainer authored or approved, and (5) a worked example in an executable manuscript.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑