corvix.enrichment.base

Provider interfaces and shared context for enrichment.

These names are preserved for backward compatibility; the canonical definitions live in corvix.pipeline.provider.

Classes

JsonFetchClient

Client capability required by data-enrichment pipelines.

EnrichmentProvider

Provider that attaches optional contextual data to a Notification.

EnrichmentContext

Per-cycle request budget and URL cache shared across all pipeline providers.

Module Contents

class corvix.enrichment.base.JsonFetchClient[source][source]

Bases: Protocol

Client 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.base.EnrichmentProvider[source]

Bases: Protocol

Provider that attaches optional contextual data to a Notification.

Context providers return a mapping that is merged under the provider’s name namespace in context.

name: str[source]
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.base.EnrichmentContext[source]

Bases: corvix.pipeline.base.RequestContext

Per-cycle request budget and URL cache shared across all pipeline providers.

A single PipelineContext is created per PipelineEngine.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.