fix: 清除错误默认模型与端口硬编码,文档机器路径占位符化
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# COBOL 语句测试基准 — 详细测试计划 v1.0
|
||||
|
||||
> 日期: 2026-06-21 | 对象: D:\cobol-java\cobol-java-v3
|
||||
> 日期: 2026-06-21 | 对象: <project-root>
|
||||
> 范围: COBOL 85/2002 语句类型全覆盖 × 解析/数据生成/分类 三维度
|
||||
|
||||
---
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# COBOL 语句测试基准 — 完整测试报告
|
||||
|
||||
> 生成日期: 2026-06-21 | 工程: D:\cobol-java\cobol-java-v3
|
||||
> 生成日期: 2026-06-21 | 工程: <project-root>
|
||||
> 分支: feat/phase2-review-fixes | 基于: featt/phase2-complete
|
||||
|
||||
---
|
||||
|
||||
@@ -362,7 +362,7 @@ class DesignDataGenerator:
|
||||
|
||||
```python
|
||||
class LLMClient:
|
||||
def __init__(self, model="gpt-4o-mini", timeout=15, cache_dir=".cache/llm")
|
||||
def __init__(self, model=None, timeout=15, cache_dir=".cache/llm") # model 经 LLM_MODEL 环境变量解析
|
||||
def call(self, messages: list[dict], retries=1) -> str
|
||||
def _key(self, msgs: list[dict]) -> str # SHA256 哈希键
|
||||
def _get(self, k: str) -> str | None # 缓存读取
|
||||
|
||||
@@ -332,7 +332,7 @@ def check_coverage(structure: dict, test_records: list[dict]) -> dict:
|
||||
|
||||
- [ ] **Step 5: 运行 import 测试确认封装正确**
|
||||
|
||||
Run: `cd D:/cobol-java/v3-gstack-code-gen && python -c "from cobol_testgen import extract_structure, generate_data, incremental_supplement; print('API OK')"`
|
||||
Run: `cd <project-root> && python -c "from cobol_testgen import extract_structure, generate_data, incremental_supplement; print('API OK')"`
|
||||
Expected: `API OK`
|
||||
|
||||
- [ ] **Step 6: Commit**
|
||||
@@ -384,7 +384,7 @@ class VerificationRun:
|
||||
|
||||
- [ ] **Step 2: 运行测试确认不破坏现有代码**
|
||||
|
||||
Run: `cd D:/cobol-java/v3-gstack-code-gen && python -c "from data.diff_result import VerificationRun; vr = VerificationRun(); print(vr.paragraph_rate, vr.quality_score)"`
|
||||
Run: `cd <project-root> && python -c "from data.diff_result import VerificationRun; vr = VerificationRun(); print(vr.paragraph_rate, vr.quality_score)"`
|
||||
Expected: `0.0 0.0`
|
||||
|
||||
- [ ] **Step 3: Commit**
|
||||
@@ -435,7 +435,7 @@ enabled = false
|
||||
|
||||
- [ ] **Step 3: 确认 Config 向后兼容**
|
||||
|
||||
Run: `cd D:/cobol-java/v3-gstack-code-gen && python -c "from config import Config; c = Config(); print(c.quality_gate_mode, c.quality_gate_decision_threshold)"`
|
||||
Run: `cd <project-root> && python -c "from config import Config; c = Config(); print(c.quality_gate_mode, c.quality_gate_decision_threshold)"`
|
||||
Expected: `warn 0.9`
|
||||
|
||||
- [ ] **Step 4: Commit**
|
||||
@@ -532,7 +532,7 @@ def run_pipeline(cfg: Config, cpath: str, cbl: str, java: str, map_path: str) ->
|
||||
|
||||
- [ ] **Step 2: 运行测试确认 import 正确**
|
||||
|
||||
Run: `cd D:/cobol-java/v3-gstack-code-gen && python -c "from orchestrator import run_pipeline; print('import OK')"`
|
||||
Run: `cd <project-root> && python -c "from orchestrator import run_pipeline; print('import OK')"`
|
||||
Expected: `import OK`
|
||||
|
||||
- [ ] **Step 3: Commit**
|
||||
@@ -651,7 +651,7 @@ class RetryHandler:
|
||||
|
||||
- [ ] **Step 3: 测试 retry 模块**
|
||||
|
||||
Run: `cd D:/cobol-java/v3-gstack-code-gen && python -c "from hina.retry import RetryHandler; print('OK')"`
|
||||
Run: `cd <project-root> && python -c "from hina.retry import RetryHandler; print('OK')"`
|
||||
Expected: `OK`
|
||||
|
||||
- [ ] **Step 4: Commit**
|
||||
@@ -851,7 +851,7 @@ def test_detect_keyword_no_match():
|
||||
|
||||
- [ ] **Step 3: 运行测试**
|
||||
|
||||
Run: `cd D:/cobol-java/v3-gstack-code-gen && python -c "from hina.classifier import detect_keyword; print('OK')"`
|
||||
Run: `cd <project-root> && python -c "from hina.classifier import detect_keyword; print('OK')"`
|
||||
Expected: `OK`
|
||||
|
||||
- [ ] **Step 4: Commit**
|
||||
@@ -992,7 +992,7 @@ def supplement_only(base_tests: list[dict], hina_gaps: list[str]) -> list[dict]:
|
||||
|
||||
- [ ] **Step 2: 测试策略模板**
|
||||
|
||||
Run: `cd D:/cobol-java/v3-gstack-code-gen && python -c "from hina.strategy import get_strategy; s = get_strategy('マッチング'); print(len(s['required']))"`
|
||||
Run: `cd <project-root> && python -c "from hina.strategy import get_strategy; s = get_strategy('マッチング'); print(len(s['required']))"`
|
||||
Expected: `9`
|
||||
|
||||
- [ ] **Step 3: Commit**
|
||||
@@ -1088,7 +1088,7 @@ def _compute_score(coverage: dict, hina_result: dict) -> float:
|
||||
|
||||
- [ ] **Step 2: 测试质量门禁**
|
||||
|
||||
Run: `cd D:/cobol-java/v3-gstack-code-gen && python -c "from hina.gate import check; r = check([], {}, {'branch_rate':0.8,'paragraph_rate':0.9,'uncovered_decision_ids':[1]}); print(r['passed'], r['score'])"`
|
||||
Run: `cd <project-root> && python -c "from hina.gate import check; r = check([], {}, {'branch_rate':0.8,'paragraph_rate':0.9,'uncovered_decision_ids':[1]}); print(r['passed'], r['score'])"`
|
||||
Expected: `False 0.87`
|
||||
|
||||
- [ ] **Step 3: Commit**
|
||||
@@ -1437,7 +1437,7 @@ table{{border-collapse:collapse}} td,th{{padding:6px 12px}}
|
||||
|
||||
- [ ] **Step 2: 运行测试确认 HTML 生成正确**
|
||||
|
||||
Run: `cd D:/cobol-java/v3-gstack-code-gen && python -m pytest tests/report/test_generator.py -v`
|
||||
Run: `cd <project-root> && python -m pytest tests/report/test_generator.py -v`
|
||||
Expected: `3 passed`
|
||||
|
||||
- [ ] **Step 3: Commit**
|
||||
@@ -1583,7 +1583,7 @@ def test_check_coverage():
|
||||
|
||||
- [ ] **Step 2: 运行集成测试**
|
||||
|
||||
Run: `cd D:/cobol-java/v3-gstack-code-gen && python -m pytest tests/test_quality/test_integration.py -v`
|
||||
Run: `cd <project-root> && python -m pytest tests/test_quality/test_integration.py -v`
|
||||
Expected: `6 passed`
|
||||
|
||||
- [ ] **Step 3: 最终 Commit**
|
||||
|
||||
@@ -217,7 +217,7 @@ class VerificationRun:
|
||||
│ project_name: str = "" │
|
||||
│ copybook_paths: list = ["./copybooks"] │
|
||||
│ dialect: str = "ibm" # cobc -std 参数 │
|
||||
│ llm_model: str = "gpt-4o-mini" # LLM 模型 │
|
||||
│ llm_model: str = "deepseek-v4-flash" # LLM 模型 │
|
||||
│ llm_timeout: int = 15 │
|
||||
│ llm_cache_dir: str = ".cache/llm" │
|
||||
│ coverage_default: str = "boundary" │
|
||||
@@ -545,7 +545,7 @@ class VerificationRun:
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────────────┐
|
||||
│ LLMClient(model="gpt-4o-mini", timeout=15, cache_dir=".cache/llm") │
|
||||
│ LLMClient(timeout=15, cache_dir=".cache/llm") # 模型经 LLM_MODEL 环境变量解析 │
|
||||
│ call(messages: list[dict], retries=1) → str │
|
||||
│ │
|
||||
│ 通信契约: POST {base}/chat/completions │
|
||||
|
||||
@@ -122,7 +122,7 @@ except ImportError:
|
||||
### 验证方法
|
||||
|
||||
```bash
|
||||
cd C:\Users\marye\Desktop\2026技术大赛\cobol-java-v3
|
||||
cd <project-root>
|
||||
set COB_LIBRARY_PATH=<tna>\bin;<v3>\gixsql\lib
|
||||
set GIXSQL_DB_PATH=C:\Temp\gix
|
||||
python -m cobol_testgen --gcov <tna>\src\ZAN06UPD.cbl runtime\
|
||||
|
||||
+2
-2
@@ -358,7 +358,7 @@ L6: E2E UI 测试 ─ Playwright 浏览器测试 ← 新增层级
|
||||
|
||||
| # | 测试名 | 内容 | 期待 |
|
||||
|:-:|:-------|:-----|:------|
|
||||
| CF-01 | Config: 默认值 | 无参数 | runner_mode=native, llm_model=gpt-4o-mini |
|
||||
| CF-01 | Config: 默认值 | 无参数 | runner_mode=native, llm_model=deepseek-v4-flash |
|
||||
| CF-02 | Config: from_toml | 有效 TOML 文件 | 正确解析 |
|
||||
| CF-03 | Config: from_toml 文件不存在 | 不存在路径 | 默认值 |
|
||||
| CF-04 | Config: from_toml 非法 TOML | 格式错误 | 妥善处理/不崩溃 |
|
||||
@@ -881,4 +881,4 @@ L1 类型测试 (Ph7-8): 80 (matching/division/CSV/CALL/SORT/parametrized)
|
||||
3. **Docker 不可用**: 当前环境无 Docker Desktop, Spark runner 不可测试
|
||||
4. **外部依赖**: 実 COBOL 测试需要 WSL + GnuCOBOL + Java (GnuCOBOL 3.1.2.0, OpenJDK 17)
|
||||
5. **LLM API 成本**: Agent 测试依赖 LLM 调用, 缓存命中可降低成本
|
||||
6. **沙盒权限**: settings.json 需包含 `D:/cobol-java/**` 读写权限以便子 Agent 并行开发
|
||||
6. **沙盒权限**: settings.json 需包含 `<project-root>/**` 读写权限以便子 Agent 并行开发
|
||||
|
||||
+1
-1
@@ -400,7 +400,7 @@ FieldTree + Field (data/field_tree.py) ← Agent1Parser LLM 解析 COPYBOOK 的
|
||||
```
|
||||
`Agent2Data.design()` 的 LLM 调用结果被 `complete_tests` 完全替换,该 LLM 调用除了产生 `spark_config` 外没有实际用途。LLM 费用被浪费。
|
||||
|
||||
8. **硬编码 LLM 成本** — `orchestrator.py:30,111`:`vr.llm_cost += 0.002`(固定 $0.002/次),与实际模型(Config 中 `gpt-4o-mini`)的 token 计费无关。
|
||||
8. **硬编码 LLM 成本** — `orchestrator.py:30,111`:`vr.llm_cost += 0.002`(固定 $0.002/次),与实际模型(Config 中配置的 LLM)的 token 计费无关。
|
||||
|
||||
9. **`cobol_testgen/generate_data()` 中的条件值强制相等** — `cobol_testgen/__init__.py:1069-1077`:
|
||||
```python
|
||||
|
||||
Reference in New Issue
Block a user