Skip to main content

Module idempotency

Module idempotency 

Source
Expand description

Exactly-once / idempotent delivery primitives.

The pipeline issues a monotonic commit token for every page that carries a bookmark. The token is persisted in the StateStore value next to the bookmark and committed inside the sink’s own transaction, so a crash between “sink durably wrote” and “state persisted” is resolved on resume by skipping pages the sink already committed. See docs/superpowers/specs/2026-06-09-exactly-once-delivery-design.md.

Structs§

GuaranteeInputs
Inputs to derive_delivery_guarantee — the facts about a concrete source × sink × config combination the derivation keys off.

Enums§

DeliveryGuarantee
The end-to-end guarantee a pipeline provides for a given source × sink × config combination.
DeliveryMode
Delivery guarantee for a pipeline run.
EffectivelyOnceMechanism
The mechanism through which a pipeline achieves effectively-once delivery.
ReplayGuarantee
How faithfully a Source replays its record stream when resumed from a bookmark.
SinkGuarantee
The strongest delivery guarantee a Sink can uphold.

Constants§

COMMIT_TOKEN_SCOPE_COL
Watermark column holding the pipeline state-key ({name}::{row_id}).
COMMIT_TOKEN_TABLE
Canonical watermark table the SQL sinks UPSERT the commit token into.
COMMIT_TOKEN_TOKEN_COL
Watermark column holding the latest committed token.
ICEBERG_SCOPE_PROP
Iceberg snapshot summary property names.
ICEBERG_TOKEN_PROP

Functions§

derive_delivery_guarantee
Derive the end-to-end DeliveryGuarantee a pipeline actually provides.
format_token
Render a page sequence as a fixed-width, lexicographically-ordered token.
format_token_with_bookmark
Render a commit token that carries the page’s resume bookmark alongside the sequence: "{seq:020}#{bookmark-json}".
parse_token
Parse the numeric sequence from a token produced by format_token or format_token_with_bookmark. Returns None on garbage.
parse_token_parts
Parse a stored commit token into (seq, embedded_bookmark).
unwrap_state
Unwrap a stored state value into (bookmark, seq).
wrap_state
Wrap a bookmark + sequence into the exactly-once state value.