将老旧代码转化为AI可操作的规范,提升系统改造安全性和可追溯性。
Reversa: A Reverse Documentation Engineering Framework for Converting Legacy Software into Operational Specifications for AI Agents

- 构建多智能体流水线,从代码中提取隐含规则并生成可追踪的规范
- 案例显示产出517条带置信度标注的规范,发现10个需人工验证的缺口
- 适合需要低风险重构老旧系统的团队或研究者参考
遗留系统蕴含业务规则、架构决策和运行异常,但这些信息常隐含在代码、数据、配置和维护实践中。而基于语言模型的编码代理依赖可靠上下文、正确性标准和行为契约,以降低修改真实系统的风险。本文提出Reversa,一种逆向文档工程框架,可将遗留软件转化为可供AI代理使用的可追踪操作规范。该框架采用多智能体流水线:各专业智能体负责项目表面映射、模块分析、隐式规则提取、架构合成、单元级规范编写及生成内容审查。强调三项机制:代码与规范间的可追溯性、显式置信度标记、以及对遗漏项的保留以供人工验证。框架以Node.js命令行工具形式发布,支持跨多个代理引擎安装技能,并使用SHA-256清单记录文件变更,确保更新或卸载时文件可恢复。除架构描述外,还报告了一项探索性案例研究:将一台ATM系统从COBOL迁移至Go,在此过程中生成517条按内部置信度分类的声明,识别出10个待验证缺口,产出53个与Gherkin语法一致的验证场景,并制定包含11项任务的重建计划,其中9项在盘点时已完成。最终的等价性验证与切换尚未完成。本研究不主张广泛的实证优越性,而是将贡献置于逆向工程、基于LLM的文档化及软件代理相关文献中,并提出一套涵盖覆盖率、可追溯性、置信度、实用性与成本的评估协议。
原文摘要 · Abstract (English)
Legacy systems concentrate business rules, architectural decisions, and operational exceptions that often remain implicit in code, data, configuration, and maintenance practices. At the same time, language-model-based coding agents depend on reliable context, correctness criteria, and behavioral contracts to modify real systems with lower risk. This paper presents Reversa, a reverse documentation engineering framework for converting legacy software into traceable operational specifications for AI agents. Reversa organizes this process as a multi-agent pipeline: specialized agents map the project surface, analyze modules, extract implicit rules, synthesize architecture, write unit-level specifications, and review generated claims. The proposal emphasizes three mechanisms: traceability between code and specification, explicit confidence marking, and preservation of gaps for human validation. The framework is distributed as a Node.js CLI, installs skills across multiple agent engines, and uses a SHA-256 manifest to preserve modified files during update or uninstall operations. In addition to the architectural description, we report an exploratory case study on migrating an ATM from COBOL to Go, in which the pipeline produced 517 claims classified by an internal confidence index, 10 registered gaps, 53 Gherkin parity scenarios, and a reconstruction plan with 9 of 11 tasks completed at inventory time. Final parity validation and cutover were not completed in this study. We do not claim broad empirical superiority; we position the contribution with respect to the literature on reverse engineering, LLM-based documentation, and software agents, and propose an evaluation protocol with metrics for coverage, traceability, confidence, utility, and cost.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。