auradefi 0.1.1
PyPI GitHub

ConnectionSyncReport

auradefi.embed.models · source

What one connection's slice of a sync() call did (SPEC §8).

pages_fetched is this connection's share of the one shared budget, partitioned into the two phases it was spent on: pages_fetched == live_pages + backfill_pages, always.

Raises auradefi.errors.ValidationError when any count (pages_fetched, live_pages, backfill_pages, transactions_ingested) is negative, when no_op is True and ANY of those four is non-zero, a no-op that fetched pages or ingested transactions is a lie, or when the two halves do not sum to pages_fetched.

failed defaults to False, so every row written before the field existed still means "this went fine". It is True when the connection's sync raised an auradefi.errors.AuradefiError that the tick contained (RELEASE_0.1.1 §5 #24), and it is MUTUALLY EXCLUSIVE with no_op: "nothing needed doing" and "I could not do it" are different answers, and a row claiming both raises ValidationError rather than being believed. A failed row still obeys every count invariant. Failure is not a licence to emit an incoherent partition.

Fields

connection_idstr
no_opbool
pages_fetchedint
live_pagesint
backfill_pagesint
transactions_ingestedint
live_cursorint
backfill_cursorint | None
backfill_completebool
failedbooldefault False

failure

failure(cls, connection_id: str, state: SyncState) -> ConnectionSyncReport

The row for a connection whose sync RAISED; pinned shape.

Every count is 0, work a tick could not observe is never claimed as done, while the cursors are ECHOED from state, the last thing the store persisted, so the row says WHERE the connection stands as well as that it is stuck. no_op is False, which the failed/no-op exclusion requires anyway: a caller must never read a contained failure as a quiet tick (RELEASE_0.1.1 §5 #24).

Parameters

connection_idrequired, str

none

staterequired, SyncState

none

__init__

__init__(self, connection_id: str, no_op: bool, pages_fetched: int, live_pages: int, backfill_pages: int, transactions_ingested: int, live_cursor: int, backfill_cursor: int | None, backfill_complete: bool, failed: bool = False) -> None

Parameters

connection_idrequired, str

none

no_oprequired, bool

none

pages_fetchedrequired, int

none

live_pagesrequired, int

none

backfill_pagesrequired, int

none

transactions_ingestedrequired, int

none

live_cursorrequired, int

none

backfill_cursorrequired, int | None

none

backfill_completerequired, bool

none

failedoptional, bool, default False

none