cayu.storage.product_operations_sqlite
Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.
SQLiteProductOperationStore
Section titled “SQLiteProductOperationStore”from cayu.storage import SQLiteProductOperationStoreTenant/resource authority for a maintained product service on SQLite.
This store, not Cayu labels, metadata, or runtime identifiers, is the product authorization boundary. Product reads are tenant-qualified by public id; the private session-id lookup exists only for trusted continuation hooks.
Every mutation runs in one BEGIN IMMEDIATE transaction. Execution claims
use store-owned lease time, terminal updates are conditional on the current
claim, and a completed result requires the content-bound publication receipt
written before Cayu session completion. SQLite serializes writers on one
host; use PostgresProductOperationStore for service processes that
do not share one filesystem.
The table joins Cayu’s shared schema revision history. schema_mode
follows the other SQLite stores: CREATE initializes an empty database and
otherwise validates; an existing older database requires
cayu storage migrate. clock replaces the lease clock for tests.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
category |
ServiceIdentityStoreKind |
ServiceIdentityStoreKind.DURABLE |
init (method)
Section titled “init (method)”SQLiteProductOperationStore.__init__(path: str | Path, *, schema_mode: schema.SchemaMode=schema.SchemaMode.CREATE, clock: Callable[[], datetime] | None=None) -> Noneclose (method)
Section titled “close (method)”async SQLiteProductOperationStore.close() -> Nonereserve (method)
Section titled “reserve (method)”async SQLiteProductOperationStore.reserve(*, tenant_id: str, subject_id: str, idempotency_key: str, request_fingerprint: str, public_id: str, work_id: str, session_id: str, task_id: str, request_text: str) -> ProductOperationReservationfind (method)
Section titled “find (method)”async SQLiteProductOperationStore.find(*, tenant_id: str, public_id: str) -> ProductOperation | Nonefind_by_session_id (method)
Section titled “find_by_session_id (method)”async SQLiteProductOperationStore.find_by_session_id(*, session_id: str) -> ProductOperation | Noneclaim_execution (method)
Section titled “claim_execution (method)”async SQLiteProductOperationStore.claim_execution(*, work_id: str, claim_id: str, lease_seconds: int) -> ProductOperationExecutionClaim | Noneheartbeat_execution (method)
Section titled “heartbeat_execution (method)”async SQLiteProductOperationStore.heartbeat_execution(*, work_id: str, claim_id: str, lease_seconds: int) -> boolrelease_execution (method)
Section titled “release_execution (method)”async SQLiteProductOperationStore.release_execution(*, work_id: str, claim_id: str) -> boolrecord_result_receipt (method)
Section titled “record_result_receipt (method)”async SQLiteProductOperationStore.record_result_receipt(*, work_id: str, claim_id: str, receipt: ProductResultReceipt) -> ProductResultReceiptrecord_recovery_status (method)
Section titled “record_recovery_status (method)”async SQLiteProductOperationStore.record_recovery_status(*, work_id: str, claim_id: str, recovery_status: ProductRecoveryStatus) -> ProductOperationfinish (method)
Section titled “finish (method)”async SQLiteProductOperationStore.finish(*, work_id: str, claim_id: str, status: Literal['completed', 'failed'], result: str | None) -> ProductOperation