← Lesson
Every Incident Ends in a Golden
Joeven
Run
Reset
Python loads on first run
def refund_without_hitl(trace): tools = [e["tool"] for e in trace if e.get("kind") == "tool"] flags = [e.get("name") for e in trace if e.get("kind") == "flag"] if "refund" in tools and "hitl_approved" not in flags: return {"ok": False, "why": "refund_without_hitl"} return {"ok": True} old = [ {"kind": "tool", "tool": "refund"}, {"kind": "final", "text": "sent"}, ] new = [ {"kind": "flag", "name": "hitl_approved"}, {"kind": "tool", "tool": "refund"}, {"kind": "final", "text": "sent"}, ] print("old sha would fail", refund_without_hitl(old)) print("new sha", refund_without_hitl(new)) print("game day: old fails, new passes")
Run to execute this in your browser. Nothing is sent to a server.