promptdojo_

Incident runbook from the repo — detect, decide rollback, write back — step 8 of 9

Write execute_runbook(signals, runbook) that returns a writeback record — the dict a junior would append to the repo. Fields:

  • id: signals["id"]
  • decision: "escalate" if signals.get("rollback_blocked"); "rollback" if the detect signal is >= rollback_if_at_least; otherwise "continue"
  • signal: the detect signal's value
  • actor: runbook["named_human"] on escalate, else "runbook"
  • artifact: runbook["writeback"]["path"]

Two incidents run. Expected output:

{'id': 'INC-041', 'decision': 'rollback', 'signal': 0.12, 'actor': 'runbook', 'artifact': 'incidents/log.jsonl'}
{'id': 'INC-043', 'decision': 'escalate', 'signal': 0.15, 'actor': 'release-owner', 'artifact': 'incidents/log.jsonl'}

full-screen editor opens — close anytime to keep reading.