Skip to main content

Module selection

Module selection 

Source
Expand description

Resolve user-facing selectors to stable rule_id values.

One resolver serves rules export, delete, enable, and state commands. This keeps ambiguous-name and empty-match behavior consistent.

Identity is always rule_id. Names only find IDs.

Constants§

NAME_SEARCH_LIMIT
Same-named candidates to consider in one page. The cap prevents a pathological name lookup from becoming a corpus read.
UNREADABLE_RULE_ID
Displays an unreadable rule_id, such as a non-string value from the server.

Functions§

pick_by_name
Match names exactly. A prefix match could target the wrong rule.
pick_by_name_capped
Run pick_by_name on a candidate page with the server’s candidate total.
resolve
Resolve selectors and an optional tag to rule_id values. Returns None when neither is given and the caller should act on every rule.
to_rule_id
Resolve a rule_id or display name against the stack. Try rule_id first because it is unambiguous.