chore: 删除 5 个遗留调试脚本并同步文档引用

- 删除 agent_loop.py / dwg_review_agent.py / countOfCircle.py
  (硬编码 DeepSeek API Key)与 test.py / test_autoagent.py
  (重复实现;且 test_autoagent.py 名字与 pytest 的 test_*.py 收集规则冲突)
- CODEBUDDY.md 测试章节改为「pytest 快层 + verify_* 慢层」
- review_checklist.json 描述改指 dwg_review 包
- ai.memory 同步引用与历史说明

安全:Key 已随提交 bdd77af 进入 git 历史并推到远程,删除文件不能清除历史,
需去 DeepSeek 控制台轮换该 Key(已在 ai.memory 备案)。
This commit is contained in:
gjm committed 2026-10-14 19:07:35 +08:00
1 parent 0656397a68
commit 8c0fcfee83
10 files changed
+53 -701

No files matched your search

+18 -6
View File
@@ -1,6 +1,6 @@
---
name: 环境与外部资源
description: CadProject 的构建/运行要点、CAD SDK 路径、测试脚本等外部资源指引
description: CadProject 的构建/运行要点、CAD SDK 路径、测试分层(pytest 快层 + verify_* 慢层)等外部资源指引
type: reference
---
@@ -26,16 +26,28 @@ type: reference
- 先启动 **已加载插件的 CAD**,确认 `127.0.0.1:8080` 在监听。
- 脚本通过 TCP 连接 `127.0.0.1:8080` 收发 JSON-RPC。
## 测试脚本(根目录,非单元测试)
## 测试(两层,互不替代)
**快层 —— pytest 离线单元测试**(`tests/`,假 LLM + 假基座,无需 CAD、不联网、秒级):
- `pip install -r requirements-dev.txt` → `python -m pytest`。
- 配置:`pytest.ini`(`testpaths = tests`)、根 `conftest.py`(加 `sys.path` + `RENDER_WAIT=0` / `REPORT_DIR=tmp` fixture)。
- 陷阱:`dwg_review.config` 常量导入期定值,改 `os.environ` 无效,须 `monkeypatch.setattr(config, ...)`。
**慢层 —— 端到端冒烟脚本**(根目录 `verify_*.py`,需 CAD 在线且 `127.0.0.1:8080` 监听):
| 脚本 | 作用 |
| --- | --- |
| `test.py` | 截图 → 发 DeepSeek 视觉模型 → 回答 |
| `test_autoagent.py` | 拉一次视口截图存 `test_screenshot.png` |
| `countOfCircle.py` | 伪造 `zoom_window_normalized` 调用,验证 TCP 链路 |
| `agent_loop.py` | 完整 Agent 循环(多回合),需 openai 包与 API Key |
| `verify_mcp_frame.py` | 基座最小集:分帧 / id / isError 映射 |
| `verify_mcp_tcp_hardening.py` | TCP 收发路径加固(超长帧 / 粘包 / 半关闭) |
| `verify_mcp_fault_injection.py` | 工具异常保护(类型错误不再崩 CAD) |
| `verify_stdio_bridge.py` | stdio ↔ TCP 桥(协议协商 / 转发 / 通知) |
| `verify_annotate.py` | 批注工具运行时验证(绘制/校验/改属性/清理);`--keep` 保留批注 |
> 历史:根目录 `test.py` / `test_autoagent.py` / `countOfCircle.py` / `agent_loop.py` /
> `dwg_review_agent.py` 五个遗留调试脚本已于 2026-10-14 删除(前三个含硬编码 API Key,
> 后两个是重复实现)。`test_screenshot.png` 是 `test_autoagent.py` 的残留产物。
## 两个构建目标
| 目标 | 产物 | 作用 |