corvix.config

YAML configuration for Corvix dashboards and polling.

Attributes

Classes

ContextPredicate

Predicate evaluated against enriched notification context.

MatchCriteria

Filter fields for rules and dashboards.

RuleAction

Action emitted when a rule matches.

Rule

Global or repository-scoped automation rule.

RuleSet

Collection of global and per-repository rules.

DashboardSpec

Dashboard configuration for sorting, grouping, and filtering.

ScoringConfig

Configurable scoring model for notifications.

PollingConfig

Polling behavior for ingestion.

GitHubConfig

GitHub API configuration.

GitHubAccountConfig

One GitHub account configuration for multi-account polling.

GitHubLatestCommentEnrichmentConfig

Config for enriching comment notifications with latest-comment metadata.

GitHubPRStateEnrichmentConfig

Config for enriching pull-request notifications with PR state.

EnrichmentConfig

Top-level enrichment configuration.

StateConfig

State/cache location for persisted notifications.

BrowserTabTargetConfig

Config for in-tab browser notification delivery.

WebPushTargetConfig

Config for background Web Push notification delivery (phase 2).

NotificationsDetectConfig

Controls which records qualify for notification events.

NotificationsConfig

Top-level notifications configuration.

AuthConfig

Authentication mode configuration.

DatabaseConfig

PostgreSQL connection configuration.

AppConfig

Top-level application config.

Functions

_ensure_map(→ dict[str, object])

_ensure_list(→ list[object])

_as_bool(→ bool)

_as_int(→ int)

_as_float(→ float)

_as_str(→ str)

_get_str(→ str)

_get_optional_str(→ str | None)

_get_bool(→ bool)

_get_optional_bool(→ bool | None)

_get_int(→ int)

_get_float(→ float)

_get_optional_float(→ float | None)

_to_str_list(→ list[str])

_parse_match(→ MatchCriteria)

_parse_context_predicates(→ list[ContextPredicate])

_parse_context_predicate(→ ContextPredicate)

_parse_rules(→ RuleSet)

_parse_rule(→ Rule)

_parse_dashboards(→ list[DashboardSpec])

_parse_dashboard_ignore_rules(→ list[MatchCriteria])

_parse_scoring(→ ScoringConfig)

_to_float_map(→ dict[str, float])

_parse_github(→ GitHubConfig)

_parse_polling(→ PollingConfig)

_parse_enrichment(→ EnrichmentConfig)

_parse_state(→ StateConfig)

_parse_auth(→ AuthConfig)

_parse_database(→ DatabaseConfig)

_parse_notifications(→ NotificationsConfig)

load_config(→ AppConfig)

Load and validate YAML config from disk.

write_default_config(→ None)

Write a starter configuration file.

Module Contents

corvix.config._POLLING_PER_PAGE_MIN = 1[source][source]
corvix.config._POLLING_PER_PAGE_MAX = 50[source][source]
corvix.config._CONTEXT_OPERATORS[source][source]
class corvix.config.ContextPredicate[source][source]

Predicate evaluated against enriched notification context.

path: str[source][source]
op: str[source][source]
value: object | None = None[source][source]
case_insensitive: bool = False[source][source]
class corvix.config.MatchCriteria[source][source]

Filter fields for rules and dashboards.

repository_in: list[str] = [][source][source]
repository_glob: list[str] = [][source][source]
reason_in: list[str] = [][source][source]
subject_type_in: list[str] = [][source][source]
title_contains_any: list[str] = [][source][source]
title_regex: str | None = None[source][source]
unread: bool | None = None[source][source]
min_score: float | None = None[source][source]
max_age_hours: float | None = None[source][source]
context: list[ContextPredicate] = [][source][source]
class corvix.config.RuleAction[source][source]

Action emitted when a rule matches.

action_type: str[source][source]
class corvix.config.Rule[source][source]

Global or repository-scoped automation rule.

name: str[source][source]
match: MatchCriteria[source][source]
actions: list[RuleAction] = [][source][source]
exclude_from_dashboards: bool = False[source][source]
class corvix.config.RuleSet[source][source]

Collection of global and per-repository rules.

global_rules: list[Rule] = [][source][source]
per_repository: dict[str, list[Rule]][source][source]
class corvix.config.DashboardSpec[source][source]

Dashboard configuration for sorting, grouping, and filtering.

name: str[source][source]
group_by: str = 'none'[source][source]
sort_by: str = 'score'[source][source]
descending: bool = True[source][source]
include_read: bool = False[source][source]
max_items: int = 100[source][source]
match: MatchCriteria[source][source]
ignore_rules: list[MatchCriteria] = [][source][source]
class corvix.config.ScoringConfig[source][source]

Configurable scoring model for notifications.

unread_bonus: float = 15.0[source][source]
age_decay_per_hour: float = 0.25[source][source]
reason_weights: dict[str, float][source][source]
repository_weights: dict[str, float][source][source]
subject_type_weights: dict[str, float][source][source]
title_keyword_weights: dict[str, float][source][source]
class corvix.config.PollingConfig[source][source]

Polling behavior for ingestion.

interval_seconds: int = 60[source][source]
per_page: int = 50[source][source]
max_pages: int = 5[source][source]
all: bool = False[source][source]
participating: bool = False[source][source]
class corvix.config.GitHubConfig[source][source]

GitHub API configuration.

accounts: list[GitHubAccountConfig] = [][source][source]
property token_env: str[source][source]

Backward-compatible shortcut to first account token env.

property api_base_url: str[source][source]

Backward-compatible shortcut to first account API base URL.

class corvix.config.GitHubAccountConfig[source][source]

One GitHub account configuration for multi-account polling.

id: str[source][source]
label: str[source][source]
token_env: str[source][source]
api_base_url: str = 'https://api.github.com'[source][source]
class corvix.config.GitHubLatestCommentEnrichmentConfig[source][source]

Config for enriching comment notifications with latest-comment metadata.

enabled: bool = False[source][source]
timeout_seconds: float = 10.0[source][source]
class corvix.config.GitHubPRStateEnrichmentConfig[source][source]

Config for enriching pull-request notifications with PR state.

enabled: bool = False[source][source]
timeout_seconds: float = 10.0[source][source]
class corvix.config.EnrichmentConfig[source][source]

Top-level enrichment configuration.

enabled: bool = False[source][source]
max_requests_per_cycle: int = 25[source][source]
github_latest_comment: GitHubLatestCommentEnrichmentConfig[source][source]
github_pr_state: GitHubPRStateEnrichmentConfig[source][source]
class corvix.config.StateConfig[source][source]

State/cache location for persisted notifications.

cache_file: pathlib.Path[source][source]
class corvix.config.BrowserTabTargetConfig[source][source]

Config for in-tab browser notification delivery.

enabled: bool = True[source][source]
max_per_cycle: int = 5[source][source]
cooldown_seconds: int = 10[source][source]
class corvix.config.WebPushTargetConfig[source][source]

Config for background Web Push notification delivery (phase 2).

enabled: bool = False[source][source]
vapid_public_key_env: str = 'CORVIX_VAPID_PUBLIC_KEY'[source][source]
vapid_private_key_env: str = 'CORVIX_VAPID_PRIVATE_KEY'[source][source]
subject: str = ''[source][source]
class corvix.config.NotificationsDetectConfig[source][source]

Controls which records qualify for notification events.

include_read: bool = False[source][source]
min_score: float = 0.0[source][source]
class corvix.config.NotificationsConfig[source][source]

Top-level notifications configuration.

enabled: bool = True[source][source]
detect: NotificationsDetectConfig[source][source]
browser_tab: BrowserTabTargetConfig[source][source]
web_push: WebPushTargetConfig[source][source]
class corvix.config.AuthConfig[source][source]

Authentication mode configuration.

mode: str = 'single_user'[source][source]
session_secret: str = ''[source][source]
class corvix.config.DatabaseConfig[source][source]

PostgreSQL connection configuration.

url_env: str = 'DATABASE_URL'[source][source]
class corvix.config.AppConfig[source][source]

Top-level application config.

github: GitHubConfig[source][source]
enrichment: EnrichmentConfig[source][source]
polling: PollingConfig[source][source]
state: StateConfig[source][source]
scoring: ScoringConfig[source][source]
rules: RuleSet[source][source]
dashboards: list[DashboardSpec] = [][source][source]
auth: AuthConfig[source][source]
database: DatabaseConfig[source][source]
notifications: NotificationsConfig[source][source]
resolve_cache_file() pathlib.Path[source][source]

Resolve the configured cache path.

corvix.config.DEFAULT_CONFIG = Multiline-String[source][source]
Show Value
"""github:
  accounts:
    - id: primary
      label: Primary
      token_env: GITHUB_TOKEN
      api_base_url: https://api.github.com

enrichment:
  enabled: false
  max_requests_per_cycle: 25
  github_latest_comment:
    enabled: false
    timeout_seconds: 10
  github_pr_state:
    enabled: false
    timeout_seconds: 10

polling:
  interval_seconds: 60
  per_page: 50
  max_pages: 5
  all: false
  participating: false

state:
  cache_file: ~/.cache/corvix/notifications.json

scoring:
  unread_bonus: 15
  age_decay_per_hour: 0.25
  reason_weights:
    mention: 50
    review_requested: 40
    assign: 30
    author: 10
  repository_weights:
    your-org/critical-repo: 25
  subject_type_weights:
    PullRequest: 10
  title_keyword_weights:
    security: 20
    urgent: 15

rules:
  global:
    - name: mute-bot-noise
      match:
        title_regex: ".*\[bot\].*"
      actions:
        - type: mark_read
      exclude_from_dashboards: true
  per_repository:
    your-org/infra:
      - name: mute-chore-prs
        match:
          title_contains_any: ["chore", "deps"]
        actions:
          - type: mark_read
        exclude_from_dashboards: true

dashboards:
  - name: overview
    group_by: reason
    sort_by: updated_at
    descending: true
    include_read: true
    max_items: 200
  - name: triage
    group_by: repository
    sort_by: score
    descending: true
    include_read: false
    max_items: 100
    match:
      reason_in: ["mention", "review_requested", "assign"]
    ignore_rules:
      - reason_in: ["comment"]
        context:
          - path: github.latest_comment.is_ci_only
            op: equals
            value: true
"""
corvix.config._ensure_map(value: object, section: str) dict[str, object][source][source]
corvix.config._ensure_list(value: object, section: str) list[object][source][source]
corvix.config._as_bool(value: object, field: str) bool[source][source]
corvix.config._as_int(value: object, field: str) int[source][source]
corvix.config._as_float(value: object, field: str) float[source][source]
corvix.config._as_str(value: object, field: str) str[source][source]
corvix.config._get_str(config: dict[str, object], key: str, default: str, field: str) str[source][source]
corvix.config._get_optional_str(config: dict[str, object], key: str, field: str) str | None[source][source]
corvix.config._get_bool(config: dict[str, object], key: str, default: bool, field: str) bool[source][source]
corvix.config._get_optional_bool(config: dict[str, object], key: str, field: str) bool | None[source][source]
corvix.config._get_int(config: dict[str, object], key: str, default: int, field: str) int[source][source]
corvix.config._get_float(config: dict[str, object], key: str, default: float, field: str) float[source][source]
corvix.config._get_optional_float(config: dict[str, object], key: str, field: str) float | None[source][source]
corvix.config._to_str_list(value: object) list[str][source][source]
corvix.config._parse_match(value: object, *, section: str = 'match') MatchCriteria[source][source]
corvix.config._parse_context_predicates(value: object, *, section: str = 'match.context') list[ContextPredicate][source][source]
corvix.config._parse_context_predicate(value: object, *, section: str = 'match.context[]') ContextPredicate[source][source]
corvix.config._parse_rules(value: object) RuleSet[source][source]
corvix.config._parse_rule(value: object) Rule[source][source]
corvix.config._parse_dashboards(value: object) list[DashboardSpec][source][source]
corvix.config._parse_dashboard_ignore_rules(value: object) list[MatchCriteria][source][source]
corvix.config._parse_scoring(value: object) ScoringConfig[source][source]
corvix.config._to_float_map(value: object, section: str) dict[str, float][source][source]
corvix.config._parse_github(value: object) GitHubConfig[source][source]
corvix.config._parse_polling(value: object) PollingConfig[source][source]
corvix.config._parse_enrichment(value: object) EnrichmentConfig[source][source]
corvix.config._parse_state(value: object) StateConfig[source][source]
corvix.config._parse_auth(value: object) AuthConfig[source][source]
corvix.config._parse_database(value: object) DatabaseConfig[source][source]
corvix.config._parse_notifications(value: object) NotificationsConfig[source][source]
corvix.config.load_config(path: pathlib.Path) AppConfig[source][source]

Load and validate YAML config from disk.

corvix.config.write_default_config(path: pathlib.Path) None[source][source]

Write a starter configuration file.