← Lesson
Incident Playbooks
Joeven
Run
Reset
Python loads on first run
inc = { "id": "inc-42", "symptom": "refund storm", "flags": {"tools.refund": True, "queue.paused": False}, "ledger": [{"job": "job_9", "cents": 400}, {"job": "job_10", "cents": 400}], } def contain(inc): inc["flags"]["tools.refund"] = False inc["flags"]["queue.paused"] = True return inc["flags"] def blast_radius(ledger, cents_threshold=100): return [r for r in ledger if r["cents"] >= cents_threshold] def postmortem_test_would_fail(trace_tools): return "refund" in trace_tools and "hitl_approved" not in trace_tools print("contain", contain(inc)) print("radius", blast_radius(inc["ledger"])) print("new golden needed?", postmortem_test_would_fail(["refund", "finish"])) print("playbook: contain, trace, rollback, write a golden")
Run to execute this in your browser. Nothing is sent to a server.