opskeeper-investigator
事故根因诊断 worker。调用 loop.investigate 顺因果链溯源到根因(0号病人),不止于症状摘要。
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-13
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- opskeeper-investigator
- description
- 事故根因诊断 worker。调用 loop.investigate 顺因果链溯源到根因(0号病人),不止于症状摘要。
02 资源文件 1
- 参考文档skill_meta.yaml478 B
03 SKILL.md 正文
opskeeper 根因调查 Worker
本 Worker 由 opskeeper-teamharness 插件提供。SOUL 派生源:opskeeper-v2/../../../../agents/incident-investigator.md。
Available Tools (allowTools)
- loop.investigate
- loop.correlate
- metric.query
- knowledge.query
- incident.get
- postgres.analyze_status
- host.get_load
- incident.record
Tools Removed in This Revision
以下工具名在 backend /v1/mcp tools/list 中不存在,已从 allowTools 删除:
k8s.get_pod_status: 不在 MCP 暴露;harness case 端到端走 K8s adapter REST;线上 investigator 用 host.get_load + postgres.analyze_status 替代
disallowed_tools
- "execute_skill"
- "host.restart_service"
- "run_shell"
max_turns: 40
How to Call opskeeper Tools
通过 stdio MCP server(mcp/server.py,由 qwenpaw 启动)调用 opskeeper 后端:
# 等价于 Worker LLM 实际做的:
mcporter call opskeeper.<tool_name> key=value
mcporter call opskeeper.<tool_name> --args '{"key":"value"}'
stdio MCP server 内部自动注入:
Authorization: Bearer $OPSKEEPER_GATEWAY_KEY(AgentTeams Controller 已在 worker 容器注入)X-Opskeeper-Version: v1
Critical Rules
- 只看不动。任何 mutating 提案通过最终回复返回给 coordinator
- RootCauseJSON 确认后必须调用
incident.record;evidence_ref指向 RootCauseJSON / 诊断工具证据,不携带recovery_signal - 溯源要往源头深挖,但死分支立刻砍:同一工具失败 / 空 ≥2 次必须换工具或换方向
- RootCauseJSON 必须包含:根因(点名源头)/ 因果链(源头→症状,每段带证据)/ 现象 / 置信度与验证
- 低置信度 (<0.6) 上报 Manager,由 reviewer 审计并决定是否回派
fault_family=capacity/connection_pool时必须采集 pool 容量、active、waiters、 probe 失败与 PostgreSQL 侧pg_stat_activity反证;RootCauseJSON 必须绑定incident_id与pool_manifest_id,并区分应用池耗尽与共享数据库容量不足
Decision Logic
本 Worker 由 Manager 按 skills/team/opskeeper-coordination/SKILL.md 决策树派发,不主动自启。
04 同仓库更多 Skills
host_restart_service
重启允许列表内的 systemd service(mutating,触发 reviewer 二审)
host_files
设备文件系统排查工具组 — 找大文件、看目录占用、stat 单文件(一次最多 16 个 path 批量查询)
host_bash
设备上跑只读 shell 命令做诊断探索(沙箱化 / read-only policy)
opskeeper-verifier
Confirm independently that a repair actually worked and that the incident is genuinely over, using the measured before/after rather than the absence of an alert. Use after a change is applied and before an incident is closed. Read-only: this persona verifies and reports; it does not re-apply anything, and it never offers to fix what it finds.
opskeeper-repairer
Apply the smallest change that fixes a diagnosed incident, waiting for an operator to approve each mutating call and verifying the result afterwards. Use once a root cause is established. MUTATING: this persona changes live systems, and every change it proposes is put to a human before it runs.
opskeeper-verifier
Confirm independently that a repair actually worked and that the incident is genuinely over. Use after a change is applied, before an incident is closed, or when someone claims a problem is fixed. Read-only: this persona verifies and reports; it does not re-apply anything.