corvix.config.app

AppConfig root model, auxiliary config classes, and load_config/write_default_config.

Attributes

Classes

PollingConfig

Polling behavior for ingestion.

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.

DatabaseConfig

PostgreSQL connection configuration.

AppConfig

Top-level application config.

Functions

_parse_polling(→ PollingConfig)

_parse_enrichment(→ EnrichmentConfig)

_parse_state(→ StateConfig)

_parse_database(→ DatabaseConfig)

load_config(→ AppConfig)

Load and validate YAML config from disk.

write_default_config(→ None)

Write a starter configuration file.

Module Contents

corvix.config.app._POLLING_PER_PAGE_MIN = 1[source][source]
corvix.config.app._POLLING_PER_PAGE_MAX = 50[source][source]
class corvix.config.app.PollingConfig[source][source]

Polling behavior for ingestion.

interval_seconds: int = 60[source][source]
request_timeout_seconds: float = 30.0[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.app.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.app.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.app.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.app.StateConfig[source][source]

State/cache location for persisted notifications.

cache_file: pathlib.Path[source][source]
class corvix.config.app.DatabaseConfig[source][source]

PostgreSQL connection configuration.

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

Top-level application config.

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

Resolve the configured cache path.

corvix.config.app.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

# Optional enrichment providers that add context used by rules/dashboards.
enrichment:
  # Master switch for all enrichment providers.
  enabled: false
  # Global request budget shared by providers each poll cycle.
  max_requests_per_cycle: 25
  # Adds github.latest_comment.* context for comment-based filtering.
  github_latest_comment:
    # Enable latest-comment metadata lookups.
    enabled: false
    # HTTP timeout per request made by this provider.
    timeout_seconds: 10
  # Adds github.pr_state.* context for PR-state/author filtering.
  github_pr_state:
    # Enable pull-request state metadata lookups.
    enabled: false
    # HTTP timeout per request made by this provider.
    timeout_seconds: 10

# Polling behavior for fetching notifications from GitHub.
polling:
  # Watch-loop delay between poll cycles, in seconds.
  interval_seconds: 60
  # HTTP timeout per GitHub API request, in seconds.
  request_timeout_seconds: 30
  # GitHub page size per request (valid range: 1-50).
  per_page: 50
  # Maximum pages to fetch per cycle to cap API usage.
  max_pages: 5
  # Include notifications from repositories you are not participating in.
  all: false
  # Restrict results to threads you participate in when true.
  participating: false

# Legacy JSON cache path. Notifications are now stored in PostgreSQL (required);
# this path is only read by the one-shot `corvix migrate-cache` upgrade command.
state:
  # Legacy JSON cache path, used solely by `corvix migrate-cache`.
  cache_file: ~/.cache/corvix/notifications.json

# Priority scoring model used when sort_by=score.
scoring:
  # Points added to unread notifications.
  unread_bonus: 15
  # Points subtracted per hour since last update.
  age_decay_per_hour: 0.25
  # Extra points by GitHub reason (mention/review_requested/etc).
  reason_weights:
    mention: 50
    review_requested: 40
    assign: 30
    author: 10
  # Per-repository score adjustments (repo full_name -> points).
  repository_weights:
    your-org/critical-repo: 25
  # Score adjustments by subject type (Issue, PullRequest, etc).
  subject_type_weights:
    PullRequest: 10
  # Case-insensitive keyword boosts when title contains the key.
  title_keyword_weights:
    security: 20
    urgent: 15

# Automation rules evaluated for each notification after scoring.
rules:
  # Rules applied to all repositories.
  global:
    # Rule name appears in matched_rules for traceability.
    - name: mute-bot-noise
      # Match criteria: all provided fields must match.
      match:
        # Regex against notification title.
        title_regex: ".*\[bot\].*"
      # Actions to execute when the rule matches.
      actions:
        # mark_read marks a thread as read (dry-run unless apply_actions=true).
        - type: mark_read
      # Hide matching records from dashboards while still processing them.
      exclude_from_dashboards: true
  # Repository-specific rules map: repo full_name -> list of rules.
  per_repository:
    your-org/infra:
      - name: mute-chore-prs
        match:
          # Match when title contains any listed keyword.
          title_contains_any: ["chore", "deps"]
        actions:
          - type: mark_read
        exclude_from_dashboards: true

# Event detection + delivery targets for user-facing notifications.
notifications:
  # Master switch for event detection and dispatch.
  enabled: true
  # Controls which records qualify as notification events.
  detect:
    # Include read records in event detection when true.
    include_read: false
    # Minimum score threshold required for event emission.
    min_score: 0
  # In-tab browser delivery target (shown while dashboard tab is open).
  browser_tab:
    # Enable browser-tab deliveries.
    enabled: true
    # Max events sent to this target per poll cycle.
    max_per_cycle: 5
    # Per-thread delivery cooldown in seconds to suppress repeats.
    cooldown_seconds: 10
  # Background Web Push delivery target.
  web_push:
    # Enable Web Push delivery.
    enabled: false
    # Env var name containing VAPID public key.
    vapid_public_key_env: CORVIX_VAPID_PUBLIC_KEY
    # Env var name containing VAPID private key.
    vapid_private_key_env: CORVIX_VAPID_PRIVATE_KEY
    # Web Push contact subject (recommended: mailto:<team@example.com>).
    subject: ""

# Dashboards rendered in UI; first entry is selected by default.
dashboards:
  # Unique dashboard name used in routes and selector.
  - name: overview
    # Grouping key: none | repository | reason | subject_type.
    group_by: reason
    # Sort key: score | updated_at | repository | reason | subject_type | title.
    sort_by: updated_at
    # Sort order for selected sort_by field.
    descending: true
    # Include read records when true.
    include_read: true
    # Maximum records shown (<=0 means no truncation).
    max_items: 200
  - name: triage
    # Grouping key: none | repository | reason | subject_type.
    group_by: repository
    # Sort key: score | updated_at | repository | reason | subject_type | title.
    sort_by: score
    # Sort order for selected sort_by field.
    descending: true
    # Include read records when true.
    include_read: false
    # Maximum records shown (<=0 means no truncation).
    max_items: 100
    # Additional include filter (same schema as rule match).
    match:
      reason_in: ["mention", "review_requested", "assign"]
    # Exclusion filters applied after match/include checks.
    ignore_rules:
      - reason_in: ["comment"]
        context:
          # Dot path into enrichment context payload.
          - path: github.latest_comment.is_ci_only
            # Predicate operator: equals | not_equals | contains | regex | in | exists.
            op: equals
            # Value compared by the operator.
            value: true

# Database settings (used by DB-backed storage/migrations/commands).
database:
  # Env var holding SQLAlchemy database URL (also supports <VAR>_FILE).
  url_env: DATABASE_URL
"""
corvix.config.app._parse_polling(value: object) PollingConfig[source][source]
corvix.config.app._parse_enrichment(value: object) EnrichmentConfig[source][source]
corvix.config.app._parse_state(value: object) StateConfig[source][source]
corvix.config.app._parse_database(value: object) DatabaseConfig[source][source]
corvix.config.app.load_config(path: pathlib.Path) AppConfig[source][source]

Load and validate YAML config from disk.

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

Write a starter configuration file.