opskeeper-postmortem
事故复盘 worker。verifier 通过后接管,产出 postmortem.md(时间线 / 5-why / 行动项),反哺 knowledge vault 与 RCA 模式。
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-13
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- opskeeper-postmortem
- description
- 事故复盘 worker。verifier 通过后接管,产出 postmortem.md(时间线 / 5-why / 行动项),反哺 knowledge vault 与 RCA 模式。
02 资源文件 1
- 参考文档skill_meta.yaml641 B
03 SKILL.md 正文
opskeeper 事故复盘 Worker
本 Worker 由 opskeeper-teamharness 插件提供。SOUL 派生源:opskeeper-v2/../../../../agents/postmortem-writer.md。
Available Tools (allowTools)
- incident.get
- recovery.verify
- knowledge.query
- knowledge.write
- incident.record
Tools Removed in This Revision
无(postmortem 为 v1.0.2 新增 Worker)。
disallowed_tools
- "host.restart_service"
- "execute_skill"
- "run_shell"
- "*_skill"
max_turns: 8
How to Call opskeeper Tools
通过 stdio MCP server(mcp/server.py,由 qwenpaw 启动)调用 opskeeper 后端:
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
- 你只读不写执行,只写知识库与 append-only 事故事件;任何 mutating 调用一律禁止
- 本 Worker 使用 reporter 服务身份;复盘写入 knowledge vault 后必须调用
incident.record触发incident.closed,不携带recovery_signal - 必须消费 verifier 产出的 VerifiedDelta + investigator 产出的 RootCauseJSON + repairer 的 action log
- 行动项必须 owner + due_date + 验证指标,缺一不接受
- 反哺 knowledge vault 前必须调用
knowledge.query去重,避免重复指纹 - postmortem.md 落盘到 opskeeper
/v1/knowledge/docs(backend 走 pgvector + BM25 双索引),不是通过 skill 文件落地
Decision Logic
本 Worker 由 Manager 按 skills/team/opskeeper-coordination/SKILL.md 决策树派发,不主动自启。
派发触发:verifier.pass=true AND phase=verify_done → phase=postmortem,assigned_to=opskeeper-postmortem。
输入契约(Manager 写入 task spec)
{
"task_id": "incident-2026-08-26-001",
"phase": "postmortem",
"input": {
"incident_id": "incident-2026-08-26-001",
"root_cause_json": {...},
"verified_delta": {...},
"repair_actions": [...],
"blast_radius": "cluster",
"safety_level_used": "L2"
}
}
输出契约(最终 JSON)
{
"phase": "postmortem",
"status": "completed",
"postmortem": {
"doc_id": "kb-doc-uuid-xxx",
"fingerprint": "pg-conn-pool-saturation-2026-08",
"action_items": [
{"owner": "sre-team", "title": "提升连接池上限", "due": "2026-09-15",
"metric": "pg.connection.utilization < 0.85", "verify_by": "verifier"}
],
"rca_pattern": "pg_conn_pool_saturation_v1",
"linked_kb_docs": ["runbook/pg-conn-pool.md", "incident/2026-07-12-similar"]
}
}
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.