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:
AirPlan
2026-06-12 15:56:44 +08:00
commit 6130478c96
73 changed files with 10622 additions and 0 deletions

46
commands/airplan.md Executable file
View File

@@ -0,0 +1,46 @@
---
description: "AirPlan V2 - unified scheduler with 12 modes"
argument-hint: "[arc|eng|do|dbg|xdb|sdb|ndb|ctx|dep|tst|sec|rvr] [sub-command]"
allowed-tools: "[Read, Glob, Grep, Bash, Write, Edit]"
---
# /airplan
AirPlan V2 - unified scheduler. V1 8 plugins merged into 1, adds 4 components, total 12 sub-modes.
## Sub-modes
| Mode | Role |
|------|------|
| arc | Architecture planner |
| eng | Scheduler engine |
| do | Task executor |
| dbg | Debugger |
| xdb | GUI validator |
| sdb | Static analyzer |
| ndb | Network debugger |
| ctx | Context manager |
| dep | Deployer |
| tst | Test runner |
| sec | Security scanner |
| rvr | Requirements reviewer |
## Usage
1. Parse $ARGUMENTS; default to "status" when empty.
2. Run from project root - replace MODE with first arg:
```bash
python "$HOME/plugins/airplan/scripts/airplan.py" --mode MODE --project . [OPTIONS]
```
Example: /airplan arc -> runs with --mode arc
Example: /airplan eng monitor -> runs with --mode eng --sub monitor
3. Common patterns:
- /airplan arc parallel-review --todo AirPlan/todo.md
- /airplan eng dispatch
- /airplan eng monitor
- /airplan do finish --task-id T-001 --result /path/to/result.json
4. Runtime auto-bootstraps missing AirPlan/ files.