Skip to content

cayu.snapshots.AgentSnapshotComponentProvider

Part of cayu.snapshots.base. Read the Python API overview and install the required extra.

from cayu.snapshots import AgentSnapshotComponentProvider

Application/component-owned capture and materialization adapter.

Bases: ABC.

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
kind AgentSnapshotComponentKind required
provider_id str required
async AgentSnapshotComponentProvider.capture(request: AgentSnapshotCaptureRequest, selector: AgentSnapshotComponentSelector) -> AgentSnapshotComponentCapture

Capture one exact, bounded logical component reference.

async AgentSnapshotComponentProvider.verify(snapshot: AgentSnapshot, component: AgentSnapshotComponentRef) -> bool

Return whether the exact component remains valid and authorized.

async AgentSnapshotComponentProvider.materialize(snapshot: AgentSnapshot, component: AgentSnapshotComponentRef, request: AgentSnapshotMaterializationRequest, operation: AgentSnapshotMaterializationOperation) -> AgentSnapshotMaterializedComponent

Materialize the exact, durably announced operation once.

The provider must bind all effects to operation.operation_id in its own durable authority so concurrent or recovered calls cannot create a second logical materialization.

recover_materialization_operation (method)

Section titled “recover_materialization_operation (method)”
async AgentSnapshotComponentProvider.recover_materialization_operation(snapshot: AgentSnapshot, component: AgentSnapshotComponentRef, request: AgentSnapshotMaterializationRequest, operation: AgentSnapshotMaterializationOperation) -> AgentSnapshotMaterializedComponent

Safely finish or recover one outcome-unknown announced operation.

Implementations must use operation.operation_id as durable idempotency authority. They must fail closed when they cannot prove whether an earlier invocation took effect; the coordinator never calls materialize again for an operation already recorded as active.

async AgentSnapshotComponentProvider.recover(snapshot: AgentSnapshot, component: AgentSnapshotComponentRef, materialized: AgentSnapshotMaterializedComponent, materialization: AgentSnapshotMaterialization) -> AgentSnapshotMaterializedComponent

Recover an existing materialization without repeating candidate effects.

Release source · Runtime guarantees · Capability guides