cayu.artifacts.resources
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.
LocalArtifactResourceOwner
Section titled “LocalArtifactResourceOwner”from cayu.artifacts import LocalArtifactResourceOwnerLocal durable artifact owner; only exact artifact and manifest selectors qualify.
Bases: ResourceSelectorOwner.
canonical_resource_kinds (property)
Section titled “canonical_resource_kinds (property)”LocalArtifactResourceOwner.canonical_resource_kinds() -> tuple[str, ...]owner (property)
Section titled “owner (property)”LocalArtifactResourceOwner.owner() -> OwnerRefcanonicalize (method)
Section titled “canonicalize (method)”LocalArtifactResourceOwner.canonicalize(selector: ResourceSelector) -> ResourceSelectorcontains (method)
Section titled “contains (method)”LocalArtifactResourceOwner.contains(parent: ResourceSelector, child: ResourceSelector) -> boolinit (method)
Section titled “init (method)”LocalArtifactResourceOwner.__init__(root: str | os.PathLike[str], *, owner: OwnerRef, artifact_store: ArtifactStore, redactor: SecretRedactor | None=None, preparation_reader: ResourcePreparationReader | None=None) -> Nonedrain (method)
Section titled “drain (method)”async LocalArtifactResourceOwner.drain() -> NoneObserve retained in-process workers without cancelling their effects.
artifact_selector (method)
Section titled “artifact_selector (method)”LocalArtifactResourceOwner.artifact_selector(store: LocalArtifactStore, owner: OwnerRef, artifact_id: str) -> ResourceSelectorObserve source identity before host registration; this grants no authority.
register_manifest (method)
Section titled “register_manifest (method)”LocalArtifactResourceOwner.register_manifest(manifest: FolderInputManifest) -> ResourceSelectorPersist trusted folder material and return its exact selector.
authorize (method)
Section titled “authorize (method)”async LocalArtifactResourceOwner.authorize(command: ResourceAcquisitionCommand, *, permit: PermitCommand) -> ResourcePreparationReceiptPersist trusted bounded preparation before any acquisition dispatch.
acquire (method)
Section titled “acquire (method)”async LocalArtifactResourceOwner.acquire(command: ResourceAcquisitionCommand, *, preparation: ResourcePreparationReceipt | None=None) -> ResourceAcquisitionReceiptreadback (method)
Section titled “readback (method)”async LocalArtifactResourceOwner.readback(command: ResourceAcquisitionCommand) -> ExactLookup[ResourceAcquisitionReceipt]release (method)
Section titled “release (method)”async LocalArtifactResourceOwner.release(receipt: ResourceAcquisitionReceipt) -> Nonesettle_preparation (method)
Section titled “settle_preparation (method)”async LocalArtifactResourceOwner.settle_preparation(command: ResourceAcquisitionCommand | ResourceTransferCommand, *, permit: PermitCommand, source_owner: LocalArtifactResourceOwner | None=None) -> ReceivingSettlementReceiptExclude or release one exact preparation under its native owner fence.
Cleanup requires independent registered authority. A missing operation is fenced durably before acknowledging exclusion; cancellation or a missing readback never establishes that outcome.
accept_transfer (method)
Section titled “accept_transfer (method)”async LocalArtifactResourceOwner.accept_transfer(command: ResourceTransferCommand, *, source_owner: LocalArtifactResourceOwner, expected_permit: PermitCommand | None=None) -> ResourceTransferReceiptread_transfer (method)
Section titled “read_transfer (method)”async LocalArtifactResourceOwner.read_transfer(command: ResourceTransferCommand) -> ExactLookup[ResourceTransferReceipt]read_preparation (method)
Section titled “read_preparation (method)”async LocalArtifactResourceOwner.read_preparation(command: ResourceAcquisitionCommand | ResourceTransferCommand) -> ResourcePreparationReceiptRead exact owner-issued preparation evidence under its fence.
read_material (method)
Section titled “read_material (method)”async LocalArtifactResourceOwner.read_material(expected)Reconstruct one exact accepted transfer under current native authority.
release_transfer (method)
Section titled “release_transfer (method)”async LocalArtifactResourceOwner.release_transfer(receipt: ResourceTransferReceipt) -> NoneRelease destination retention using its exact durable acceptance.
reconcile (method)
Section titled “reconcile (method)”async LocalArtifactResourceOwner.reconcile(*, source_owners: tuple[LocalArtifactResourceOwner, ...]=()) -> tuple[str, ...]release_transferred_source (method)
Section titled “release_transferred_source (method)”async LocalArtifactResourceOwner.release_transferred_source(transfer: ResourceTransferReceipt, *, destination_owner: LocalArtifactResourceOwner) -> ResourceAcquisitionReceiptRelease source · Runtime guarantees · Capability guides
MandateResourcePreparationReader
Section titled “MandateResourcePreparationReader”from cayu.artifacts import MandateResourcePreparationReaderConcrete registered receiver using the shared mandate resolver.
Bases: ResourcePreparationReader.
owner (property)
Section titled “owner (property)”MandateResourcePreparationReader.owner() -> OwnerRefacquire (method)
Section titled “acquire (method)”async MandateResourcePreparationReader.acquire(command, permit)revalidate (method)
Section titled “revalidate (method)”async MandateResourcePreparationReader.revalidate(command: ResourceAcquisitionCommand | ResourceTransferCommand, lease: ResourcePreparationLease) -> NoneObserve current authority without authorizing a later effect.
revalidation_guard (method)
Section titled “revalidation_guard (method)”async MandateResourcePreparationReader.revalidation_guard(command, lease)authorize_release (method)
Section titled “authorize_release (method)”async MandateResourcePreparationReader.authorize_release(command)authorize_preparation_cleanup (method)
Section titled “authorize_preparation_cleanup (method)”async MandateResourcePreparationReader.authorize_preparation_cleanup(command, permit)register_responsibility (method)
Section titled “register_responsibility (method)”async MandateResourcePreparationReader.register_responsibility(command, permit)transfer_permit (method)
Section titled “transfer_permit (method)”MandateResourcePreparationReader.transfer_permit(command)settle_responsibility (method)
Section titled “settle_responsibility (method)”async MandateResourcePreparationReader.settle_responsibility(command, permit, reader)init (method)
Section titled “init (method)”MandateResourcePreparationReader.__init__(*, owner: ResourceSelectorOwner, resolver: MandateResolver, context: MandateAccessContext, redactor: SecretRedactor, registration: ObjectRef, policy: ObjectRef, artifact_store: ArtifactStore, collaboration_store: CollaborationStore, initialized: CollaborationInitialization, responsibilities: tuple[tuple[ResourceAcquisitionCommand, PermitCommand], ...], transfers: tuple[tuple[ResourceTransferCommand, PermitCommand], ...]=(), transfer_templates: tuple[tuple[ResourceTransferTemplate, PermitCommand], ...]=()) -> NoneRelease source · Runtime guarantees · Capability guides
resource_operation_digest
Section titled “resource_operation_digest”from cayu.artifacts import resource_operation_digestresource_operation_digest(command: ResourceAcquisitionCommand | ResourceTransferCommand | ResourceTransferTemplate) -> strRelease source · Runtime guarantees · Capability guides
ResourceAcquisitionCommand
Section titled “ResourceAcquisitionCommand”from cayu.artifacts import ResourceAcquisitionCommandBases: ExpectedOperation[ResourceAcquisitionIntent].
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 |
|---|---|---|
operation |
OperationRef |
required |
kind |
Literal['resource_acquisition'] |
'resource_acquisition' |
schema_version |
Literal[1] |
RESOURCE_OPERATION_SCHEMA |
mode |
Literal['acquire'] |
'acquire' |
source |
OwnerRef |
required |
destination |
OwnerRef |
required |
initiator |
InitiatorBinding |
required |
receipt_stage |
Literal['acquired'] |
'acquired' |
intent |
IntentT |
required |
bounded_input (method)
Section titled “bounded_input (method)”ResourceAcquisitionCommand.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”ResourceAcquisitionCommand.immutable_fields() -> ContractValueoperation_scope (method)
Section titled “operation_scope (method)”ResourceAcquisitionCommand.operation_scope() -> ExpectedOperation[IntentT]exact_owner (method)
Section titled “exact_owner (method)”ResourceAcquisitionCommand.exact_owner() -> SelfRelease source · Runtime guarantees · Capability guides
ResourceAcquisitionIntent
Section titled “ResourceAcquisitionIntent”from cayu.artifacts import ResourceAcquisitionIntentAll decision-bearing resource acquisition inputs.
Bases: ContractValue.
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 |
|---|---|---|
unordered_fields |
class attribute |
frozenset({'allowed_operations'}) |
selector |
ResourceSelector |
required |
allowed_operations |
tuple[Literal['read', 'transfer', 'release'], ...] |
Field(min_length=1, max_length=3) |
isolation_mode |
Literal['local_durable'] |
'local_durable' |
max_materials |
StrictInt |
Field(ge=1, le=RESOURCE_MAX_MATERIALS) |
max_manifest_bytes |
StrictInt |
Field(ge=1024, le=32 * 1024 * 1024) |
max_total_bytes |
StrictInt |
Field(ge=1, le=4 * 1024 ** 3) |
cleanup_owner |
OwnerRef |
required |
policy |
ObjectRef |
required |
deadline_at_ms |
StrictInt | None |
Field(default=None, ge=1, le=2 ** 53 - 1) |
bounded_input (method)
Section titled “bounded_input (method)”ResourceAcquisitionIntent.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”ResourceAcquisitionIntent.immutable_fields() -> ContractValuevalidate_identity (method)
Section titled “validate_identity (method)”ResourceAcquisitionIntent.validate_identity() -> SelfRelease source · Runtime guarantees · Capability guides
ResourceAcquisitionReceipt
Section titled “ResourceAcquisitionReceipt”from cayu.artifacts import ResourceAcquisitionReceiptImmutable owner-issued evidence of retained exact material.
Bases: ContractValue.
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 |
|---|---|---|
command |
ResourceAcquisitionCommand |
required |
receipt_id |
Identifier |
required |
stage |
Literal['pending', 'owned', 'releasing', 'uncertain', 'transferred', 'released'] |
required |
operation_digest |
str |
Field(pattern='^[0-9a-f]{64}$') |
material_ids |
tuple[Identifier, ...] |
Field(min_length=1, max_length=RESOURCE_MAX_MATERIALS) |
content_commitment |
str |
Field(pattern='^sha256:[0-9a-f]{64}$') |
manifest_commitment |
str |
Field(pattern='^[0-9a-f]{64}$') |
material_count |
StrictInt |
Field(ge=1, le=RESOURCE_MAX_MATERIALS) |
total_bytes |
StrictInt |
Field(ge=0, le=4 * 1024 ** 3) |
allowed_operations |
tuple[Literal['read', 'transfer', 'release'], ...] |
Field(min_length=1, max_length=3) |
bounded_input (method)
Section titled “bounded_input (method)”ResourceAcquisitionReceipt.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”ResourceAcquisitionReceipt.immutable_fields() -> ContractValueexact_shape (method)
Section titled “exact_shape (method)”ResourceAcquisitionReceipt.exact_shape() -> SelfRelease source · Runtime guarantees · Capability guides
ResourceOwnerConflict
Section titled “ResourceOwnerConflict”from cayu.artifacts import ResourceOwnerConflictA fixed operation key was reused with different expected input.
Bases: ResourceOwnerError.
This type’s implementation and inherited behavior are available in the linked release source.
Release source · Runtime guarantees · Capability guides
ResourceOwnerError
Section titled “ResourceOwnerError”from cayu.artifacts import ResourceOwnerErrorThe owner cannot establish or reconcile exact resource responsibility.
Bases: RuntimeError.
This type’s implementation and inherited behavior are available in the linked release source.
Release source · Runtime guarantees · Capability guides
ResourceOwnerUnavailable
Section titled “ResourceOwnerUnavailable”from cayu.artifacts import ResourceOwnerUnavailableDurable readback or source material is unavailable.
Bases: ResourceOwnerError.
This type’s implementation and inherited behavior are available in the linked release source.
Release source · Runtime guarantees · Capability guides
ResourceOwnerUnsupported
Section titled “ResourceOwnerUnsupported”from cayu.artifacts import ResourceOwnerUnsupportedThe requested adapter or selector mode is not qualified.
Bases: ResourceOwnerError.
This type’s implementation and inherited behavior are available in the linked release source.
Release source · Runtime guarantees · Capability guides
ResourcePreparationAuthorization
Section titled “ResourcePreparationAuthorization”from cayu.artifacts import ResourcePreparationAuthorizationEvidence yielded under a registered authority’s revocation guard.
Bases: ContractValue.
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 |
|---|---|---|
command |
ResourceAcquisitionCommand | ResourceTransferCommand |
required |
permit |
PermitCommand |
required |
lease |
ResourcePreparationLease |
required |
bounded_input (method)
Section titled “bounded_input (method)”ResourcePreparationAuthorization.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”ResourcePreparationAuthorization.immutable_fields() -> ContractValueRelease source · Runtime guarantees · Capability guides
ResourcePreparationLease
Section titled “ResourcePreparationLease”from cayu.artifacts import ResourcePreparationLeaseRuntime-created, receiver-bound authority; not a caller credential.
Bases: ContractValue.
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 |
|---|---|---|
operation_digest |
str |
Field(pattern='^[0-9a-f]{64}$') |
receiver |
OwnerRef |
required |
resolver_generation |
StrictInt |
Field(ge=0) |
receiver_generation |
StrictInt |
Field(ge=0) |
revocation_generation |
StrictInt |
Field(ge=0) |
expires_at_ms |
StrictInt |
Field(ge=1) |
nonce |
str |
Field(min_length=16, max_length=128) |
authority_sha256 |
str |
Field(pattern='^[0-9a-f]{64}$') |
authority_json |
str |
Field(min_length=2, max_length=65536) |
chain_generations |
tuple[tuple[ObjectRef, StrictInt], ...] |
Field(max_length=16) |
bounded_input (method)
Section titled “bounded_input (method)”ResourcePreparationLease.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”ResourcePreparationLease.immutable_fields() -> ContractValueRelease source · Runtime guarantees · Capability guides
ResourcePreparationReader
Section titled “ResourcePreparationReader”from cayu.artifacts import ResourcePreparationReaderTrusted application registration, never selected by operation input.
Implementations authenticate caller identity, the exact retained permit, command, policy, bounds and source revision. Merely validating or echoing these values is not authorization. The guard serializes revocation until exit, performs no acquisition effects, and must not block the event loop. Durable recovery requires re-registration of the same authority.
Bases: ABC.
owner (property)
Section titled “owner (property)”ResourcePreparationReader.owner() -> OwnerRefacquire (method)
Section titled “acquire (method)”ResourcePreparationReader.acquire(command: ResourceAcquisitionCommand | ResourceTransferCommand, permit: PermitCommand) -> AbstractAsyncContextManager[ResourcePreparationAuthorization]revalidate (method)
Section titled “revalidate (method)”async ResourcePreparationReader.revalidate(command: ResourceAcquisitionCommand | ResourceTransferCommand, lease: ResourcePreparationLease) -> NoneObserve current authority without authorizing a later effect.
revalidation_guard (method)
Section titled “revalidation_guard (method)”ResourcePreparationReader.revalidation_guard(command: ResourceAcquisitionCommand | ResourceTransferCommand, lease: ResourcePreparationLease) -> AbstractAsyncContextManager[None]Serialize revocation through dispatch/publication, not effect settlement.
authorize_release (method)
Section titled “authorize_release (method)”async ResourcePreparationReader.authorize_release(command: ResourceAcquisitionCommand) -> NoneAuthenticate current public cleanup authority independently of acquisition expiry.
authorize_preparation_cleanup (method)
Section titled “authorize_preparation_cleanup (method)”async ResourcePreparationReader.authorize_preparation_cleanup(command, permit: PermitCommand) -> NoneAuthenticate exact registered preparation cleanup, including pre-dispatch.
Releasing an existing receipt alone does not qualify exclusion of a future operation. Unqualified receivers must refuse this extension.
register_responsibility (method)
Section titled “register_responsibility (method)”async ResourcePreparationReader.register_responsibility(command, permit) -> Nonetransfer_permit (method)
Section titled “transfer_permit (method)”ResourcePreparationReader.transfer_permit(command: ResourceTransferCommand) -> PermitCommandResolve exact destination responsibility from trusted registration.
settle_responsibility (method)
Section titled “settle_responsibility (method)”async ResourcePreparationReader.settle_responsibility(command, permit, reader: PermitSettlementReader) -> NoneRelease source · Runtime guarantees · Capability guides
ResourcePreparationReceipt
Section titled “ResourcePreparationReceipt”from cayu.artifacts import ResourcePreparationReceiptOwner-issued bounded preparation evidence, not caller-mintable authority.
Bases: ContractValue.
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 |
|---|---|---|
operation_digest |
str |
Field(pattern='^[0-9a-f]{64}$') |
owner |
OwnerRef |
required |
command_bytes_sha256 |
str |
Field(pattern='^[0-9a-f]{64}$') |
permit |
PermitCommand |
required |
lease |
ResourcePreparationLease |
required |
bounded_input (method)
Section titled “bounded_input (method)”ResourcePreparationReceipt.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”ResourcePreparationReceipt.immutable_fields() -> ContractValueRelease source · Runtime guarantees · Capability guides
ResourceTransferCommand
Section titled “ResourceTransferCommand”from cayu.artifacts import ResourceTransferCommandBases: ExpectedOperation[ResourceTransferIntent].
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 |
|---|---|---|
operation |
OperationRef |
required |
kind |
Literal['resource_transfer'] |
'resource_transfer' |
schema_version |
Literal[1] |
1 |
mode |
Literal['transfer'] |
'transfer' |
source |
OwnerRef |
required |
destination |
OwnerRef |
required |
initiator |
InitiatorBinding |
required |
receipt_stage |
Literal['accepted'] |
'accepted' |
intent |
IntentT |
required |
bounded_input (method)
Section titled “bounded_input (method)”ResourceTransferCommand.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”ResourceTransferCommand.immutable_fields() -> ContractValueoperation_scope (method)
Section titled “operation_scope (method)”ResourceTransferCommand.operation_scope() -> ExpectedOperation[IntentT]exact_owner (method)
Section titled “exact_owner (method)”ResourceTransferCommand.exact_owner() -> SelfRelease source · Runtime guarantees · Capability guides
ResourceTransferIntent
Section titled “ResourceTransferIntent”from cayu.artifacts import ResourceTransferIntentBases: ContractValue.
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 |
|---|---|---|
receipt |
ResourceAcquisitionReceipt |
required |
destination |
OwnerRef |
required |
cleanup_owner |
OwnerRef |
required |
acceptance_generation |
Generation |
required |
expected_material_commitment |
str |
Field(pattern='^sha256:[0-9a-f]{64}$') |
bounded_input (method)
Section titled “bounded_input (method)”ResourceTransferIntent.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”ResourceTransferIntent.immutable_fields() -> ContractValueexact_transfer (method)
Section titled “exact_transfer (method)”ResourceTransferIntent.exact_transfer() -> SelfRelease source · Runtime guarantees · Capability guides
ResourceTransferReceipt
Section titled “ResourceTransferReceipt”from cayu.artifacts import ResourceTransferReceiptBases: ContractValue.
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 |
|---|---|---|
command |
ResourceTransferCommand |
required |
receipt_id |
Identifier |
required |
stage |
Literal['pending', 'accepted', 'releasing', 'uncertain', 'released'] |
required |
operation_digest |
str |
Field(pattern='^[0-9a-f]{64}$') |
destination_pin_owner |
Identifier |
required |
bounded_input (method)
Section titled “bounded_input (method)”ResourceTransferReceipt.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”ResourceTransferReceipt.immutable_fields() -> ContractValueexact_shape (method)
Section titled “exact_shape (method)”ResourceTransferReceipt.exact_shape() -> SelfRelease source · Runtime guarantees · Capability guides
ResourceTransferTemplate
Section titled “ResourceTransferTemplate”from cayu.artifacts import ResourceTransferTemplatePinned registration before its exact acquisition produces a receipt.
Binding only constructs data. The destination’s existing transfer owner must authenticate the complete resulting receipt through the source owner before acquiring any destination pin. A template never renews a mandate.
Bases: ContractValue.
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 |
|---|---|---|
kind |
Literal['resource_transfer_template'] |
'resource_transfer_template' |
schema_version |
Literal[1] |
1 |
operation |
OperationRef |
required |
source |
OwnerRef |
required |
destination |
OwnerRef |
required |
initiator |
InitiatorBinding |
required |
acquisition |
ResourceAcquisitionCommand |
required |
acceptance_generation |
Generation |
required |
bounded_input (method)
Section titled “bounded_input (method)”ResourceTransferTemplate.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”ResourceTransferTemplate.immutable_fields() -> ContractValueexact_source (method)
Section titled “exact_source (method)”ResourceTransferTemplate.exact_source() -> Selfbind (method)
Section titled “bind (method)”ResourceTransferTemplate.bind(receipt: ResourceAcquisitionReceipt) -> ResourceTransferCommand