feat: AirPlan V2 — 全专家插件强制路由 + 事件系统规范化
P0-8 扩大: do_mode.py finish_worker 全专家插件强制路由 - GUI→XDB, network→NDB, C/C++→SDB, done→Rvr, blocked/failed→Dbg - 证据去重: 已有 xdbSessions/ndbSessions/sdbReports/rvrReviewed 则跳过 P1-GAP17: 事件 emit 规范化 - 新增 7 个事件常量 (TASK_ENTERED, TASK_FINISHED, ENGINE_ENTERED 等) - 全部 emit 调用替换字符串字面量为常量,零残留 - 30 个事件类型常量全部定义且唯一 P1-GAP18: 事件日志原子轮转 - emit 计数器每 128 次检查轮转,避免每次 emit 读文件 - 清除未使用的 _emit_with_completion/_pending_merge_complete - 原子轮转: tempfile+os.replace 保证不损坏 eng 极端接管: 强制调用全部专家插件 (Dbg/XDB/NDB/SDB/Rvr) commands/do.md: 更新为全专家插件路由文档 全量测试: 69 通过, 0 失败 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
57
commands/sec.md
Executable file
57
commands/sec.md
Executable file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
description: "AirPlan sec mode - security scanner for sensitive data detection"
|
||||
argument-hint: "[scan|status]"
|
||||
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
|
||||
---
|
||||
|
||||
# /sec
|
||||
|
||||
AirSec 是安全扫描器。扫描制品中的敏感数据(API 密钥、令牌、密码),支持 advisory(只报告)和 blocking(阻止合并)两种模式。
|
||||
|
||||
## 两种扫描模式
|
||||
|
||||
| 模式 | --sec-mode | 行为 |
|
||||
|------|-----------|------|
|
||||
| advisory | `advisory` | 只报告,不阻止 |
|
||||
| blocking | `blocking` | 发现敏感数据时阻止合并 |
|
||||
|
||||
## 子命令
|
||||
|
||||
### scan — 执行安全扫描
|
||||
|
||||
扫描单个文件:
|
||||
```bash
|
||||
python scripts/airplan.py --mode sec --project . --sub scan --task-id T-001 --scan-path ./src/config.cpp --sec-mode blocking
|
||||
```
|
||||
|
||||
扫描整个目录:
|
||||
```bash
|
||||
python scripts/airplan.py --mode sec --project . --sub scan --task-id T-001 --scan-path ./src --sec-mode advisory
|
||||
```
|
||||
|
||||
不传 `--scan-path` 时扫描 Worker result:
|
||||
```bash
|
||||
python scripts/airplan.py --mode sec --project . --sub scan --task-id T-001 --sec-mode blocking
|
||||
```
|
||||
|
||||
参数:
|
||||
- `--task-id`:关联任务 ID
|
||||
- `--scan-path`:扫描目标路径(文件或目录,可选)
|
||||
- `--sec-mode`:`advisory`(默认)或 `blocking`
|
||||
|
||||
返回 `{task_id, clean, findings, whitelisted, mode}`。emit `sec.scan` 事件。
|
||||
|
||||
### status — 查看扫描状态
|
||||
|
||||
```bash
|
||||
python scripts/airplan.py --mode sec --project . --sub status
|
||||
```
|
||||
|
||||
## 集成路径
|
||||
|
||||
**Do Worker finish 前**:Worker 完成代码后、调 finish 前,先调 sec scan:
|
||||
```bash
|
||||
python scripts/airplan.py --mode sec --project . --sub scan --task-id {tid} --sec-mode blocking
|
||||
```
|
||||
|
||||
**Eng merge 前**:merge_worker_result Phase 1 验证后检查 sec 扫描结果。`clean=false` 时阻止合并。
|
||||
Reference in New Issue
Block a user