corvix.enrichment¶
Notification enrichment package.
Submodules¶
Classes¶
Per-cycle request budget and URL cache shared across all pipeline providers. |
|
Provider that attaches optional contextual data to a |
|
Client capability required by data-enrichment pipelines. |
|
Runs configured enrichment providers over notifications. |
|
Result of enriching one poll cycle. |
|
Enriches comment notifications with the latest comment metadata. |
|
Enriches pull-request notifications with state metadata. |
Package Contents¶
- class corvix.enrichment.EnrichmentContext[source]¶
Bases:
corvix.pipeline.base.RequestContextPer-cycle request budget and URL cache shared across all pipeline providers.
A single
PipelineContextis created perPipelineEngine.run()call and passed to every provider, so that URL responses cached by a field-completion provider are visible to subsequent context providers in the same cycle.- get_json(client: corvix.pipeline.base.JsonFetchClient, url: str, timeout_seconds: float) corvix.types.JsonValue[source]¶
Fetch and cache a JSON payload; raises if the request budget is exhausted.
- class corvix.enrichment.EnrichmentProvider[source]¶
Bases:
ProtocolProvider that attaches optional contextual data to a
Notification.Context providers return a mapping that is merged under the provider’s
namenamespace incontext.- enrich(_notification: corvix.domain.Notification, _client: corvix.pipeline.base.JsonFetchClient, _ctx: PipelineContext, /) dict[str, object][source]¶
Return a mapping of context data to attach under this provider’s namespace.
- class corvix.enrichment.JsonFetchClient[source][source]¶
Bases:
ProtocolClient capability required by data-enrichment pipelines.
- api_base_url: str[source]¶
Trusted base URL of the upstream API (e.g.
https://api.github.com).Providers use this to construct upstream API URLs from trusted config rather than from data received in API responses, which prevents SSRF taint flows.
- 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.
Deprecated since version Prefer:
corvix.pipeline.engine.PipelineEnginedirectly. This class is a thin wrapper maintained for backward compatibility.- providers: list[corvix.enrichment.base.EnrichmentProvider][source]¶
- run(notifications: list[corvix.domain.Notification], client: corvix.pipeline.base.JsonFetchClient, clients_by_account: dict[str, corvix.pipeline.base.JsonFetchClient] | None = None) EnrichmentRunResult[source][source]¶
Run enabled providers for all notifications in one cycle.
- class corvix.enrichment.GitHubLatestCommentProvider[source][source]¶
Enriches comment notifications with the latest comment metadata.
- 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.
- 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.