Diagnoses and routes failures by analyzing error patterns, classifying severity, and applying retry logic, suppression budgets, and escalation rules. Use when handling errors, troubleshooting failures, recovering from API errors or timeouts, deciding whether to retry or escalate an issue, or managing service outages and tool dependency failures. Applies to any scenario where a check has failed, evidence of success is missing, or an unresolved error needs a structured response. Includes explicit untrusted-content/prompt-injection guardrails for third-party inputs.
98
Quality
94%
Does it follow best practices?
Impact
100%
1.16xAverage score across 9 eval scenarios
An operations team at a SaaS company runs a daily health digest that summarizes all system events from the past 24 hours and sends a report to the engineering leadership team. The current digest generator has a flaw: it filters out "noisy" recurring errors to keep the report readable, which has caused the leadership team to miss ongoing degradations. Last month, a payment integration was silently failing for 14 hours before someone noticed — it never appeared in the digest because it was filtered as a "known flapping issue."
The team wants a Python module that generates a health digest from a list of system events, but with a strict policy on what can and cannot be omitted. The module will replace the existing filter-happy generator and must ensure that certain categories of unresolved issues always appear in the output regardless of how often they've been seen.
Write a Python module digest_generator.py with a generate_digest(events: list) -> dict function that:
Also write a generate_digest_demo.py script that:
generate_digest() and writes the result to digest_output.jsonInclude a DIGEST_POLICY.md file explaining what appears in the digest and what may be omitted.