kali20gakki/msAgent / skills/host-cpu/msagent-perf-cpu-perf-triage
msagent-perf-cpu-perf-triage
Verified昇腾 Host 侧性能异常归因编排:训练/推理出现症状(变慢、抖动、利用率低)且原因 不明时,按「配置复核 → 归因量化」编排 config-audit 完成配置判型,并输出按 代价×收益排序的 Action。触发:训练变慢、step 抖动、性能下降、利用率低、查根因、 瓶颈在哪。 不用于:只要配置检查(→ perf-cpu-config-audit)、只要绑核方案 (→ perf-cpu-bind-tune)——窄诉求直接用对应技能更快;本技能用于症状不明、 需多源归因的场景。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 6.7 KB |
| references/degradation.md | markdown | 2.2 KB |
| references/quant-rules.md | markdown | 3.7 KB |
| references/triage-playbook.md | markdown | 4.0 KB |
| resources/action-templates.json | config | 3.8 KB |
| resources/triage-report.template.html | other | 7.9 KB |
| scripts/action_build.py | script | 9.9 KB |
| scripts/audit_or_reuse.py | script | 8.5 KB |
| scripts/quantify.py | script | 8.1 KB |
| scripts/report.py | script | 9.6 KB |
| scripts/workspace.py | script | 4.4 KB |
references/triage-playbook.md
View on GitHub# 编排 Playbook(阶段间控制流细则)
本文件约束 Agent 的调度顺序与分支判决,**分支以脚本 verdict 为准**,不得凭叙述改写数值。
## 1. 输入最小面
| 项 | 必填 | 缺失处理 |
| ---- | ---- | ---- |
| 症状 | 是 | 反问三选一:变慢 / 抖动 / 利用率低 |
| 框架 | 是(可推断) | 用 config-audit 的进程发现链推断,标注推断来源 |
| step 周期 | 否 | 缺失则标注「未与 step 对齐」 |
运行时输入(卡号 / 核集 / 观测窗)在 tracing 接入后再纳入;本期不询问、不采集。
## 2. 阶段顺序(串行,不得跳)
```
阶段0 配置复核 → 归因量化 → 动作与汇总
↓
R0 分支 运行时 / 效率维(本期未接入,not_observable)
```
**为什么配置优先**:配置类改动成本最低、可即时回滚,先以最小代价排除;即使配置告警
不是唯一主因,也能避免「带着错配置做运行时归因」得出失真结论。
## 3. 分支判决表
| 判决条件 | 结论 | 动作取向 |
| ---- | ---- | ---- |
| `config_primary_candidate = true` | R0 配置主因候选 | 先出 L0/L1 试证动作(可回滚),复采验证后再决定是否深挖 |
| 无配置主因 / 无运行时数据 | R4 仅完成配置判型 | 输出配置维结论并标注「运行时维未接入」;不得声称已排除调度 / 效率问题 |
阈值 5% 为**呈现优先级阈值**(判断"哪一维是主因"),不是告警阈值;两维可同时存在。
运行时数据接入后的分支判决见文末附录。
## 4. 每阶段验收条件
| 阶段 | 通过条件 | 不通过的处置 |
| ---- | ---- | ---- |
| 阶段0 | 产出 `config_triage.json` 且 `status ∈ {REUSED, RERUN, SKIPPED}` | `UNAVAILABLE`/`FAILED` → 记录降级,结论「无法归因」 |
| 量化 | `attribution.json` 字段完整,缺项为 `null` | 打扰/等待均为 `null` → `converged=false`,结论只含配置判型 |
| 动作 | `action_plan.json` 每条动作字段完整(type/scope/timing/expected_effect/risk) | 缺字段的动作丢弃并记降级 |
## 5. 例外处理
- **findings 过期**:自动重跑并标注新旧差异;不得静默使用过期判型。
- **复采验证**:动作执行后用同参数复采同窗,对比配置判定与关键运行指标
(运行时数据接入后追加 `disturb_pct` / `wait_pct`)。
## 6. 禁止事项
- 跳过阶段0 直接下结论;
- 用 LLM 重算占比(一律取 `attribution.json`);
- 把 `not_observable` 说成"没有问题"(必须说明是缺位);
- 在本 Skill 内生成精确绑核核集(应转 bind-tune)。
## 附:运行时维分支与动作映射(tracing 接入后启用)
| 判决条件 | 结论 | 动作取向 |
| ---- | ---- | ---- |
| `disturb_pct ≥ 5%` 且为最大项 | R2 调度/中断问题 | 越界 → bind-tune 出 plan;中断落业务核 → config-audit 出亲和命令 |
| `wait_pct ≥ 5%` 且为最大项 | R2b 等待型瓶颈 | 按唤醒源映射(见下表) |
| 打扰/等待均 < 5%,残余 > 30% | R4 残余未收敛 | 标未收敛;第二期用 perf-collect 补效率维 |
| 打扰/等待均 < 5%,残余 ≤ 30% | 已收敛 | 输出结论 + 无动作或仅观察项 |
等待维动作映射以 `resources/action-templates.json` 的 `wait_actions` 为**唯一来源**——
代码只查表,调整文案只需改该文件,不在脚本或本文档重复维护。
| 唤醒源 | 动作类型 | 转出 |
| ---- | ---- | ---- |
| 网络 | IRQ_AFFINITY | config-audit(NIC 中断亲和) |
| IO 等待 | IRQ_AFFINITY | config-audit(存储中断亲和) |
| 锁/同步 | CODE_SUGGESTION + 绑核建议 | bind-tune(同核/同 node 归并) |
| 上游数据 | CODE_SUGGESTION(建议类) | Profiler / 通信域 |
| 定时器 | CODE_SUGGESTION | 复查 tickless / 定时器合并配置 |
| 长阻塞 | CODE_SUGGESTION(建议类) | 设备 / 通信域 / 应用阻塞点 |
唤醒源是**相关性推断**(依据 waker comm 命名约定),Finding 必须标 `inference` 置信度,
不得表述为因果结论。
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |