corvix.web.rule_snippets

Prefilled ignore-rule snippet generation for a notification.

Backs the GET /api/v1/notifications/{account_id}/{thread_id}/rule-snippets route: given a stored notification record, it renders ready-to-paste YAML snippets for dashboard-scoped ignores and global excludes, optionally including enrichment-context predicates.

Functions

_notification_rule_snippets_impl(...)

Compute and return the typed rule-snippets payload.

_find_record(→ corvix.domain.NotificationRecord | None)

_yaml_quoted(→ str)

_yaml_scalar(→ str)

_slug_token(→ str)

_rule_name_for_record(→ str)

_rule_match_lines(…)

_context_predicate_lines(→ list[str])

_anchored_title_regex(→ str)

_context_path_value(→ tuple[bool, object | None])

_dashboard_ignore_rule_snippet(→ str)

_global_exclude_rule_snippet(→ str)

Module Contents

corvix.web.rule_snippets._notification_rule_snippets_impl(account_id: str, thread_id: str, dashboard: str | None = None) corvix.web.schemas.RuleSnippetsResponse[source][source]

Compute and return the typed rule-snippets payload.

corvix.web.rule_snippets._find_record(*, records: list[corvix.domain.NotificationRecord], account_id: str, thread_id: str) corvix.domain.NotificationRecord | None[source][source]
corvix.web.rule_snippets._yaml_quoted(value: str) str[source][source]
corvix.web.rule_snippets._yaml_scalar(value: object) str[source][source]
corvix.web.rule_snippets._slug_token(value: str) str[source][source]
corvix.web.rule_snippets._rule_name_for_record(record: corvix.domain.NotificationRecord) str[source][source]
corvix.web.rule_snippets._rule_match_lines(*, record: corvix.domain.NotificationRecord, include_context: Literal[False]) list[str][source][source]
corvix.web.rule_snippets._rule_match_lines(*, record: corvix.domain.NotificationRecord, include_context: Literal[True]) list[str] | None
corvix.web.rule_snippets._context_predicate_lines(*, record: corvix.domain.NotificationRecord) list[str][source][source]
corvix.web.rule_snippets._anchored_title_regex(title: str) str[source][source]
corvix.web.rule_snippets._context_path_value(*, context: collections.abc.Mapping[str, object], path: str) tuple[bool, object | None][source][source]
corvix.web.rule_snippets._dashboard_ignore_rule_snippet(match_lines: list[str]) str[source][source]
corvix.web.rule_snippets._global_exclude_rule_snippet(*, record: corvix.domain.NotificationRecord, match_lines: list[str]) str[source][source]