Repository navigation
Conversation
…sing rules were not read A refused alert processing rule list fell back to an empty list, so every rule read as not suppressed and counted as reaching a person. A rule's suppressed and reaches_human, and the summary counts and verdicts built from them, are now null when the list was not read. A list that was read and is empty still gives 0 and false. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e list was not read processing_rules, in_scope_processing_rules and excluded_processing_rules still read 0 after a refused processing rule list. They are now null, and a list that was read and is empty still gives 0. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bruceweygandt
left a comment
There was a problem hiding this comment.
The main change is correct. After a refused processing rule list, the
suppression counts, the reaching-human counts, processing_rules and the two
scope counts are null. A list that was read and is empty still gives 0 and
false. The version, the CHANGELOG entry and the field text match the code. It
merges cleanly with main, and the tests pass. One gap remains.
1. fetchers/azure/_shared/alert_routing.py:227-228 and :238 (should fix)
Problem: A processing rule can add an action group to an alert rule. When the
processing rule list was not read, route() still decides routing from the
rule's own action groups only. A rule with no own action group, or with no
own deliverable one, gets routes_to_enabled_receiver: false and
routes_to_person: false. Line 238 then makes reaches_human false, not null,
because routes is False. I checked this: route(True, [], [scope], {}, None)
returns routes_to_enabled_receiver: false and reaches_human: false.
Why this is a problem: The record says "does not reach a person" when this is
not known. The CHANGELOG says each enabled rule's reaches_human is null in
this case; that is true only for rules with a deliverable own group. In the
summary, enabled_rules_without_action_groups (alert_rules/fetcher.py:170)
still counts the rule (1, not null), and the rule is in neither
enabled_rules_routing_to_enabled_receiver nor enabled_rules_routing_unknown.
The field text (fetcher.yaml:110) says this count includes groups "added by a
processing rule", which were not read.
Fix: In route(), when rules is None and the rule is enabled, change a
False from _tri to None for routes and to_person. A True can stay,
because a known own group already delivers. Then reaches_human becomes null
too. Also return None, not [], for processing_rule_matches and
suppressed_by_processing_rules. In summarize, add
enabled_rules_without_action_groups to SUPPRESSION_FIELDS, or count only
rules that have no own group and say so in the text. Add a test with a rule
that has no own action group. #368 has the same route() change, so make the
fix in both PRs.
# Conflicts: # CHANGELOG.md
… without its own group unknown With the processing rule list unread, an enabled rule with no deliverable own action group read false for routes_to_enabled_receiver, routes_to_person and reaches_human, and still counted in enabled_rules_without_action_groups. A False from the own groups is now null, a True stays, processing_rule_matches and suppressed_by_processing_rules are null, not [], and enabled_rules_without_action_groups is null. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes FDE-1210
Summary
azure_alert_rules0.4.0: a refused alert processing rule list gives null suppression fields instead of reading as an empty list. Before, the empty fallback made every rule readsuppressed: false, so every enabled rule counted as reaching a person. Now, when the list is not read, each enabled rule'ssuppressedandreaches_humanare null, andenabled_rules_suppressed,enabled_rules_possibly_suppressed,enabled_rules_reaching_human,enabled_rules_reaching_human_unknown,enabled_rules_not_reaching_human,reaching_human_percentage,all_enabled_rules_reach_human,suppressing_processing_rules_active,processing_rules,in_scope_processing_rulesandexcluded_processing_rulesare null. The run still exits 1 aspartial_failure. A list that was read and is empty still gives 0 and false.alert_routing.route()takesrules=Nonefor an unread list, the same change as in PR #368 forazure_activity_log_alerts. The plain-text field descriptions and the changelog are updated.Tests
tests/test_azure_alert_rules_null_counts.py(new): runsmain()with the processing rule list refused and asserts the per-rule fields and every summary field above are null while the rule counts still read; a read-and-empty list still gives false and true, and 0 for the processing rule counts; a read suppression rule still suppresses;route()withNoneis unknown for an enabled rule and not reaching anyone for a disabled one. With the fix reverted the file fails.Ran: the new file, the existing monitor and exclusion tests,
tests/test_contracts.pyand the text-format tests (1085 passed), plus the SDK-surface, reference and pattern tests (657 passed). No full suite (CI runs it).Validator impact
No validator on
main. Onadded-validators, four read changed fields. ECMAScript evaluation of each regex on evidence from a refused processing rule list (two rules, one availability and one WAF request count, both routed), before and after:azure_availability_alert_routedazure_rate_limit_alert_routedazure_availability_rate_limit_alerts_none_unrouted"suppressed": null)azure_alert_rules_reach_person_groups_deliverablepartial_failuretrue)On a run that read the list, all four give the same verdict before and after. The three that change were passing a refused run on
"suppressed": false, which was false evidence; now they fail it. None is edited here, so whether they go back for review is a separate decision. The shared Evidence Collection Succeeded validator already fails the refused run.Changed after review
route()in_shared/alert_routing.py: with the processing rule list unread, an enabled rule whose own action groups giveFalseforroutes_to_enabled_receiverorroutes_to_personnow gets null, since a processing rule may add a group. ATruestays.reaches_humanfollows, so the rule counts inenabled_rules_routing_unknown.processing_rule_matchesandsuppressed_by_processing_rulesare null, not[]. The file is byte-identical to the one in theazure_activity_log_alertsPR (Azure monitoring fetchers: an unread list gives null counts, not 0 or false #368).enabled_rules_without_action_groupsis added toSUPPRESSION_FIELDS: null when the processing rule list was not read. Its field text now says so instead of implying it knew about groups added by a processing rule. Field text forenabled_rules_routing_unknowncovers the unread-list case.route()unit tests and an end-to-end run with a rule that has no action group and a refused processing rule list; a read-empty list still gives false and counts the rule inenabled_rules_without_action_groups.🤖 Generated with Claude Code