Files
AirPlan-V2/commands/dbg.md
AirLongDian 9ad232af38 docs: 全部 12 个命令文件完整化 — 消除 P0/P1 操作歧义
P0: 9 个存根命令文件从 11 行模板扩展为完整操作文档
- dbg: 7 步工作流表格 + 证据类型 + 子命令 + Dbg↔Do 集成路径
- ctx: 三级降级压缩 + 质量校验 + Token 估算 + 陈旧锁清理
- dep: SSH 部署流程 + MD5 校验 + systemd 管理
- tst: 5 种测试框架 + run 命令 + T-TEST 集成
- sec: advisory/blocking 双模式 + 文件/目录/Woker result 三种扫描
- rvr: 审查模式 + highRiskAudit + code-to-design + Eng merge 集成
- sdb: 6 种后端 + diff 模式 + Dbg 取证集成
- ndb: 网络抓包 + Dbg 取证集成
- xdb: kmsgrab/xvfb/fallback 三后端 + Dbg/Do GUI 验证集成

P1: 3 个有内容文件的歧义修复
- do: AirDbg 路由具体命令 + 证据采集(xdb/ndb/sdb/tst)命令
- arc: 三阶段→命令映射表 + phase 推进方式
- eng: monitor 轮询循环伪代码(Agent 无时钟概念,必须循环调 monitor)

全部命令统一使用 `python scripts/airplan.py` 路径(清除旧 $HOME/plugins 引用)

63 项功能测试全通过

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-11 15:57:12 +08:00

64 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
description: "AirPlan dbg mode - 7-step debug workflow with evidence-first gate"
argument-hint: "[start|snapshot|status]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /dbg
AirDbg 是调试器,强制 7 步证据先于修复流程。EvidenceFirstGate 硬门控——未取证不可改代码INV-9
## 硬规则
1. **先读后写** — 修改代码前必须至少完成一项取证(截图/抓包/静态分析/日志分析/代码追踪/复现)
2. **修复前快照** — 修改代码前必须 `--sub snapshot` 创建回滚点
3. **步骤不可跳过** — 7 步工作流按顺序推进,每步需要对应证据
## 7 步工作流
| 步 | 名称 | 需要证据 | 操作 |
|----|------|---------|------|
| 1 | confirm_symptoms | 症状描述 | `--sub start` 初始化会话 |
| 2 | load_context | | 读取相关文件、日志、配置 |
| 3 | reproduce | (可跳过) | 复现或标记为不可复现 |
| 4 | locate_root_cause | ≥1 种证据 | 分析证据定位根因 |
| 5 | fix | 根因分析结论 | 先 `--sub snapshot`,再改代码 |
| 6 | verify_again | 测试结果 | 验证修复有效 |
| 7 | document | | 写 debug-log.md关闭会话 |
## 子命令
### start — 启动调试会话
```bash
python scripts/airplan.py --mode dbg --project . --sub start --task-id T-001
```
返回 `{sessionId, currentStep, steps}`。会话状态写入 `AirPlan/state/airdbg/sessions/`
### snapshot — 修复前创建回滚点
```bash
python scripts/airplan.py --mode dbg --project . --sub snapshot --task-id T-001
```
在当前 HEAD 创建 git tag返回 `{snapshot_ref}`
### status — 查看调试状态
```bash
python scripts/airplan.py --mode dbg --project . --sub status
```
## 集成路径
**Eng → Dbg**`monitor_engine()` 检测到 stalled/blocked Worker 且 action=`"upgraded-to-airdbg"` 时:
1.`interventions[].sessionId` 获取 Dbg 会话 ID
2.`--sub start --task-id {tid}` 开始 Dbg 会话
3. Dbg 完成后finish Worker然后 merge
**Dbg → Do finish**Dbg 修复完成后回到原任务:
```bash
python scripts/airplan.py --mode do --project . --sub finish --task-id T-001 --result AirPlan/state/airdo/tasks/T-001/result.json
```