Skip to content

cayu.collaboration.peer_content

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.

from cayu.collaboration import PeerAppendKey

Stable identity of one logical source occurrence delivered to a target.

Bases: ContractValue.

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
collaboration_namespace Identifier required
collaboration_generation Generation required
occurrence_id Identifier required
consumer_id Identifier required
consumer_participant_incarnation Identifier required
projection_id Identifier required
projection_schema Identifier required
target_session_id Identifier | None None
target_session_instance_id Identifier | None None
creation_target SessionCreationTarget | None None
PeerAppendKey.bounded_input(value: object) -> Any
PeerAppendKey.immutable_fields() -> ContractValue
PeerAppendKey.validate_target() -> PeerAppendKey

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import PeerContentAppendAuthorization

Typed evidence returned by the registered #1763 export owner.

Bases: ContractValue.

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
source_export_receipt_id Identifier required
producer_receipt_id Identifier required
source_session_id Identifier required
source_session_instance_id Identifier required
content_sha256 StrictStr Field(pattern='^[0-9a-f]{64}$')
audience tuple[Identifier, ...] Field(min_length=1, max_length=64)
PeerContentAppendAuthorization.bounded_input(value: object) -> Any
PeerContentAppendAuthorization.immutable_fields() -> ContractValue

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import PeerContentAppendRequest

Authenticated append intent; IDs alone never authenticate the source.

Bases: ContractValue.

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
operation_key Identifier required
append_key PeerAppendKey required
attempt_key PeerDeliveryAttemptKey required
occurrence PeerContentOccurrence required
wake_policy Literal['none', 'ordinary_continuation'] 'none'
replaces_operation_key Identifier | None None
PeerContentAppendRequest.bounded_input(value: object) -> Any
PeerContentAppendRequest.immutable_fields() -> ContractValue
PeerContentAppendRequest.validate_keys() -> PeerContentAppendRequest

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import PeerContentConflict

An immutable peer append key was reused with different evidence.

Bases: ValueError.

This type’s implementation and inherited behavior are available in the linked release source.

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import PeerContentExposureItem

One runtime-owned member of an atomic disclosure authorization batch.

Bases: ContractValue.

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
origin PeerModelAttemptOrigin required
occurrence PeerContentOccurrence required
audience OwnerRef required
PeerContentExposureItem.bounded_input(value: object) -> Any
PeerContentExposureItem.immutable_fields() -> ContractValue
PeerContentExposureItem.validate_source() -> PeerContentExposureItem
PeerContentExposureItem.single_arguments()

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import PeerContentExposureReceipt

Durable, replayable exposure outcome separate from queue/append ownership.

Bases: ContractValue.

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
operation_key Identifier required
append_key PeerAppendKey required
exposure_id Identifier required
model_attempt_id Identifier required
outcome Literal['pending', 'exposed', 'not_exposed'] required
reason Identifier | None None
replayed StrictBool False
PeerContentExposureReceipt.bounded_input(value: object) -> Any
PeerContentExposureReceipt.immutable_fields() -> ContractValue

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import PeerContentExposureReceiver

Registered #1763 owner for current, revocable provider disclosure.

Decorators: @runtime_checkable.

Bases: Protocol.

PeerContentExposureReceiver.acquire_peer_exposures(context: SessionExportAccessContext | None, *, items: tuple[PeerContentExposureItem, ...]) -> AbstractAsyncContextManager[tuple[PeerContentPayload, ...]]

Authorize all items under one guard; yield projections in item order.

Retain current authority through serialization. Do not recursively enter a non-reentrant per-item guard. Unsupported batches must fail closed.

PeerContentExposureReceiver.acquire_peer_exposure(context: SessionExportAccessContext | None, *, origin: SessionExportRuntimeOrigin | PeerModelAttemptOrigin, append_key: PeerAppendKey, occurrence: PeerContentOccurrence, audience: OwnerRef, provider_name: Identifier, model: Identifier, model_attempt_id: Identifier, capability_version: Generation) -> AbstractAsyncContextManager[PeerContentPayload]

Yield the bounded projection while holding disclosure authority.

Provider adapters must serialize only this returned projection. The occurrence is evidence used for authorization, never the projection source passed directly to an external provider.

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import PeerContentExposureRequest

Authenticated record of one named model-attempt exposure decision.

Bases: ContractValue.

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
operation_key Identifier required
append_key PeerAppendKey required
exposure_id Identifier required
model_attempt_id Identifier required
provider_name Identifier required
capability_version Generation required
outcome Literal['exposed', 'not_exposed'] required
reason Identifier | None None
PeerContentExposureRequest.bounded_input(value: object) -> Any
PeerContentExposureRequest.immutable_fields() -> ContractValue
PeerContentExposureRequest.for_model_attempt(*, append_key: PeerAppendKey, append_operation_key: str, model_attempt_id: str, provider_name: str, capability_version: int) -> PeerContentExposureRequest
PeerContentExposureRequest.validate_outcome() -> PeerContentExposureRequest
PeerContentExposureRequest.identity_commitment() -> str

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import PeerContentOccurrence

Authenticated producer evidence referenced by a delivery request.

Bases: ContractValue.

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
occurrence_id Identifier required
sender_participant_id Identifier required
sender_participant_incarnation Identifier required
sender_session_id Identifier required
sender_session_instance_id Identifier required
producer_receipt_id Identifier required
source_export_receipt_id Identifier required
payload PeerContentPayload required
audience tuple[Identifier, ...] Field(min_length=1, max_length=64)
provenance_sha256 StrictStr Field(pattern='^[0-9a-f]{64}$')
PeerContentOccurrence.bounded_input(value: object) -> Any
PeerContentOccurrence.immutable_fields() -> ContractValue
PeerContentOccurrence.validate_provenance() -> PeerContentOccurrence
PeerContentOccurrence.to_message_part(*, append_key: PeerAppendKey, projection_id: str, operation_key: str) -> PeerContentPart

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import PeerContentPayload

Bounded historical content selected by the authenticated producer.

Bases: ContractValue.

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
text StrictStr required
artifact_commitments tuple[StrictStr, ...] Field(default=(), max_length=PEER_CONTENT_MAX_ARTIFACTS)
content_sha256 StrictStr Field(pattern='^[0-9a-f]{64}$')
PeerContentPayload.bounded_input(value: object) -> Any
PeerContentPayload.immutable_fields() -> ContractValue
PeerContentPayload.validate_text(value: str) -> str
PeerContentPayload.copy_artifacts(value)
PeerContentPayload.validate_commitment() -> PeerContentPayload

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import PeerContentReceipt

Durable append/exclusion outcome; queue, transcript, and exposure remain separate.

Bases: ContractValue.

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
operation_key Identifier required
append_key PeerAppendKey required
attempt_generation Generation required
status Literal['appended', 'excluded', 'pending', 'not_exposed'] required
disclosure Literal['available', 'withheld'] 'available'
occurrence PeerContentOccurrence | None None
queue_id Identifier | None None
transcript_event_id Identifier | None None
target_session_id Identifier | None None
target_session_instance_id Identifier | None None
reason Identifier | None None
replayed StrictBool False
PeerContentReceipt.bounded_input(value: object) -> Any
PeerContentReceipt.immutable_fields() -> ContractValue
PeerContentReceipt.validate_status() -> PeerContentReceipt

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import PeerContentUnavailable

Peer content cannot be exposed under current authority.

Bases: PermissionError.

This type’s implementation and inherited behavior are available in the linked release source.

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import PeerDeliveryAttemptKey

Identity of one retryable delivery attempt for an append key.

Bases: ContractValue.

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
append_key PeerAppendKey required
interest_id Identifier required
attempt_generation StrictInt Field(ge=1, le=PEER_CONTENT_MAX_ATTEMPTS)
target_run_epoch StrictInt Field(ge=0, le=MAX_PORTABLE_JSON_INTEGER)
target_transcript_cursor StrictInt Field(ge=0, le=MAX_PORTABLE_JSON_INTEGER)
withdrawal_generation Generation required
deadline_at_ms StrictInt Field(ge=1, le=MAX_PORTABLE_JSON_INTEGER)
PeerDeliveryAttemptKey.bounded_input(value: object) -> Any
PeerDeliveryAttemptKey.immutable_fields() -> ContractValue

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import PeerModelAttemptOrigin

Runtime-minted origin for one model-attempt disclosure.

Bases: ContractValue.

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
target_session_id Identifier required
target_session_instance_id Identifier required
run_epoch StrictInt Field(ge=0, le=MAX_PORTABLE_JSON_INTEGER)
root_invocation_id Identifier required
requester_principal Identifier required
interaction_id Identifier required
model_step_id Identifier required
model_attempt_id Identifier required
append_key PeerAppendKey required
provider_name Identifier required
model Identifier required
capability_version Generation required
exposure_generation Generation required
PeerModelAttemptOrigin.bounded_input(value: object) -> Any
PeerModelAttemptOrigin.immutable_fields() -> ContractValue

Release source · Runtime guarantees · Capability guides

from cayu.collaboration import RegisteredPeerContentExposureReceiver

Adapter from the registered #1763 policy to peer exposure.

This adapter has no authorization of its own. It delegates to the registered policy hook, whose default implementation denies the operation.

RegisteredPeerContentExposureReceiver.__init__(policy: object) -> None
RegisteredPeerContentExposureReceiver.acquire_peer_exposures(context, *, items)
async RegisteredPeerContentExposureReceiver.acquire_peer_exposure(context, **kwargs)

Release source · Runtime guarantees · Capability guides