feat: add agent mode pipeline (orchestrator_jcl)

- Add --mode agent to main.py for jcl-cobol-data-create integration
- New orchestrator_jcl.py: 5-phase pipeline
  Phase 1: Call jcl-cobol-data-create (DeepSeek LLM) to generate JSON test data
  Phase 2: Parse COBOL FD layouts via analyze_fd_layout
  Phase 3: Compile COBOL + subprograms + Java (once)
  Phase 4: Per-group loop: JSON->binary->run COBOL->run Java->compare->report
  Phase 5: Aggregate summary
- Fix orchestrator.py import error (check_coverage from cobol_testgen.coverage)
- Normalize jcl JSON field names (R01-APPL-ID -> R01APPL-ID) for FD layout matching
- Auto-compile subprograms by scanning CALL statements in COBOL source
- Update README.md with agent mode usage and architecture docs
- jcl-cobol-data-create api_client.py: bypass Windows system proxy
This commit is contained in:
2026-07-27 20:20:30 +08:00
parent 0203ead96b
commit a3918e2162
4 changed files with 598 additions and 19 deletions
+25 -2
View File
@@ -18,12 +18,21 @@ python test-data/s30_db_e2e.py
# 单程序运行(自动路由:含 EXEC SQL → DB 管道,否则非 DB)
python -m cobol_testgen ../cobol-tna-system/src/KIN01INP.cbl
# Agent 模式(调用 jcl-cobol-data-create + DeepSeek LLM 生成数据)
python main.py --mode agent \
--design "D:/cobol-tna-system/詳細設計書/詳細設計書_ZAN04MAT.md" \
--cobol-src "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 "output"
```
## 架构
```
CLI → orchestrator / orchestrator_db
CLI → orchestrator / orchestrator_db / orchestrator_jcl
┌─────┼──────┬──────────┬──────────┐
▼ ▼ ▼ ▼ ▼
@@ -31,9 +40,10 @@ cobol_testgen runners comparator agents
(数据生成) (编译运行) (比对验证) (LLM)
```
条管道自动路由:
条管道自动路由:
- **非 DB**`cobc` 编译 → flat file 二进制比对
- **DB**`gixpp` ESQL 预处理 → `cobc -l gixsql` 编译 → SQLite 表比对
- **Agent**:调用 jcl-cobol-data-create (DeepSeek LLM) 生成测试数据 → 转换二进制 → COBOL/Java 编译运行 → 逐 group 循环比对
## 文档索引
@@ -58,6 +68,19 @@ python test-data/s30_db_e2e.py
# 带 gcov 覆盖率的单程序运行
python -m cobol_testgen --gcov <cobol_src> runtime/
# Agent 模式(调用 jcl-cobol-data-create LLM 生成测试数据 + 全管道验证)
python main.py --mode agent \
--design <詳細設計書.md> --cobol-src <program.cbl> \
--file-db-md <COPY句定義書.md> --cpy <copybook_dir> \
--db-md <DB定義書.md> --output output/
# Agent 模式 + Java 比对(需要 java-src 和 mapping YAML
python main.py --mode agent \
--design <詳細設計書.md> --cobol-src <program.cbl> \
--file-db-md <COPY句定義書.md> --cpy <copybook_dir> \
--db-md <DB定義書.md> --output output/ \
--java-src <java_dir> --mapping <mapping.yaml>
# 诊断脚本
python diagnose_db2.py # DB 全流程
python diagnose_kind8dbrun.py # DB 编译运行