Skip to content

cayu.sessions.context_views

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.sessions import CONTEXT_VIEW_CONTRACT_VERSION
CONTEXT_VIEW_CONTRACT_VERSION = 1

Release source · Runtime guarantees · Capability guides

from cayu.sessions import CONTEXT_VIEW_STORE_VERSION
CONTEXT_VIEW_STORE_VERSION = 1

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ContextViewExtensionProjection

Producer attestation that a projection belongs to the supplied snapshot.

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_commitment StrictStr required
projection_json StrictStr required
ContextViewExtensionProjection.bounded_input(value: object) -> Any
ContextViewExtensionProjection.immutable_fields() -> ContractValue
ContextViewExtensionProjection.validate_history(value: str) -> str

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ContextViewExtensionRecord

One registered extension’s detached historical projection.

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
extension Identifier required
schema_version Generation required
state Literal['present', 'absent'] required
projection_json str | None None
commitment StrictStr required
source_commitment StrictStr required
ContextViewExtensionRecord.bounded_input(value: object) -> Any
ContextViewExtensionRecord.immutable_fields() -> ContractValue
ContextViewExtensionRecord.validate_projection(value: str | None) -> str | None
ContextViewExtensionRecord.validate_state() -> ContextViewExtensionRecord

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ContextViewExtensionRegistration

Application-owned producer for one explicitly registered projection.

The callable runs before the store transaction and must return a boundary- qualified projection (or None for the explicit-absence state). The store only receives the resulting typed record; it never executes an extension.

Decorators: @dataclass(frozen=True, slots=True).

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
extension str required
schema_version int required
project Callable[[ContextViewProjectionSource], ContextViewExtensionProjection | None] required

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ContextViewLifecycleEvent

Durable, public-safe evidence for one ownership transition.

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
event_id Identifier required
operation_key StrictStr required
selection_key StrictStr required
view_id Identifier required
state Literal['adopted', 'transferred', 'released', 'expired'] required
owner OwnerRef required
owner_participant ParticipantRef | None None
pin_commitment StrictStr required
ownership_revision StrictInt Field(ge=1, le=MAX_DURABLE_JSON_INTEGER)
status Literal['committed'] 'committed'
ContextViewLifecycleEvent.bounded_input(value: object) -> Any
ContextViewLifecycleEvent.immutable_fields() -> ContractValue

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ContextViewLimits

Finite hard ceilings for one context-view 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
max_views StrictInt Field(default=256, ge=1, le=MAX_DURABLE_JSON_INTEGER)
max_pins StrictInt Field(default=256, ge=1, le=MAX_DURABLE_JSON_INTEGER)
max_view_bytes StrictInt Field(default=8 * 1024 * 1024, ge=1, le=64 * 1024 * 1024)
max_retained_bytes StrictInt Field(default=64 * 1024 * 1024, ge=1, le=256 * 1024 * 1024)
max_lifetime_seconds StrictInt Field(default=7 * 24 * 60 * 60, ge=1, le=365 * 24 * 60 * 60)
ContextViewLimits.bounded_input(value: object) -> Any
ContextViewLimits.immutable_fields() -> ContractValue

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ContextViewManifest

Positive schema for one completed, historical-only context boundary.

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
source_owner OwnerRef required
participant ParticipantRef required
source_session_id Identifier required
source_session_instance_id Identifier required
view_id Identifier required
interaction_id Identifier required
boundary_id Identifier required
completion_event_id Identifier required
transcript_cursor StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
projection_schema Identifier required
extension_set_commitment StrictStr required
messages_json StrictStr required
application_context_json StrictStr | None None
extensions tuple[ContextViewExtensionRecord, ...] ()
historical_ancestry_json StrictStr required
causal_budget_ancestry_json StrictStr required
resource_references_json StrictStr | None None
compaction_json StrictStr | None None
messages_commitment StrictStr required
application_context_commitment StrictStr required
manifest_commitment StrictStr required
ContextViewManifest.bounded_input(value: object) -> Any
ContextViewManifest.immutable_fields() -> ContractValue
ContextViewManifest.validate_json_fields(value: str | None, info) -> str | None
ContextViewManifest.validate_messages(value: str) -> str
ContextViewManifest.validate_commitments() -> ContextViewManifest

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ContextViewOwnershipRequest

One fenced ownership transition for a selected context-view pin.

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
selection_key StrictStr required
view_id Identifier required
pin_commitment StrictStr required
expected_state Literal['selected', 'adopted', 'transferred'] required
expected_revision StrictInt Field(ge=1, le=MAX_DURABLE_JSON_INTEGER)
operation Literal['adopt', 'transfer', 'release'] required
current_owner OwnerRef required
current_participant ParticipantRef | None None
destination_owner OwnerRef | None None
destination_participant ParticipantRef | None None
operation_key StrictStr required
ContextViewOwnershipRequest.bounded_input(value: object) -> Any
ContextViewOwnershipRequest.immutable_fields() -> ContractValue
ContextViewOwnershipRequest.validate_nonblank_keys(value: str, info) -> str
ContextViewOwnershipRequest.validate_transition() -> ContextViewOwnershipRequest

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ContextViewProjectionSource

Detached whole-turn input; JSON strings cannot carry mutable live state.

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_session_id Identifier required
source_session_instance_id Identifier required
participant_json StrictStr required
interaction_id Identifier required
boundary_id Identifier required
completion_event_id Identifier required
source_transcript_cursor StrictInt Field(ge=0)
transcript_cursor StrictInt Field(ge=0)
messages_json StrictStr required
compaction_json StrictStr required
historical_ancestry_json StrictStr required
ContextViewProjectionSource.bounded_input(value: object) -> Any
ContextViewProjectionSource.immutable_fields() -> ContractValue
ContextViewProjectionSource.validate_source_json(value: str, info) -> str
ContextViewProjectionSource.commitment() -> str

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ContextViewPublicationRequest

Authenticated request to publish one completed session boundary.

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_session_id Identifier required
source_session_instance_id Identifier required
view_id Identifier required
interaction_id Identifier required
boundary_id Identifier required
projection_schema Identifier required
publication_key StrictStr required
resource_receipts tuple[ResourceAcquisitionReceipt, ...] ()
ContextViewPublicationRequest.bounded_input(value: object) -> Any
ContextViewPublicationRequest.immutable_fields() -> ContractValue
ContextViewPublicationRequest.validate_publication_key(value: str) -> str

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ContextViewReadback

Bounded historical readback; never an executable session object.

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
view ContextViewManifest required
historical_only StrictBool True
schema_version Literal[1] 1
ContextViewReadback.bounded_input(value: object) -> Any
ContextViewReadback.immutable_fields() -> ContractValue
ContextViewReadback.require_historical_marker() -> ContextViewReadback

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ContextViewSelectionReceipt

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
selection_key StrictStr required
view ContextViewManifest required
owner OwnerRef required
state Literal['selected', 'adopted', 'transferred', 'released', 'expired'] required
pin_commitment StrictStr required
expires_at_ms StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
ownership_revision StrictInt Field(default=1, ge=1, le=MAX_DURABLE_JSON_INTEGER)
owner_participant ParticipantRef | None None
schema_version Literal[1] 1
ContextViewSelectionReceipt.bounded_input(value: object) -> Any
ContextViewSelectionReceipt.immutable_fields() -> ContractValue

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ContextViewSelectionRequest

Exact selection intent; source ownership is checked by SessionStore.

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_owner OwnerRef required
source_session_id Identifier required
source_session_instance_id Identifier required
selector Literal['exact', 'latest', 'minimum'] required
exact_view_id Identifier | None None
minimum_transcript_cursor StrictInt | None Field(default=None, ge=0)
projection_schema Identifier required
extension_set_commitment StrictStr required
limits ContextViewLimits required
selection_key StrictStr required
ContextViewSelectionRequest.bounded_input(value: object) -> Any
ContextViewSelectionRequest.immutable_fields() -> ContractValue
ContextViewSelectionRequest.validate_selection_key(value: str) -> str
ContextViewSelectionRequest.validate_selector() -> ContextViewSelectionRequest

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ParticipantSessionBinding

Immutable historical participant ownership evidence for one session.

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
application_scope Identifier required
participant ParticipantRef required
session_id Identifier required
session_instance_id Identifier required
lifecycle_revision Generation required
configuration_revision Generation required
admission_generation Generation required
creator_commitment StrictStr required
authorization_commitment StrictStr required
initial_input_commitment StrictStr required
request_commitment StrictStr required
execution_profile_commitment StrictStr required
historical_definition_json StrictStr required
creation_key StrictStr required
policy_evidence_json StrictStr | None None
schema_version Literal[1] 1
ParticipantSessionBinding.bounded_input(value: object) -> Any
ParticipantSessionBinding.immutable_fields() -> ContractValue
ParticipantSessionBinding.validate_policy_evidence(value: str | None) -> str | None
ParticipantSessionBinding.validate_definition(value: str) -> str

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ParticipantSessionCreationReceipt

Replayable receipt for an inert participant-owned session creation.

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
binding ParticipantSessionBinding required
requested_session_id Identifier | None required
initial_input_commitment StrictStr required
execution_profile_json StrictStr required
receipt_commitment StrictStr required
recipient_metadata_json str | None None
schema_version Literal[1] 1
ParticipantSessionCreationReceipt.bounded_input(value: object) -> Any
ParticipantSessionCreationReceipt.immutable_fields() -> ContractValue
ParticipantSessionCreationReceipt.validate_profile(value: str) -> str
ParticipantSessionCreationReceipt.validate_receipt() -> ParticipantSessionCreationReceipt

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ParticipantSessionCreationRequest

Exact creation intent carried across retries and lost acknowledgements.

Decorators: @dataclass(frozen=True, slots=True).

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
request RunRequest required
creation_key str required
metadata_json str | None None
ParticipantSessionCreationRequest.request_commitment() -> str

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ParticipantSessionExecutionRequest

Authenticated, exact activation intent for one inert participant session.

Decorators: @dataclass(frozen=True, slots=True).

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
request RunRequest required
session_instance_id str required
execution_key str required
ParticipantSessionExecutionRequest.request_commitment() -> str
ParticipantSessionExecutionRequest.creation_request_commitment() -> str

Commitment used when creation intentionally omitted a session ID.

Release source · Runtime guarantees · Capability guides

from cayu.sessions import RecipientSessionCreationReceipt

Immutable receipt for one inert recipient-owned child.

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
session_id Identifier required
session_instance_id Identifier required
recipient ParticipantRef required
mode Literal['fresh', 'fork'] required
creation_key StrictStr required
request_commitment StrictStr required
source_view_commitment StrictStr | None None
resource_transfer_commitments tuple[StrictStr, ...] ()
resource_preparation_commitments tuple[StrictStr, ...] ()
participant_receipt ParticipantSessionCreationReceipt required
receipt_commitment StrictStr required
RecipientSessionCreationReceipt.bounded_input(value: object) -> Any
RecipientSessionCreationReceipt.immutable_fields() -> ContractValue
RecipientSessionCreationReceipt.validate_receipt() -> RecipientSessionCreationReceipt

Release source · Runtime guarantees · Capability guides

from cayu.sessions import RecipientSessionCreationRequest

Authenticated, inert recipient creation intent.

This is deliberately distinct from root participant-session creation. A FORK carries one exact, already selected historical view; it never carries a live session or a fallback request.

Decorators: @dataclass(frozen=True, slots=True).

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
request RunRequest required
creation_key str required
recipient ParticipantRef required
mode Literal['fresh', 'fork'] 'fresh'
selected_view ContextViewSelectionReceipt | None None
resource_transfers tuple[ResourceTransferReceipt, ...] ()
preparation_receipts tuple[ResourcePreparationReceipt, ...] ()
RecipientSessionCreationRequest.metadata_json() -> str
RecipientSessionCreationRequest.participant_request() -> ParticipantSessionCreationRequest
RecipientSessionCreationRequest.input_artifact_ids() -> tuple[str, ...]

Return every artifact referenced by the complete child input.

RecipientSessionCreationRequest.input_attachments() -> tuple[FileAttachment, ...]

Keep full resolution identity until retained-material validation.

Release source · Runtime guarantees · Capability guides