Skip to content

cayu.sessions.child_context

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 CHILD_SESSION_CONTEXT_PROJECTION_VERSION
CHILD_SESSION_CONTEXT_PROJECTION_VERSION = 'cayu.child-session-context.v1'

Release source · Runtime guarantees · Capability guides

from cayu.sessions import CHILD_SESSION_PUBLIC_ALIAS_MAX_CHARS
CHILD_SESSION_PUBLIC_ALIAS_MAX_CHARS = 256

Release source · Runtime guarantees · Capability guides

CHILD_SESSION_PUBLIC_OCCURRENCE_ID_MAX_CHARS

Section titled “CHILD_SESSION_PUBLIC_OCCURRENCE_ID_MAX_CHARS”
from cayu.sessions import CHILD_SESSION_PUBLIC_OCCURRENCE_ID_MAX_CHARS
CHILD_SESSION_PUBLIC_OCCURRENCE_ID_MAX_CHARS = 128

Release source · Runtime guarantees · Capability guides

from cayu.sessions import CHILD_SESSION_RESULT_REFERENCE_VERSION
CHILD_SESSION_RESULT_REFERENCE_VERSION = 'cayu.child-session-result-reference.v1'

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ChildSessionContextContribution

Internal composition result kept separate from durable transcript messages.

Bases: BaseModel.

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
projection ChildSessionContextProjection | None None
message Message | None None
stage_binding ChildSessionNotificationStageBinding | None None
ChildSessionContextContribution.validate_contribution() -> ChildSessionContextContribution

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ChildSessionContextContributor

Project current direct-child state after transcript context selection.

The contributor stores no child lifecycle truth. Terminal freshness is consumed only when the owning model stage crosses Cayu’s durable dispatch fence; nonterminal state remains a current level-triggered snapshot.

Decorators: @dataclass(frozen=True, slots=True, kw_only=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
max_children_inspected int CHILD_SESSION_NOTIFICATION_DEFAULT_CHILDREN_INSPECTED
max_entries int CHILD_SESSION_NOTIFICATION_DEFAULT_ENTRIES
max_projection_bytes int CHILD_SESSION_NOTIFICATION_DEFAULT_PROJECTION_BYTES
ChildSessionContextContributor.configuration_material() -> dict[str, Any]
async ChildSessionContextContributor.build(*, session_store: SessionStore, session: Session) -> ChildSessionContextContribution

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ChildSessionContextCoverage

Bases: BaseModel.

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
state ChildSessionContextCoverageState required
inspected_child_count StrictInt Field(ge=0, le=CHILD_SESSION_NOTIFICATION_MAX_CHILDREN_INSPECTED)
rendered_entry_count StrictInt Field(ge=0, le=min(CHILD_SESSION_NOTIFICATION_MAX_ENTRIES, CHILD_SESSION_NOTIFICATION_MAX_RETRIEVAL_REFERENCES))
unavailable_child_count StrictInt Field(ge=0, le=CHILD_SESSION_NOTIFICATION_MAX_CHILDREN_INSPECTED)
more_children StrictBool False
reasons tuple[ChildSessionContextTruncationReason, ...] ()
ChildSessionContextCoverage.validate_coverage() -> ChildSessionContextCoverage

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ChildSessionContextCoverageState

Bases: StrEnum.

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
COMPLETE class attribute 'complete'
TRUNCATED class attribute 'truncated'
UNAVAILABLE class attribute 'unavailable'

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ChildSessionContextEntry

Secret-free lifecycle state rendered to the parent model.

Bases: BaseModel.

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
parent_session_id str Field(max_length=CHILD_SESSION_PUBLIC_ALIAS_MAX_CHARS)
child_session_id str Field(max_length=CHILD_SESSION_PUBLIC_ALIAS_MAX_CHARS)
relationship ChildSessionRelationship required
state ChildSessionLifecycleState required
occurrence ChildSessionContextOccurrence required
freshness Literal['current', 'fresh'] required
terminal_result_available StrictBool required
result_reference ChildSessionResultReference | None None
ChildSessionContextEntry.validate_identity(value: str, info: Any) -> str
ChildSessionContextEntry.validate_terminal_result() -> ChildSessionContextEntry

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ChildSessionContextOccurrence

Bases: BaseModel.

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
id str Field(max_length=CHILD_SESSION_PUBLIC_OCCURRENCE_ID_MAX_CHARS)
source ChildSessionLifecycleOccurrenceSource required
source_type str Field(max_length=_PUBLIC_SOURCE_TYPE_MAX_CHARS)
source_sequence StrictInt | None Field(default=None, ge=1)
ChildSessionContextOccurrence.validate_occurrence_id(value: str) -> str
ChildSessionContextOccurrence.validate_identity(value: str, info: Any) -> str

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ChildSessionContextProjection

One versioned, bounded, secret-free model-facing projection.

Bases: BaseModel.

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['cayu.child-session-context.v1'] CHILD_SESSION_CONTEXT_PROJECTION_VERSION
parent_session_id str Field(max_length=CHILD_SESSION_PUBLIC_ALIAS_MAX_CHARS)
consumption_scope Literal['parent_session_instance'] 'parent_session_instance'
entries tuple[ChildSessionContextEntry, ...] ()
coverage ChildSessionContextCoverage required
authority_notice Literal['notification and retrieval references do not grant tools, workspace, credentials, budgets, or external effects'] 'notification and retrieval references do not grant tools, workspace, credentials, budgets, or external effects'
ChildSessionContextProjection.validate_parent_session_id(value: str) -> str
ChildSessionContextProjection.copy_entries(value: Any) -> tuple[ChildSessionContextEntry, ...]
ChildSessionContextProjection.validate_projection() -> ChildSessionContextProjection

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ChildSessionContextTruncationReason

Bases: StrEnum.

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
CHILD_INSPECTION_LIMIT class attribute 'child_inspection_limit'
ENTRY_LIMIT class attribute 'entry_limit'
PROJECTION_BYTE_LIMIT class attribute 'projection_byte_limit'
SOURCE_OCCURRENCE_UNAVAILABLE class attribute 'source_occurrence_unavailable'

Release source · Runtime guarantees · Capability guides

from cayu.sessions import ChildSessionResultReference

Public, non-authorizing locator for a separately authorized bounded read.

Bases: BaseModel.

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['cayu.child-session-result-reference.v1'] CHILD_SESSION_RESULT_REFERENCE_VERSION
resolver Literal['child_session_result'] 'child_session_result'
child_session_id str Field(max_length=CHILD_SESSION_PUBLIC_ALIAS_MAX_CHARS)
terminal_occurrence_id str Field(max_length=CHILD_SESSION_PUBLIC_OCCURRENCE_ID_MAX_CHARS)
ChildSessionResultReference.validate_child_session_id(value: str) -> str
ChildSessionResultReference.validate_terminal_occurrence_id(value: str) -> str

Release source · Runtime guarantees · Capability guides