ebb450be92
Singleton notification_policy table, NOTIFY_MIN_SEVERITY/CHANNELS env, central dispatch gate, Settings policy UI, migration 007. Co-authored-by: Cursor <cursoragent@cursor.com>
12 lines
340 B
Python
12 lines
340 B
Python
"""Severity ordering for notification policy gates."""
|
|
|
|
SEVERITY_ORDER = {"info": 10, "warning": 20, "high": 30, "critical": 40}
|
|
|
|
|
|
def severity_value(value: str) -> int:
|
|
return SEVERITY_ORDER.get(value, 0)
|
|
|
|
|
|
def severity_meets_minimum(severity: str, minimum: str) -> bool:
|
|
return severity_value(severity) >= severity_value(minimum)
|