fix(alerts): page every intermediate escalation level (audit_28 §5 medium)#102
Merged
Merged
Conversation
next_escalation_step returned the highest *due* step (due_steps[-1]). When two or more escalation levels became due between evaluation ticks (sparse polling, restart catch-up), the on-call recipients of the intervening levels were silently skipped — only the top level's webhook fired. Advance exactly one level per tick (the lowest due level above the current one, robust to unsorted escalation lists) so each tier is paged. Adds next_escalation_step regression tests (3-level all-due -> level 2 then 3, never jumping straight to 3; lowest-due-regardless-of-order). No public contract change; no-Docker verified (ruff/format/mypy clean, 75 alert/dispatcher unit tests pass). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
DORA Metrics
|
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.
Summary
Closes the one clean, real-impact correctness defect from
audit_28_06_26.md§5(medium): alert escalation silently skips intermediate levels.
next_escalation_stepreturned the highest due escalation step (due_steps[-1]).When two or more levels became due between evaluation ticks — sparse polling, or
catch-up after a restart — the on-call recipients of the intervening levels were
never paged; only the top level's webhook fired. For tiered escalation where each
level targets a different responder (on-call → lead → manager), the intermediate
responders were silently dropped.
Fix: advance exactly one level per evaluation tick — the lowest due level
above the current one (
min(due_steps, key=level), robust to an unsortedescalation list). Each tier is paged on successive ticks. No public contract
change.
Tests
next_escalation_stepregression tests: 3-level all-due alert advancesL1→L2→L3 across ticks (never jumps straight to L3 and skips L2); lowest-due
picked regardless of list order.
due_steps[-1]returns L3 (skip), new returns L2 (correct).
Verification (no-Docker)
Scope note: the audit's HIGH backlog (16 HIGH + M4) is already merged
(#96→#99). This is the first §5-medium item; the rest are deliberate
trade-offs, entangled with recently-merged work, Docker-gated, or latent with
no practical impact — left out intentionally.
🤖 Generated with Claude Code