cayu.runtime.tool_effects
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.
ToolEffectConflict
Section titled “ToolEffectConflict”from cayu import ToolEffectConflictExact effect identity or state conflicts with the requested operation.
Bases: RuntimeError.
This type’s implementation and inherited behavior are available in the linked release source.
Release source · Runtime guarantees · Capability guides
ToolEffectReceipt
Section titled “ToolEffectReceipt”from cayu import ToolEffectReceiptUntrusted, versioned evidence submitted to an application receipt validator.
Neither this type nor its digest proves that an external effect happened. The registered application validator must authenticate and normalize the receipt for the exact durable call before runtime settlement. The runtime additionally validates its registered result schema and redacts publication.
Bases: BaseModel.
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 |
|---|---|---|
schema_version |
Literal[1] |
1 |
receipt_id |
StrictStr |
required |
receipt_schema |
StrictStr |
required |
receipt_schema_version |
StrictInt |
Field(ge=1, le=2 ** 31 - 1) |
tool_call_id |
StrictStr |
required |
idempotency_key |
StrictStr |
required |
tool_name |
StrictStr |
required |
external_system |
StrictStr | None |
None |
outcome |
Literal['completed', 'failed'] |
required |
message |
StrictStr |
required |
structured |
dict[str, Any] | None |
None |
artifacts |
list[dict[str, Any]] |
Field(default_factory=list) |
resource_versions |
dict[str, str] |
Field(default_factory=dict) |
observed_at |
AwareDatetime |
required |
source |
Literal['adapter', 'reconciler', 'operator'] |
required |
integrity |
dict[str, str] |
Field(default_factory=dict) |
validate_version (method)
Section titled “validate_version (method)”ToolEffectReceipt.validate_version(value: object) -> intvalidate_identity (method)
Section titled “validate_identity (method)”ToolEffectReceipt.validate_identity(value: str, info) -> strvalidate_system (method)
Section titled “validate_system (method)”ToolEffectReceipt.validate_system(value: str | None) -> str | Nonevalidate_message (method)
Section titled “validate_message (method)”ToolEffectReceipt.validate_message(value: str) -> strcopy_structured (method)
Section titled “copy_structured (method)”ToolEffectReceipt.copy_structured(value: object) -> dict[str, Any] | Nonecopy_evidence (method)
Section titled “copy_evidence (method)”ToolEffectReceipt.copy_evidence(value: object, info) -> dict[str, str]copy_artifacts (method)
Section titled “copy_artifacts (method)”ToolEffectReceipt.copy_artifacts(value: object) -> list[dict[str, Any]]normalize_observation (method)
Section titled “normalize_observation (method)”ToolEffectReceipt.normalize_observation(value: AwareDatetime)validate_envelope_bound (method)
Section titled “validate_envelope_bound (method)”ToolEffectReceipt.validate_envelope_bound() -> ToolEffectReceiptRelease source · Runtime guarantees · Capability guides
ToolEffectReconciler
Section titled “ToolEffectReconciler”from cayu import ToolEffectReconcilerApplication-owned authenticity/lookup boundary; must never dispatch the tool.
Bases: Protocol.
reconcile (method)
Section titled “reconcile (method)”async ToolEffectReconciler.reconcile(*, context: ToolEffectReconciliationContext, receipt: ToolEffectReceipt | None) -> ToolEffectReconciliationResultRelease source · Runtime guarantees · Capability guides
ToolEffectReconcilerSpec
Section titled “ToolEffectReconcilerSpec”from cayu import ToolEffectReconcilerSpecRegistration-time, profile-bound contract for one external receipt schema.
Bases: BaseModel.
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 |
|---|---|---|
execution_profile_identity |
ExecutionProfileBehaviorIdentity |
required |
effect |
Literal['external'] |
'external' |
receipt_schema |
StrictStr |
required |
receipt_schema_version |
StrictInt |
Field(ge=1, le=2 ** 31 - 1) |
required |
StrictBool |
False |
supports_lookup |
StrictBool |
False |
timeout_seconds |
StrictFloat |
Field(default=30.0, gt=0, le=300) |
result_schema |
dict[str, Any] |
required |
integrity_fields |
tuple[StrictStr, ...] |
() |
resource_version_fields |
tuple[StrictStr, ...] |
() |
copy_identity (method)
Section titled “copy_identity (method)”ToolEffectReconcilerSpec.copy_identity(value)validate_schema_id (method)
Section titled “validate_schema_id (method)”ToolEffectReconcilerSpec.validate_schema_id(value: str) -> strcopy_result_schema (method)
Section titled “copy_result_schema (method)”ToolEffectReconcilerSpec.copy_result_schema(value)validate_evidence_fields (method)
Section titled “validate_evidence_fields (method)”ToolEffectReconcilerSpec.validate_evidence_fields(value, info)Release source · Runtime guarantees · Capability guides
ToolEffectReconciliationContext
Section titled “ToolEffectReconciliationContext”from cayu import ToolEffectReconciliationContextDetached exact-call identity supplied by runtime, without executable arguments.
Bases: BaseModel.
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 |
|---|---|---|
session_id |
StrictStr |
required |
session_instance_id |
StrictStr |
required |
tool_round_id |
StrictStr |
required |
tool_call_id |
StrictStr |
required |
tool_name |
StrictStr |
required |
idempotency_key |
StrictStr |
required |
intent_digest |
StrictStr |
Field(pattern='^[0-9a-f]{64}$') |
arguments_digest |
StrictStr |
Field(pattern='^[0-9a-f]{64}$') |
record_revision |
StrictInt |
Field(ge=0) |
validate_identity (method)
Section titled “validate_identity (method)”ToolEffectReconciliationContext.validate_identity(value, info)Release source · Runtime guarantees · Capability guides
ToolEffectReconciliationRegistration
Section titled “ToolEffectReconciliationRegistration”from cayu import ToolEffectReconciliationRegistrationPair application logic with its executable, versioned declaration.
init (method)
Section titled “init (method)”ToolEffectReconciliationRegistration.__init__(*, reconciler: ToolEffectReconciler, spec: ToolEffectReconcilerSpec) -> NoneRelease source · Runtime guarantees · Capability guides
ToolEffectReconciliationRequest
Section titled “ToolEffectReconciliationRequest”from cayu import ToolEffectReconciliationRequestAn explicit receipt or lookup for one existing uncertain external call.
Version fields are required optimistic-concurrency evidence, not optional hints. Continuation retains the existing invocation’s limits unless a smaller step bound is supplied. Worker/handoff identities remain subject to the runtime’s existing task-continuation admission.
Bases: BaseModel.
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 |
|---|---|---|
review_reference |
HumanReviewReference | None |
Field(default=None, repr=False) |
session_id |
StrictStr |
required |
session_instance_id |
StrictStr |
required |
tool_round_id |
StrictStr |
required |
tool_call_id |
StrictStr |
required |
tool_name |
StrictStr |
required |
idempotency_key |
StrictStr |
required |
expected_run_epoch |
StrictInt |
Field(ge=0) |
expected_revision |
StrictInt |
Field(ge=0) |
receipt |
ToolEffectReceipt | None |
None |
lookup |
StrictBool |
False |
max_steps |
StrictInt | None |
Field(default=None, ge=1, le=MAX_STEPS) |
task_worker_id |
StrictStr | None |
None |
task_handoff_id |
StrictStr | None |
None |
user_input_response |
UserInputResponse | None |
Field(default=None, repr=False) |
detach_user_input_response (method)
Section titled “detach_user_input_response (method)”ToolEffectReconciliationRequest.detach_user_input_response(value)detach_review_reference (method)
Section titled “detach_review_reference (method)”ToolEffectReconciliationRequest.detach_review_reference(value)validate_identity (method)
Section titled “validate_identity (method)”ToolEffectReconciliationRequest.validate_identity(value, info)detach_receipt (method)
Section titled “detach_receipt (method)”ToolEffectReconciliationRequest.detach_receipt(value)validate_request (method)
Section titled “validate_request (method)”ToolEffectReconciliationRequest.validate_request() -> ToolEffectReconciliationRequestRelease source · Runtime guarantees · Capability guides
ToolEffectReconciliationResult
Section titled “ToolEffectReconciliationResult”from cayu import ToolEffectReconciliationResultApplication observation, subject to runtime binding/schema validation.
Retryability refers only to a new explicit reconciliation lookup, never to another tool invocation. Partial observations cannot authorize replay.
Bases: BaseModel.
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 |
|---|---|---|
outcome |
Literal['completed', 'failed', 'not_found', 'conflict', 'unsupported'] |
required |
receipt |
ToolEffectReceipt | None |
None |
observation |
Literal['sent', 'not_sent', 'outcome_unknown', 'partial'] |
required |
retryable |
StrictBool |
False |
resource_versions |
dict[str, str] |
Field(default_factory=dict) |
copy_receipt (method)
Section titled “copy_receipt (method)”ToolEffectReconciliationResult.copy_receipt(value)copy_resources (method)
Section titled “copy_resources (method)”ToolEffectReconciliationResult.copy_resources(value)validate_outcome (method)
Section titled “validate_outcome (method)”ToolEffectReconciliationResult.validate_outcome() -> ToolEffectReconciliationResultRelease source · Runtime guarantees · Capability guides
ToolEffectReconciliationTarget
Section titled “ToolEffectReconciliationTarget”from cayu import ToolEffectReconciliationTargetRead-only call identity/version snapshot, not permission to reconcile.
Public inspection aliases private key/incarnation fields. Copy these fields into a reconciliation request with a receipt or lookup instruction. The runtime still validates current state, authority and external evidence.
Bases: BaseModel.
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 |
|---|---|---|
session_id |
StrictStr |
required |
session_instance_id |
StrictStr |
required |
tool_round_id |
StrictStr |
required |
tool_call_id |
StrictStr |
required |
tool_name |
StrictStr |
required |
idempotency_key |
StrictStr |
required |
expected_run_epoch |
StrictInt |
Field(ge=0) |
expected_revision |
StrictInt |
Field(ge=0) |
validate_identity (method)
Section titled “validate_identity (method)”ToolEffectReconciliationTarget.validate_identity(value, info)