cayu.storage.tasks_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.
SQLiteTaskStore
Section titled “SQLiteTaskStore”from cayu.storage import SQLiteTaskStoreSQLite-backed task store for durable local work items.
Decorators: @model_store_surface('tasks').
Bases: TaskStore.
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 |
|---|---|---|
service_durability |
RuntimeStoreDurability |
RuntimeStoreDurability.UNVERIFIED |
list_task_group_reconciliation_candidates (method)
Section titled “list_task_group_reconciliation_candidates (method)”async SQLiteTaskStore.list_task_group_reconciliation_candidates(*, after_group_id: str | None=None, limit: int=100) -> list[str]reconcile_task_group (method)
Section titled “reconcile_task_group (method)”async SQLiteTaskStore.reconcile_task_group(group_id: str) -> TaskGroupSnapshotresolve_task_group_quiescence (method)
Section titled “resolve_task_group_quiescence (method)”async SQLiteTaskStore.resolve_task_group_quiescence(request: TaskGroupQuiescenceResolution) -> TaskGroupSnapshotcreate_task_group (method)
Section titled “create_task_group (method)”async SQLiteTaskStore.create_task_group(request: TaskGroupCreate) -> TaskGroupCreationReceiptload_task_group (method)
Section titled “load_task_group (method)”async SQLiteTaskStore.load_task_group(group_id: str) -> TaskGroupSnapshot | Nonelist_task_group_events (method)
Section titled “list_task_group_events (method)”async SQLiteTaskStore.list_task_group_events(group_id: str, *, after_sequence: int=0, limit: int=100) -> list[TaskGroupEvent]create_task_graph (method)
Section titled “create_task_graph (method)”async SQLiteTaskStore.create_task_graph(request: TaskGraphCreate) -> TaskGraphCreationReceiptload_task_graph (method)
Section titled “load_task_graph (method)”async SQLiteTaskStore.load_task_graph(graph_id: str) -> TaskGraphSnapshot | Nonelist_task_graph_events (method)
Section titled “list_task_graph_events (method)”async SQLiteTaskStore.list_task_graph_events(graph_id: str, *, after_sequence: int=0, limit: int=100) -> list[TaskGraphEvent]publish_work_contract (method)
Section titled “publish_work_contract (method)”async SQLiteTaskStore.publish_work_contract(contract: WorkContract) -> WorkContractload_work_contract (method)
Section titled “load_work_contract (method)”async SQLiteTaskStore.load_work_contract(reference: WorkContractRef) -> WorkContract | Noneload_active_work_contract_task_for_session (method)
Section titled “load_active_work_contract_task_for_session (method)”async SQLiteTaskStore.load_active_work_contract_task_for_session(session_id: str) -> Task | Noneadmit_ordinary_session_execution (method)
Section titled “admit_ordinary_session_execution (method)”async SQLiteTaskStore.admit_ordinary_session_execution(session_id: str) -> Nonehold_claimed_work_contract_task (method)
Section titled “hold_claimed_work_contract_task (method)”async SQLiteTaskStore.hold_claimed_work_contract_task(task_id: str, *, worker_id: str, lease_expires_at: datetime | None=None, contract: WorkContractRef) -> Taskbegin_work_attempt (method)
Section titled “begin_work_attempt (method)”async SQLiteTaskStore.begin_work_attempt(request: WorkAttemptCreate) -> WorkAttemptenter_work_attempt_execution (method)
Section titled “enter_work_attempt_execution (method)”async SQLiteTaskStore.enter_work_attempt_execution(request: WorkAttemptExecutionEntryRequest) -> WorkAttemptExecutionEntryResulthold_work_attempt_preparation (method)
Section titled “hold_work_attempt_preparation (method)”async SQLiteTaskStore.hold_work_attempt_preparation(request: WorkAttemptPreparationHold) -> WorkAttemptPreparationHoldReceiptrecord_work_attempt_execution_stop (method)
Section titled “record_work_attempt_execution_stop (method)”async SQLiteTaskStore.record_work_attempt_execution_stop(request: WorkAttemptExecutionStopRequest) -> WorkAttemptAdmissionload_work_attempt_preparation_hold_receipt (method)
Section titled “load_work_attempt_preparation_hold_receipt (method)”async SQLiteTaskStore.load_work_attempt_preparation_hold_receipt(hold_id: str) -> WorkAttemptPreparationHoldReceipt | Noneprepare_work_attempt_admission (method)
Section titled “prepare_work_attempt_admission (method)”async SQLiteTaskStore.prepare_work_attempt_admission(request: WorkAttemptAdmissionPrepare) -> WorkAttemptAdmissionactivate_work_attempt_admission (method)
Section titled “activate_work_attempt_admission (method)”async SQLiteTaskStore.activate_work_attempt_admission(request: WorkAttemptAdmissionActivate) -> WorkAttemptAdmissionload_work_attempt_admission (method)
Section titled “load_work_attempt_admission (method)”async SQLiteTaskStore.load_work_attempt_admission(admission_id: str) -> WorkAttemptAdmission | Noneload_work_attempt_execution_claim (method)
Section titled “load_work_attempt_execution_claim (method)”async SQLiteTaskStore.load_work_attempt_execution_claim(claim_id: str) -> WorkAttemptExecutionClaim | Noneload_latest_work_attempt_admission (method)
Section titled “load_latest_work_attempt_admission (method)”async SQLiteTaskStore.load_latest_work_attempt_admission(task_id: str) -> WorkAttemptAdmission | Nonesettle_work_attempt_lifecycle (method)
Section titled “settle_work_attempt_lifecycle (method)”async SQLiteTaskStore.settle_work_attempt_lifecycle(request: WorkAttemptLifecycleSettlement) -> WorkAttemptLifecycleReceiptlist_unsettled_work_attempt_admissions (method)
Section titled “list_unsettled_work_attempt_admissions (method)”async SQLiteTaskStore.list_unsettled_work_attempt_admissions(*, task_filter: TaskAggregateFilter | None=None, limit: int=100, after: str | None=None) -> list[WorkAttemptAdmission]load_work_attempt_lifecycle_receipt (method)
Section titled “load_work_attempt_lifecycle_receipt (method)”async SQLiteTaskStore.load_work_attempt_lifecycle_receipt(admission_id: str) -> WorkAttemptLifecycleReceipt | Noneprepare_local_execution_attempt (method)
Section titled “prepare_local_execution_attempt (method)”async SQLiteTaskStore.prepare_local_execution_attempt(authority: LocalExecutionAttemptAuthority) -> LocalExecutionAttemptRecordstart_local_execution_attempt (method)
Section titled “start_local_execution_attempt (method)”async SQLiteTaskStore.start_local_execution_attempt(start: LocalExecutionAttemptStart) -> LocalExecutionAttemptRecordsettle_local_execution_attempt (method)
Section titled “settle_local_execution_attempt (method)”async SQLiteTaskStore.settle_local_execution_attempt(settlement: LocalExecutionAttemptSettlement) -> LocalExecutionAttemptRecordload_local_execution_attempt (method)
Section titled “load_local_execution_attempt (method)”async SQLiteTaskStore.load_local_execution_attempt(attempt_id: str) -> LocalExecutionAttemptRecord | Nonelist_unsettled_local_execution_attempts (method)
Section titled “list_unsettled_local_execution_attempts (method)”async SQLiteTaskStore.list_unsettled_local_execution_attempts(*, limit: int=100, after: LocalExecutionAttemptListCursor | None=None) -> tuple[LocalExecutionAttemptRecord, ...]claim_local_execution_attempt_recovery (method)
Section titled “claim_local_execution_attempt_recovery (method)”async SQLiteTaskStore.claim_local_execution_attempt_recovery(claim: LocalExecutionAttemptRecoveryClaim) -> LocalExecutionAttemptRecordrenew_work_attempt_execution_claim (method)
Section titled “renew_work_attempt_execution_claim (method)”async SQLiteTaskStore.renew_work_attempt_execution_claim(request: WorkAttemptExecutionClaimRequest) -> WorkAttemptAdmissionclaim_work_attempt_recovery (method)
Section titled “claim_work_attempt_recovery (method)”async SQLiteTaskStore.claim_work_attempt_recovery(request: WorkAttemptExecutionClaimRequest) -> WorkAttemptAdmissionactivate_work_attempt_recovery (method)
Section titled “activate_work_attempt_recovery (method)”async SQLiteTaskStore.activate_work_attempt_recovery(request: WorkAttemptRecoveryActivate) -> WorkAttemptAdmissionsubmit_admitted_completion_proposal (method)
Section titled “submit_admitted_completion_proposal (method)”async SQLiteTaskStore.submit_admitted_completion_proposal(request: AdmittedCompletionProposalRequest) -> CompletionProposalload_work_attempt (method)
Section titled “load_work_attempt (method)”async SQLiteTaskStore.load_work_attempt(attempt_id: str) -> WorkAttempt | Nonesubmit_completion_proposal (method)
Section titled “submit_completion_proposal (method)”async SQLiteTaskStore.submit_completion_proposal(request: CompletionProposalCreate) -> CompletionProposalload_completion_proposal (method)
Section titled “load_completion_proposal (method)”async SQLiteTaskStore.load_completion_proposal(proposal_id: str) -> CompletionProposal | Noneload_completion_proposal_for_attempt (method)
Section titled “load_completion_proposal_for_attempt (method)”async SQLiteTaskStore.load_completion_proposal_for_attempt(attempt_id: str) -> CompletionProposal | Noneprepare_completion_verifier_profile (method)
Section titled “prepare_completion_verifier_profile (method)”async SQLiteTaskStore.prepare_completion_verifier_profile(request: CompletionVerifierProfilePreparationRequest) -> CompletionVerifierProfileRecordload_completion_verifier_profile (method)
Section titled “load_completion_verifier_profile (method)”async SQLiteTaskStore.load_completion_verifier_profile(proposal_id: str) -> CompletionVerifierProfileRecord | Noneload_prior_completion_verifier_profile (method)
Section titled “load_prior_completion_verifier_profile (method)”async SQLiteTaskStore.load_prior_completion_verifier_profile(proposal_id: str) -> CompletionVerifierProfileRecord | Noneclaim_completion_verification (method)
Section titled “claim_completion_verification (method)”async SQLiteTaskStore.claim_completion_verification(request: CompletionVerificationClaimRequest) -> CompletionVerificationClaimload_completion_verification_claim (method)
Section titled “load_completion_verification_claim (method)”async SQLiteTaskStore.load_completion_verification_claim(proposal_id: str) -> CompletionVerificationClaim | Nonerenew_completion_verification_claim (method)
Section titled “renew_completion_verification_claim (method)”async SQLiteTaskStore.renew_completion_verification_claim(request: CompletionVerificationClaimRequest) -> CompletionVerificationClaimrecord_completion_decision (method)
Section titled “record_completion_decision (method)”async SQLiteTaskStore.record_completion_decision(request: CompletionDecisionCreate) -> CompletionDecisionload_completion_decision (method)
Section titled “load_completion_decision (method)”async SQLiteTaskStore.load_completion_decision(decision_id: str) -> CompletionDecision | Noneload_completion_decision_for_proposal (method)
Section titled “load_completion_decision_for_proposal (method)”async SQLiteTaskStore.load_completion_decision_for_proposal(proposal_id: str) -> CompletionDecision | Noneapply_completion_decision (method)
Section titled “apply_completion_decision (method)”async SQLiteTaskStore.apply_completion_decision(request: CompletionDecisionApplicationRequest) -> Taskload_completion_decision_application_receipt (method)
Section titled “load_completion_decision_application_receipt (method)”async SQLiteTaskStore.load_completion_decision_application_receipt(task_id: str, idempotency_key: str) -> CompletionDecisionApplicationReceipt | Nonecreate_task (method)
Section titled “create_task (method)”async SQLiteTaskStore.create_task(request: TaskCreate) -> Taskreschedule_task (method)
Section titled “reschedule_task (method)”async SQLiteTaskStore.reschedule_task(request: TaskRescheduleRequest) -> TaskScheduleReceiptcancel_scheduled_task (method)
Section titled “cancel_scheduled_task (method)”async SQLiteTaskStore.cancel_scheduled_task(request: TaskScheduleCancelRequest) -> TaskScheduleReceiptlist_task_schedule_events (method)
Section titled “list_task_schedule_events (method)”async SQLiteTaskStore.list_task_schedule_events(task_id: str, *, after_sequence: int=0, limit: int=100) -> list[TaskScheduleEvent]next_task_schedule_wakeup (method)
Section titled “next_task_schedule_wakeup (method)”async SQLiteTaskStore.next_task_schedule_wakeup(query: TaskQuery | None=None) -> TaskScheduleWakeupcreate_running_task (method)
Section titled “create_running_task (method)”async SQLiteTaskStore.create_running_task(request: TaskCreate, *, session_invocation: SessionInvocationBinding) -> Taskload_task (method)
Section titled “load_task (method)”async SQLiteTaskStore.load_task(task_id: str, *, _access_bounds=None) -> Task | Noneload_active_attached_task_worker (method)
Section titled “load_active_attached_task_worker (method)”async SQLiteTaskStore.load_active_attached_task_worker(task_id: str, worker_id: str, *, session_id: str, session_instance_id: str) -> Taskload_direct_attached_task_resume (method)
Section titled “load_direct_attached_task_resume (method)”async SQLiteTaskStore.load_direct_attached_task_resume(task_id: str, *, session_id: str, session_instance_id: str) -> Taskload_invocation_snapshot (method)
Section titled “load_invocation_snapshot (method)”async SQLiteTaskStore.load_invocation_snapshot(task_id: str) -> TaskInvocationSnapshot | Nonelist_tasks (method)
Section titled “list_tasks (method)”async SQLiteTaskStore.list_tasks(query: TaskQuery | None=None, *, _access_bounds=None) -> list[Task]load_session_closure_claim (method)
Section titled “load_session_closure_claim (method)”async SQLiteTaskStore.load_session_closure_claim(session_id: str) -> TaskSessionClosureClaim | Noneclaim_session_closure (method)
Section titled “claim_session_closure (method)”async SQLiteTaskStore.claim_session_closure(claim: TaskSessionClosureClaim) -> TaskSessionClosureClaimdelete_session_tasks (method)
Section titled “delete_session_tasks (method)”async SQLiteTaskStore.delete_session_tasks(session_id: str, *, task_ids: tuple[str, ...], policy: Any) -> NoneDelete one session’s terminal task graph in the store transaction.
The closure coordinator supplies a bounded, revalidated identity set; this method owns the SQL dependency cleanup so receipts and attempt records cannot outlive their task rows.
aggregate_operational_snapshot (method)
Section titled “aggregate_operational_snapshot (method)”async SQLiteTaskStore.aggregate_operational_snapshot(filters: TaskAggregateFilter | None=None) -> TaskOperationalSnapshotquery_task_topology (method)
Section titled “query_task_topology (method)”async SQLiteTaskStore.query_task_topology(query: TaskTopologyQuery) -> TaskTopologyStoreResultstart_task (method)
Section titled “start_task (method)”async SQLiteTaskStore.start_task(task_id: str, *, session_id: str | None=None, session_invocation: SessionInvocationBinding | None=None) -> Taskattach_task (method)
Section titled “attach_task (method)”async SQLiteTaskStore.attach_task(task_id: str, *, session_id: str, session_invocation: SessionInvocationBinding, worker_id: str, lease_expires_at: datetime | None=None) -> Taskcomplete_task (method)
Section titled “complete_task (method)”async SQLiteTaskStore.complete_task(task_id: str, result: dict[str, Any], *, worker_id: str | None=None, lease_expires_at: datetime | None=None, handoff_id: str | None=None) -> Taskfail_task (method)
Section titled “fail_task (method)”async SQLiteTaskStore.fail_task(task_id: str, error: dict[str, Any], *, worker_id: str | None=None, lease_expires_at: datetime | None=None, handoff_id: str | None=None) -> Taskterminalize_task (method)
Section titled “terminalize_task (method)”async SQLiteTaskStore.terminalize_task(request: TaskTerminalizationRequest) -> Taskload_task_terminalization_receipt (method)
Section titled “load_task_terminalization_receipt (method)”async SQLiteTaskStore.load_task_terminalization_receipt(task_id: str, idempotency_key: str) -> TaskTerminalizationReceipt | Nonerecover_attached_task_failure (method)
Section titled “recover_attached_task_failure (method)”async SQLiteTaskStore.recover_attached_task_failure(request: TaskTerminalizationRequest, *, session_id: str, session_instance_id: str) -> Taskrelease_interrupted_task_worker (method)
Section titled “release_interrupted_task_worker (method)”async SQLiteTaskStore.release_interrupted_task_worker(request: TaskInterruptedHandoffRequest) -> TaskInterruptedHandoffReceiptrecover_interrupted_task_worker (method)
Section titled “recover_interrupted_task_worker (method)”async SQLiteTaskStore.recover_interrupted_task_worker(request: TaskInterruptedHandoffRequest) -> TaskInterruptedHandoffReceiptload_interrupted_task_handoff_receipt (method)
Section titled “load_interrupted_task_handoff_receipt (method)”async SQLiteTaskStore.load_interrupted_task_handoff_receipt(task_id: str, handoff_id: str) -> TaskInterruptedHandoffReceipt | Nonelist_expired_interrupted_task_handoff_candidates (method)
Section titled “list_expired_interrupted_task_handoff_candidates (method)”async SQLiteTaskStore.list_expired_interrupted_task_handoff_candidates(*, after: tuple[datetime, str] | None=None, limit: int=100) -> list[Task]load_expired_interrupted_task_handoff_candidate (method)
Section titled “load_expired_interrupted_task_handoff_candidate (method)”async SQLiteTaskStore.load_expired_interrupted_task_handoff_candidate(task_id: str) -> Task | Noneclaim_interrupted_task_continuation (method)
Section titled “claim_interrupted_task_continuation (method)”async SQLiteTaskStore.claim_interrupted_task_continuation(worker_id: str, query: TaskQuery | None=None, *, handoff_id: str, task_id: str | None=None, lease_seconds: int=300, after: tuple[datetime, str] | None=None, scan_limit: int=_TASK_INTERRUPTED_HANDOFF_RECOVERY_MAX_PAGE_SIZE) -> InterruptedTaskContinuationClaimPagereconcile_task_cancellation (method)
Section titled “reconcile_task_cancellation (method)”async SQLiteTaskStore.reconcile_task_cancellation(request: TaskCancellationReconciliationRequest) -> TaskCancellationReconciliationResultsettle_task_retry_attempt (method)
Section titled “settle_task_retry_attempt (method)”async SQLiteTaskStore.settle_task_retry_attempt(request: TaskRetrySettlementRequest) -> TaskRetrySettlementResultload_task_retry_settlement (method)
Section titled “load_task_retry_settlement (method)”async SQLiteTaskStore.load_task_retry_settlement(task_id: str, idempotency_key: str) -> TaskRetrySettlementResult | Nonereconcile_task_retry_cancellation (method)
Section titled “reconcile_task_retry_cancellation (method)”async SQLiteTaskStore.reconcile_task_retry_cancellation(request: TaskRetryCancellationReconciliationRequest) -> TaskRetrySettlementResultenforce_task_retry_deadline (method)
Section titled “enforce_task_retry_deadline (method)”async SQLiteTaskStore.enforce_task_retry_deadline(task_id: str, worker_id: str, *, lease_expires_at: datetime, token_count: int=0, estimated_cost: Decimal=Decimal(0)) -> TaskRetrySettlementResult | Nonetask_retry_deadline_elapsed (method)
Section titled “task_retry_deadline_elapsed (method)”async SQLiteTaskStore.task_retry_deadline_elapsed(task_id: str, worker_id: str, *, lease_expires_at: datetime) -> boolcancel_task (method)
Section titled “cancel_task (method)”async SQLiteTaskStore.cancel_task(task_id: str, error: dict[str, Any] | None=None) -> Taskrequest_claimed_task_cancellation (method)
Section titled “request_claimed_task_cancellation (method)”async SQLiteTaskStore.request_claimed_task_cancellation(task_id: str, worker_id: str, lease_expires_at: datetime, error: dict[str, Any] | None=None) -> Taskmark_claimed_task_execution_started (method)
Section titled “mark_claimed_task_execution_started (method)”async SQLiteTaskStore.mark_claimed_task_execution_started(task_id: str, worker_id: str, lease_expires_at: datetime) -> Taskpause_task (method)
Section titled “pause_task (method)”async SQLiteTaskStore.pause_task(task_id: str, *, reason: str | None=None, payload: dict[str, Any] | None=None) -> Taskblock_task (method)
Section titled “block_task (method)”async SQLiteTaskStore.block_task(task_id: str, *, reason: str | None=None, payload: dict[str, Any] | None=None) -> Taskmark_task_needs_attention (method)
Section titled “mark_task_needs_attention (method)”async SQLiteTaskStore.mark_task_needs_attention(task_id: str, *, reason: str | None=None, payload: dict[str, Any] | None=None) -> Taskresume_task (method)
Section titled “resume_task (method)”async SQLiteTaskStore.resume_task(task_id: str) -> Taskclaim_task (method)
Section titled “claim_task (method)”async SQLiteTaskStore.claim_task(worker_id: str, query: TaskQuery | None=None, *, lease_seconds: int=300) -> Task | Noneheartbeat (method)
Section titled “heartbeat (method)”async SQLiteTaskStore.heartbeat(task_id: str, worker_id: str, *, lease_expires_at: datetime, handoff_id: str | None=None, extend_seconds: int=300) -> Taskrelease_task (method)
Section titled “release_task (method)”async SQLiteTaskStore.release_task(task_id: str, worker_id: str, *, lease_expires_at: datetime) -> Taskrelease_attached_task_worker (method)
Section titled “release_attached_task_worker (method)”async SQLiteTaskStore.release_attached_task_worker(task_id: str, worker_id: str, *, lease_expires_at: datetime) -> Taskreclaim_expired (method)
Section titled “reclaim_expired (method)”async SQLiteTaskStore.reclaim_expired(*, query: TaskQuery | None=None, max_reclaims: int=100) -> list[Task]init (method)
Section titled “init (method)”SQLiteTaskStore.__init__(path: str | Path, *, clock: Callable[[], datetime] | None=None, ownership_clock: Callable[[], datetime] | None=None, schema_mode: schema.SchemaMode=schema.SchemaMode.CREATE) -> Noneclose (method)
Section titled “close (method)”async SQLiteTaskStore.close() -> None