corvix.enrichment

Notification enrichment package.

Submodules

Classes

EnrichmentContext

Per-cycle provider context with request budget and URL cache.

EnrichmentProvider

Protocol implemented by enrichment providers.

JsonFetchClient

Client capability required by enrichment providers.

EnrichmentEngine

Runs configured enrichment providers over notifications.

EnrichmentRunResult

Result of enriching one poll cycle.

GitHubLatestCommentProvider

Enriches comment notifications with the latest comment metadata.

GitHubPRStateProvider

Enriches pull-request notifications with state metadata.

Package Contents

class corvix.enrichment.EnrichmentContext[source][source]

Per-cycle provider context with request budget and URL cache.

max_requests_per_cycle: int[source]
url_cache: dict[str, corvix.types.JsonValue][source]
request_count: int = 0[source]
get_json(client: JsonFetchClient, url: str, timeout_seconds: float) corvix.types.JsonValue[source][source]

Fetch and cache a JSON payload for this cycle.

class corvix.enrichment.EnrichmentProvider[source][source]

Bases: Protocol

Protocol implemented by enrichment providers.

name: str[source]
enrich(notification: corvix.domain.Notification, client: JsonFetchClient, ctx: EnrichmentContext) dict[str, object][source][source]
class corvix.enrichment.JsonFetchClient[source][source]

Bases: Protocol

Client capability required by enrichment providers.

fetch_json_url(url: str, timeout_seconds: float = 30.0) corvix.types.JsonValue[source][source]

Fetch JSON from a fully-qualified API URL.

class corvix.enrichment.EnrichmentEngine[source][source]

Runs configured enrichment providers over notifications.

config: corvix.config.EnrichmentConfig[source]
providers: list[corvix.enrichment.base.EnrichmentProvider][source]
run(notifications: list[corvix.domain.Notification], client: corvix.enrichment.base.JsonFetchClient, clients_by_account: dict[str, corvix.enrichment.base.JsonFetchClient] | None = None) EnrichmentRunResult[source][source]

Run enabled providers for all notifications in one cycle.

class corvix.enrichment.EnrichmentRunResult[source][source]

Result of enriching one poll cycle.

contexts_by_notification_key: dict[str, dict[str, object]][source]
errors: list[str] = [][source]
property contexts_by_thread_id: dict[str, dict[str, object]][source]

Backward-compatible thread-keyed view of contexts.

class corvix.enrichment.GitHubLatestCommentProvider[source][source]

Enriches comment notifications with the latest comment metadata.

timeout_seconds: float = 10.0[source]
name: str = 'github.latest_comment'[source]
enrich(notification: corvix.domain.Notification, client: corvix.enrichment.base.JsonFetchClient, ctx: corvix.enrichment.base.EnrichmentContext) dict[str, object][source][source]

Return latest comment metadata under the provider namespace.

class corvix.enrichment.GitHubPRStateProvider[source][source]

Enriches pull-request notifications with state metadata.

timeout_seconds: float = 10.0[source]
name: str = 'github.pr_state'[source]
enrich(notification: corvix.domain.Notification, client: corvix.enrichment.base.JsonFetchClient, ctx: corvix.enrichment.base.EnrichmentContext) dict[str, object][source][source]

Return pull-request state metadata under the provider namespace.