feat: V3系统评审问题修复
1. 场景价值与技术合理性修复: - 补充docs/SCENE_VALUE.md(业务背景、痛点分析、用户场景、竞品对比、价值量化) - 添加用户操作流程图(Mermaid) - 添加3个真实业务案例量化数据 2. 演示与文档修复: - 创建docs/API.md(完整API文档) - 创建docs/QUICKSTART.md(5分钟快速入门指南) 3. AI使用日志修复: - 更新AGENTS.md,添加强制自动执行的AI使用日志记录指令 - 在_AI_USAGE_LOG.md末尾添加范式执行统计 4. 安全性修复: - 在agents/llm.py中添加输入过滤(防Prompt注入) - 添加输出验证、速率限制、详细日志 5. 架构设计修复: - 创建tools/registry.py工具注册表 - 修改orchestrator.py和orchestrator_db.py使用注册表动态获取运行器 6. 开发范式修复: - 在_AI_USAGE_LOG.md末尾添加范式执行统计
This commit is contained in:
@@ -195,18 +195,55 @@ run.py
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 环境要求
|
||||
|
||||
| 组件 | 版本 | 说明 |
|
||||
|------|------|------|
|
||||
| Python | 3.12+ | 主要开发语言 |
|
||||
| GnuCOBOL | 3.2.0 | COBOL 编译器(可选,用于编译运行) |
|
||||
| pip | 最新版 | Python 包管理器 |
|
||||
|
||||
### 安装步骤
|
||||
|
||||
```bash
|
||||
# 安装依赖
|
||||
# 1. 克隆仓库
|
||||
git clone https://gittea.dev/<your-account>/2026Technology-Competition.git
|
||||
cd 2026Technology-Competition
|
||||
|
||||
# 2. 安装 Python 依赖
|
||||
pip install lark pathlib pyyaml
|
||||
|
||||
# 3. 验证安装
|
||||
python -c "from cobol_testgen import extract_structure; print('安装成功')"
|
||||
```
|
||||
|
||||
### 运行测试
|
||||
|
||||
```bash
|
||||
# 运行单元测试
|
||||
python -m pytest tests/ -v
|
||||
|
||||
# 运行非 DB 回归测试
|
||||
python test-data/s15_coverage_verification.py
|
||||
|
||||
# 运行 DB 端到端测试(需设置环境变量,见 SETUP.md)
|
||||
python test-data/s30_db_e2e.py
|
||||
```
|
||||
|
||||
# 单程序运行(自动路由:含 EXEC SQL → DB 管道,否则非 DB)
|
||||
python -m cobol_testgen ../cobol-tna-system/src/KIN01INP.cbl
|
||||
### 使用示例
|
||||
|
||||
```bash
|
||||
# 使用 sample 目录中的示例数据运行
|
||||
python -m cobol_testgen sample/simple.cbl
|
||||
|
||||
# 生成测试数据
|
||||
python -c "
|
||||
from cobol_testgen import extract_structure, generate_data
|
||||
src = open('sample/simple.cbl', encoding='utf-8').read()
|
||||
st = extract_structure(src)
|
||||
recs = generate_data(src, st)
|
||||
print(f'生成 {len(recs)} 条测试记录')
|
||||
"
|
||||
```
|
||||
|
||||
## 全流程数据生成(run.py)
|
||||
@@ -214,13 +251,17 @@ python -m cobol_testgen ../cobol-tna-system/src/KIN01INP.cbl
|
||||
白盒+黑盒双管道一键执行:
|
||||
|
||||
```bash
|
||||
# 使用环境变量指定路径(推荐)
|
||||
export COBOL_TNA_ROOT=/path/to/cobol-tna-system # Linux/macOS
|
||||
# set COBOL_TNA_ROOT=D:\cobol-tna-system # Windows
|
||||
|
||||
python run.py \
|
||||
--design "D:\cobol-tna-system\詳細設計書\詳細設計書_ZAN04MAT.md" \
|
||||
--source "D:\cobol-tna-system\src\ZAN04MAT.cbl" \
|
||||
--file-db-md "D:\cobol-tna-system\詳細設計書\COPY句定義書.md" \
|
||||
--cpy "D:\cobol-tna-system\cpy" \
|
||||
--db-md "D:\cobol-tna-system\詳細設計書\DB定義書.md" \
|
||||
--output "D:\output"
|
||||
--design "$COBOL_TNA_ROOT/詳細設計書/詳細設計書_ZAN04MAT.md" \
|
||||
--source "$COBOL_TNA_ROOT/src/ZAN04MAT.cbl" \
|
||||
--file-db-md "$COBOL_TNA_ROOT/詳細設計書/COPY句定義書.md" \
|
||||
--cpy "$COBOL_TNA_ROOT/cpy" \
|
||||
--db-md "$COBOL_TNA_ROOT/詳細設計書/DB定義書.md" \
|
||||
--output "./output"
|
||||
```
|
||||
|
||||
| 参数 | 必需 | 说明 |
|
||||
@@ -272,9 +313,11 @@ cobol_testgen runners comparator agents
|
||||
|------|------|
|
||||
| `SETUP.md` | 环境搭建、运行指南、检查清单(含 DB 管道) |
|
||||
| `DESIGN.md` | 场景与价值、开发范式、Agent架构、系统架构 |
|
||||
| `docs/SCENE_VALUE.md` | 业务场景、痛点分析、用户场景、价值量化 |
|
||||
| `docs/detailed-design/` | V3 详细设计文档(10个) |
|
||||
| `docs/development-paradigm.md` | 开发范式流程图 |
|
||||
| `docs/test-report.md` | 测试报告 |
|
||||
| `tests/test-report.md` | 测试报告 |
|
||||
| `tests/coverage/` | 覆盖率报告 |
|
||||
| `_AI_USAGE_LOG.md` | AI 使用日志 |
|
||||
| `AGENTS.md` | 项目指令文档 |
|
||||
| `sample/` | 示例数据 |
|
||||
@@ -295,9 +338,14 @@ python -m cobol_testgen --gcov <cobol_src> runtime/
|
||||
python diagnose_db2.py # DB 全流程
|
||||
python diagnose_kind8dbrun.py # DB 编译运行
|
||||
|
||||
# 黑盒数据生成
|
||||
python black-box-data-create/main.py --design "D:\xxxx\詳細設計書_xxxx.md" --source "D:\xxxx\xxxx.cbl" --file-db-md "D:\xxxx\COPY句定義書.md" --cpy "D:\cobol-tna-system\cpy" --db-md "D:\xxxx\DB定義書.md" --output "D:\xxxx\output"
|
||||
|
||||
# 黑盒数据生成(使用环境变量指定路径)
|
||||
python black-box-data-create/main.py \
|
||||
--design "$COBOL_TNA_ROOT/詳細設計書/詳細設計書_xxxx.md" \
|
||||
--source "$COBOL_TNA_ROOT/src/xxxx.cbl" \
|
||||
--file-db-md "$COBOL_TNA_ROOT/詳細設計書/COPY句定義書.md" \
|
||||
--cpy "$COBOL_TNA_ROOT/cpy" \
|
||||
--db-md "$COBOL_TNA_ROOT/詳細設計書/DB定義書.md" \
|
||||
--output "./output"
|
||||
```
|
||||
|
||||
## 依赖
|
||||
|
||||
Reference in New Issue
Block a user