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.
PeerAppendKey
Section titled “PeerAppendKey”from cayu.collaboration import PeerAppendKeyStable identity of one logical source occurrence delivered to a target.
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 |
|---|---|---|
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 |
bounded_input (method)
Section titled “bounded_input (method)”PeerAppendKey.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”PeerAppendKey.immutable_fields() -> ContractValuevalidate_target (method)
Section titled “validate_target (method)”PeerAppendKey.validate_target() -> PeerAppendKeyRelease source · Runtime guarantees · Capability guides
PeerContentAppendAuthorization
Section titled “PeerContentAppendAuthorization”from cayu.collaboration import PeerContentAppendAuthorizationTyped evidence returned by the registered #1763 export owner.
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 |
|---|---|---|
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) |
bounded_input (method)
Section titled “bounded_input (method)”PeerContentAppendAuthorization.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”PeerContentAppendAuthorization.immutable_fields() -> ContractValueRelease source · Runtime guarantees · Capability guides
PeerContentAppendRequest
Section titled “PeerContentAppendRequest”from cayu.collaboration import PeerContentAppendRequestAuthenticated append intent; IDs alone never authenticate the source.
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 |
|---|---|---|
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 |
bounded_input (method)
Section titled “bounded_input (method)”PeerContentAppendRequest.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”PeerContentAppendRequest.immutable_fields() -> ContractValuevalidate_keys (method)
Section titled “validate_keys (method)”PeerContentAppendRequest.validate_keys() -> PeerContentAppendRequestRelease source · Runtime guarantees · Capability guides
PeerContentConflict
Section titled “PeerContentConflict”from cayu.collaboration import PeerContentConflictAn 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
PeerContentExposureItem
Section titled “PeerContentExposureItem”from cayu.collaboration import PeerContentExposureItemOne runtime-owned member of an atomic disclosure authorization batch.
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 |
|---|---|---|
origin |
PeerModelAttemptOrigin |
required |
occurrence |
PeerContentOccurrence |
required |
audience |
OwnerRef |
required |
bounded_input (method)
Section titled “bounded_input (method)”PeerContentExposureItem.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”PeerContentExposureItem.immutable_fields() -> ContractValuevalidate_source (method)
Section titled “validate_source (method)”PeerContentExposureItem.validate_source() -> PeerContentExposureItemsingle_arguments (method)
Section titled “single_arguments (method)”PeerContentExposureItem.single_arguments()Release source · Runtime guarantees · Capability guides
PeerContentExposureReceipt
Section titled “PeerContentExposureReceipt”from cayu.collaboration import PeerContentExposureReceiptDurable, replayable exposure outcome separate from queue/append ownership.
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 |
|---|---|---|
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 |
bounded_input (method)
Section titled “bounded_input (method)”PeerContentExposureReceipt.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”PeerContentExposureReceipt.immutable_fields() -> ContractValueRelease source · Runtime guarantees · Capability guides
PeerContentExposureReceiver
Section titled “PeerContentExposureReceiver”from cayu.collaboration import PeerContentExposureReceiverRegistered #1763 owner for current, revocable provider disclosure.
Decorators: @runtime_checkable.
Bases: Protocol.
acquire_peer_exposures (method)
Section titled “acquire_peer_exposures (method)”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.
acquire_peer_exposure (method)
Section titled “acquire_peer_exposure (method)”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
PeerContentExposureRequest
Section titled “PeerContentExposureRequest”from cayu.collaboration import PeerContentExposureRequestAuthenticated record of one named model-attempt exposure decision.
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 |
|---|---|---|
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 |
bounded_input (method)
Section titled “bounded_input (method)”PeerContentExposureRequest.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”PeerContentExposureRequest.immutable_fields() -> ContractValuefor_model_attempt (method)
Section titled “for_model_attempt (method)”PeerContentExposureRequest.for_model_attempt(*, append_key: PeerAppendKey, append_operation_key: str, model_attempt_id: str, provider_name: str, capability_version: int) -> PeerContentExposureRequestvalidate_outcome (method)
Section titled “validate_outcome (method)”PeerContentExposureRequest.validate_outcome() -> PeerContentExposureRequestidentity_commitment (method)
Section titled “identity_commitment (method)”PeerContentExposureRequest.identity_commitment() -> strRelease source · Runtime guarantees · Capability guides
PeerContentOccurrence
Section titled “PeerContentOccurrence”from cayu.collaboration import PeerContentOccurrenceAuthenticated producer evidence referenced by a delivery request.
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 |
|---|---|---|
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}$') |
bounded_input (method)
Section titled “bounded_input (method)”PeerContentOccurrence.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”PeerContentOccurrence.immutable_fields() -> ContractValuevalidate_provenance (method)
Section titled “validate_provenance (method)”PeerContentOccurrence.validate_provenance() -> PeerContentOccurrenceto_message_part (method)
Section titled “to_message_part (method)”PeerContentOccurrence.to_message_part(*, append_key: PeerAppendKey, projection_id: str, operation_key: str) -> PeerContentPartRelease source · Runtime guarantees · Capability guides
PeerContentPayload
Section titled “PeerContentPayload”from cayu.collaboration import PeerContentPayloadBounded historical content selected by the authenticated producer.
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 |
|---|---|---|
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}$') |
bounded_input (method)
Section titled “bounded_input (method)”PeerContentPayload.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”PeerContentPayload.immutable_fields() -> ContractValuevalidate_text (method)
Section titled “validate_text (method)”PeerContentPayload.validate_text(value: str) -> strcopy_artifacts (method)
Section titled “copy_artifacts (method)”PeerContentPayload.copy_artifacts(value)validate_commitment (method)
Section titled “validate_commitment (method)”PeerContentPayload.validate_commitment() -> PeerContentPayloadRelease source · Runtime guarantees · Capability guides
PeerContentReceipt
Section titled “PeerContentReceipt”from cayu.collaboration import PeerContentReceiptDurable append/exclusion outcome; queue, transcript, and exposure remain separate.
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 |
|---|---|---|
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 |
bounded_input (method)
Section titled “bounded_input (method)”PeerContentReceipt.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”PeerContentReceipt.immutable_fields() -> ContractValuevalidate_status (method)
Section titled “validate_status (method)”PeerContentReceipt.validate_status() -> PeerContentReceiptRelease source · Runtime guarantees · Capability guides
PeerContentUnavailable
Section titled “PeerContentUnavailable”from cayu.collaboration import PeerContentUnavailablePeer 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
PeerDeliveryAttemptKey
Section titled “PeerDeliveryAttemptKey”from cayu.collaboration import PeerDeliveryAttemptKeyIdentity of one retryable delivery attempt for an append key.
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 |
|---|---|---|
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) |
bounded_input (method)
Section titled “bounded_input (method)”PeerDeliveryAttemptKey.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”PeerDeliveryAttemptKey.immutable_fields() -> ContractValueRelease source · Runtime guarantees · Capability guides
PeerModelAttemptOrigin
Section titled “PeerModelAttemptOrigin”from cayu.collaboration import PeerModelAttemptOriginRuntime-minted origin for one model-attempt disclosure.
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 |
|---|---|---|
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 |
bounded_input (method)
Section titled “bounded_input (method)”PeerModelAttemptOrigin.bounded_input(value: object) -> Anyimmutable_fields (method)
Section titled “immutable_fields (method)”PeerModelAttemptOrigin.immutable_fields() -> ContractValueRelease source · Runtime guarantees · Capability guides
RegisteredPeerContentExposureReceiver
Section titled “RegisteredPeerContentExposureReceiver”from cayu.collaboration import RegisteredPeerContentExposureReceiverAdapter 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.
init (method)
Section titled “init (method)”RegisteredPeerContentExposureReceiver.__init__(policy: object) -> Noneacquire_peer_exposures (method)
Section titled “acquire_peer_exposures (method)”RegisteredPeerContentExposureReceiver.acquire_peer_exposures(context, *, items)acquire_peer_exposure (method)
Section titled “acquire_peer_exposure (method)”async RegisteredPeerContentExposureReceiver.acquire_peer_exposure(context, **kwargs)