ops-health-core
Source: GitHub repo. Operational safety signals and kill-switch.
Data flow
Events -> OpsState -> update_kill_switch() -> KillSwitchSignal -> context
Health score
From: error rate, rate-limit frequency, reconnect frequency, latency percentiles. When RED: cooldown_until_ms, deny_actions=True, recommended_action=HOLD.
Components
Kill Switch: update_kill_switch(state, policy, now_ms). OpsState: timestamps, sliding windows. OpsPolicy: thresholds, cooldown.
Safety
Fail-closed on errors; deterministic; non-invasive (context only).
Import
from ops_health_core.kill_switch import update_kill_switch