corvix.pipeline.provider

Unified provider interfaces and shared context for the pipeline.

Classes

PipelineContext

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

FieldProvider

Provider that completes missing canonical fields on a Notification.

ContextProvider

Provider that attaches optional contextual data to a Notification.

Module Contents

class corvix.pipeline.provider.PipelineContext[source][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][source]

Fetch and cache a JSON payload; raises if the request budget is exhausted.

class corvix.pipeline.provider.FieldProvider[source][source]

Bases: Protocol

Provider that completes missing canonical fields on a Notification.

Field providers mutate the notification in-place by returning a (possibly replaced) Notification with missing required fields filled in (e.g. subject_url, web_url).

name: str[source][source]
hydrate(_notification: corvix.domain.Notification, _client: corvix.pipeline.base.JsonFetchClient, _ctx: PipelineContext, /) corvix.domain.Notification[source][source]

Return a notification with any missing required fields filled in.

class corvix.pipeline.provider.ContextProvider[source][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][source]
enrich(_notification: corvix.domain.Notification, _client: corvix.pipeline.base.JsonFetchClient, _ctx: PipelineContext, /) dict[str, object][source][source]

Return a mapping of context data to attach under this provider’s namespace.