Private
Public Access
reapply_rules_for_user_backlog narrowed its *backlog* to the triggering rule's feed/tag scope, but then loaded every enabled rule for the user and ran all of them against that backlog with no per-rule scope check — so re-applying one feed- or tag-scoped rule could also fire an unrelated rule scoped to a different feed/tag, if it happened to match. rule_in_scope() moves the feed/tag scope check into the engine itself (apply_filter_rules_for_feed already computed this per-subscription via query filters; it now just passes the tag ids and lets the engine decide), so backlog re-apply and ingest-time dispatch can't drift into scoping rules differently again. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>