feat(escalation): auto-remediation action steps (webhook runbooks) - #40
Merged
Conversation
An escalation step can now carry an `action_command`, turning it into an auto-remediation action: when it fires it POSTs a structured remediation intent (the command + problem context, `event: "remediation"`) to its webhook channel for an external runbook to act on. The server never executes commands itself. - EscalationStep.action_command (nullable); EscalationAlertEvent carries it and its payload switches to a remediation shape with the command. - Remediation steps must target a WEBHOOK channel β validated on create (REST + web, 422) and defensively skipped at fire time (logged) if mis-targeted. The once-only step mechanism still applies. - Web form gains an optional per-step "action command" field; the policy list marks remediation steps. Tests: remediation event + payload, non-webhook skip at fire time (step still advances), and the API rejection. Full suite 208 passed; ruff + mypy(strict) green; reversible migration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Phase 4 β auto-remediation as an escalation action (on top of the escalation engine).
Changes
EscalationStep.action_command(nullable): a step with a command becomes anauto-remediation action β on fire it POSTs
event: "remediation"(command +problem context) to its webhook channel for an external runbook. The server
never runs commands itself.
fire time if mis-targeted (logged); the once-only step mechanism still applies.
remediation steps (β).
Tests
Remediation event + payload, non-webhook skip at fire time (step still advances), API
rejection. Full suite 208 passed; ruff + mypy(strict) green; reversible migration.