cayu.runtime.session_closure
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.
ArtifactSessionClosureStore
Section titled “ArtifactSessionClosureStore”from cayu import ArtifactSessionClosureStoreBounded adapter for one registered session-scoped artifact store.
init (method)
Section titled “init (method)”ArtifactSessionClosureStore.__init__(store: Any) -> Noneclaim_session_closure (method)
Section titled “claim_session_closure (method)”async ArtifactSessionClosureStore.claim_session_closure(session_id, policy, plan_id)inspect_session_closure (method)
Section titled “inspect_session_closure (method)”async ArtifactSessionClosureStore.inspect_session_closure(session_id: str, *, policy: SessionClosurePolicy)erase_session_closure (method)
Section titled “erase_session_closure (method)”async ArtifactSessionClosureStore.erase_session_closure(session_id: str, *, policy: SessionClosurePolicy, plan_id: str)export_session_closure (method)
Section titled “export_session_closure (method)”async ArtifactSessionClosureStore.export_session_closure(session_id: str, *, policy: SessionClosurePolicy)Release source · Runtime guarantees · Capability guides
SessionClosureBudgetDisposition
Section titled “SessionClosureBudgetDisposition”from cayu import SessionClosureBudgetDispositionBases: StrEnum.
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 |
|---|---|---|
RETAIN |
class attribute |
'retain' |
Release source · Runtime guarantees · Capability guides
SessionClosureChildPolicy
Section titled “SessionClosureChildPolicy”from cayu import SessionClosureChildPolicyBases: StrEnum.
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 |
|---|---|---|
REJECT |
class attribute |
'reject' |
DETACH |
class attribute |
'detach' |
RECURSIVE |
class attribute |
'recursive' |
Release source · Runtime guarantees · Capability guides
SessionClosureCoordinator
Section titled “SessionClosureCoordinator”from cayu import SessionClosureCoordinatorCoordinate independent closure adapters without pretending atomicity.
init (method)
Section titled “init (method)”SessionClosureCoordinator.__init__(session_store: Any, *, dependent_stores: tuple[SessionClosureStore, ...]=(), clock: Any=datetime.now, secret_redactor: SecretRedactor | None=None) -> Noneinspect (method)
Section titled “inspect (method)”async SessionClosureCoordinator.inspect(session_id: str, *, policy: SessionClosurePolicy | None=None) -> SessionClosureManifestBuild a bounded inventory; unsupported adapters remain visible.
erase (method)
Section titled “erase (method)”async SessionClosureCoordinator.erase(session_id: str, *, policy: SessionClosurePolicy | None=None, expected_plan_id: str | None=None) -> SessionClosureReportvalidate (method)
Section titled “validate (method)”async SessionClosureCoordinator.validate(session_id: str, *, policy: SessionClosurePolicy | None=None)Run closure admission checks without mutating any owned resource.
export (method)
Section titled “export (method)”async SessionClosureCoordinator.export(session_id: str, *, policy: SessionClosurePolicy | None=None, allow_partial: bool=False) -> SessionClosureExportExport bounded records; incomplete diagnostic exports require explicit opt-in.
Release source · Runtime guarantees · Capability guides
SessionClosureDisposition
Section titled “SessionClosureDisposition”from cayu import SessionClosureDispositionThe authoritative disposition of one discovered record class.
Bases: StrEnum.
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 |
|---|---|---|
OWNED_ELIGIBLE |
class attribute |
'owned_eligible' |
RETAINED |
class attribute |
'retained' |
SHARED |
class attribute |
'shared' |
APPLICATION_OWNED |
class attribute |
'application_owned' |
UNSUPPORTED |
class attribute |
'unsupported' |
UNAVAILABLE |
class attribute |
'unavailable' |
TRUNCATED |
class attribute |
'truncated' |
ABSENT |
class attribute |
'absent' |
ERASED |
class attribute |
'erased' |
Release source · Runtime guarantees · Capability guides
SessionClosureExport
Section titled “SessionClosureExport”from cayu import SessionClosureExportBounded export of native records and explicitly supported dependents.
Public application export applies redaction; this is not a restorable backup.
Bases: BaseModel.
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 |
StrictInt |
SESSION_CLOSURE_SCHEMA_VERSION |
manifest |
SessionClosureManifest |
required |
content_redacted |
bool |
True |
session_records |
dict[str, Any] |
Field(default_factory=dict) |
copy_session_records (method)
Section titled “copy_session_records (method)”SessionClosureExport.copy_session_records(value: object) -> dict[str, Any]to_bytes (method)
Section titled “to_bytes (method)”SessionClosureExport.to_bytes() -> bytesRelease source · Runtime guarantees · Capability guides
SessionClosureExportIncomplete
Section titled “SessionClosureExportIncomplete”from cayu import SessionClosureExportIncompleteA normal export could not establish completeness; no record data is returned.
Bases: ValueError.
init (method)
Section titled “init (method)”SessionClosureExportIncomplete.__init__(manifest: SessionClosureManifest) -> NoneRelease source · Runtime guarantees · Capability guides
SessionClosureLineageStore
Section titled “SessionClosureLineageStore”from cayu import SessionClosureLineageStoreAtomic session-store operations required by descendant closure.
Bases: Protocol.
claim_session_closure_progress (method)
Section titled “claim_session_closure_progress (method)”async SessionClosureLineageStore.claim_session_closure_progress(progress: dict[str, Any]) -> Nonedetach_session_children (method)
Section titled “detach_session_children (method)”async SessionClosureLineageStore.detach_session_children(parent_session_id: str, child_session_ids: tuple[str, ...], *, closure_receipt: dict[str, Any]) -> tuple[dict[str, Any], ...]load_session_closure_tombstones (method)
Section titled “load_session_closure_tombstones (method)”async SessionClosureLineageStore.load_session_closure_tombstones(root_session_id: str, plan_id: str) -> tuple[dict[str, Any], ...]Release source · Runtime guarantees · Capability guides
SessionClosureManifest
Section titled “SessionClosureManifest”from cayu import SessionClosureManifestVersioned bounded inventory; records never imply unlisted erasure.
Bases: BaseModel.
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 |
StrictInt |
SESSION_CLOSURE_SCHEMA_VERSION |
session_id |
str |
Field(max_length=SESSION_CLOSURE_MAX_FIELD_CHARS) |
operation |
SessionClosureOperation |
required |
plan_id |
str |
Field(max_length=SESSION_CLOSURE_MAX_FIELD_CHARS) |
generated_at |
datetime |
required |
complete |
bool |
required |
records |
tuple[SessionClosureRecord, ...] |
Field(max_length=256) |
metadata |
dict[str, Any] |
Field(default_factory=dict) |
copy_metadata (method)
Section titled “copy_metadata (method)”SessionClosureManifest.copy_metadata(value: object) -> dict[str, Any]validate_manifest (method)
Section titled “validate_manifest (method)”SessionClosureManifest.validate_manifest() -> SessionClosureManifestRelease source · Runtime guarantees · Capability guides
SessionClosureOperation
Section titled “SessionClosureOperation”from cayu import SessionClosureOperationBases: StrEnum.
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 |
|---|---|---|
INSPECT |
class attribute |
'inspect' |
EXPORT |
class attribute |
'export' |
ERASE |
class attribute |
'erase' |
Release source · Runtime guarantees · Capability guides
SessionClosurePolicy
Section titled “SessionClosurePolicy”from cayu import SessionClosurePolicyBounded caller policy; it never silently expands store enumeration.
Bases: BaseModel.
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 |
|---|---|---|
child_policy |
SessionClosureChildPolicy |
SessionClosureChildPolicy.REJECT |
budget_disposition |
SessionClosureBudgetDisposition |
SessionClosureBudgetDisposition.RETAIN |
include_artifact_metadata |
bool |
True |
max_records |
StrictInt |
Field(default=SESSION_CLOSURE_DEFAULT_MAX_RECORDS, ge=1, le=100000) |
max_descendants |
StrictInt |
Field(default=SESSION_CLOSURE_DEFAULT_MAX_DESCENDANTS, ge=1, le=100000) |
max_bytes |
StrictInt |
Field(default=SESSION_CLOSURE_DEFAULT_MAX_BYTES, ge=1, le=256 * 1024 * 1024) |
validate_policy (method)
Section titled “validate_policy (method)”SessionClosurePolicy.validate_policy() -> SessionClosurePolicyRelease source · Runtime guarantees · Capability guides
SessionClosureProgress
Section titled “SessionClosureProgress”from cayu import SessionClosureProgressStrict durable authority for one target or recursive closure plan.
Bases: BaseModel.
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 |
StrictInt |
SESSION_CLOSURE_SCHEMA_VERSION |
root_session_id |
str |
Field(min_length=1, max_length=SESSION_CLOSURE_MAX_FIELD_CHARS) |
plan_id |
str |
Field(min_length=1, max_length=SESSION_CLOSURE_MAX_FIELD_CHARS) |
policy_digest |
str |
Field(min_length=64, max_length=64) |
max_records |
StrictInt |
Field(ge=1, le=100000) |
max_bytes |
StrictInt |
Field(ge=1, le=256 * 1024 * 1024) |
phase |
str |
Field(pattern='^(target|reject|recursive)$') |
descendants |
tuple[dict[str, str], ...] |
Field(max_length=100000) |
completed |
tuple[str, ...] |
Field(max_length=100000) |
copy_descendants (method)
Section titled “copy_descendants (method)”SessionClosureProgress.copy_descendants(value: object) -> tuple[dict[str, str], ...]copy_completed (method)
Section titled “copy_completed (method)”SessionClosureProgress.copy_completed(value: object) -> tuple[str, ...]validate_identity (method)
Section titled “validate_identity (method)”SessionClosureProgress.validate_identity() -> SessionClosureProgressRelease source · Runtime guarantees · Capability guides
SessionClosureRecord
Section titled “SessionClosureRecord”from cayu import SessionClosureRecordBases: BaseModel.
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 |
|---|---|---|
store_id |
str |
Field(max_length=SESSION_CLOSURE_MAX_FIELD_CHARS) |
record_class |
str |
Field(max_length=SESSION_CLOSURE_MAX_FIELD_CHARS) |
disposition |
SessionClosureDisposition |
required |
count |
StrictInt |
Field(default=0, ge=0) |
bytes |
StrictInt |
Field(default=0, ge=0) |
detail |
str | None |
Field(default=None, max_length=SESSION_CLOSURE_MAX_FIELD_CHARS) |
capability |
str | None |
Field(default=None, max_length=SESSION_CLOSURE_MAX_FIELD_CHARS) |
erasure_blocked |
StrictBool |
False |
Release source · Runtime guarantees · Capability guides
SessionClosureReport
Section titled “SessionClosureReport”from cayu import SessionClosureReportBases: BaseModel.
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 |
StrictInt |
SESSION_CLOSURE_SCHEMA_VERSION |
session_id |
str |
required |
plan_id |
str |
required |
operation |
SessionClosureOperation |
required |
complete |
bool |
required |
already_absent |
bool |
False |
manifest |
SessionClosureManifest |
required |
error |
str | None |
None |
Release source · Runtime guarantees · Capability guides
SessionClosureStore
Section titled “SessionClosureStore”from cayu import SessionClosureStoreOptional independent-store adapter owned by an application boundary.
Bases: Protocol.
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 |
|---|---|---|
store_id |
str |
required |
inspect_session_closure (method)
Section titled “inspect_session_closure (method)”async SessionClosureStore.inspect_session_closure(session_id: str, *, policy: SessionClosurePolicy) -> SessionClosureRecorderase_session_closure (method)
Section titled “erase_session_closure (method)”async SessionClosureStore.erase_session_closure(session_id: str, *, policy: SessionClosurePolicy, plan_id: str) -> SessionClosureRecordexport_session_closure (method)
Section titled “export_session_closure (method)”async SessionClosureStore.export_session_closure(session_id: str, *, policy: SessionClosurePolicy) -> dict[str, Any]Release source · Runtime guarantees · Capability guides
SessionEvidenceClosureStore
Section titled “SessionEvidenceClosureStore”from cayu import SessionEvidenceClosureStoreInventory #946 receipt/exposure references owned by SessionStore.
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 |
|---|---|---|
store_id |
class attribute |
'session-store-evidence' |
init (method)
Section titled “init (method)”SessionEvidenceClosureStore.__init__(store: Any) -> Noneinspect_session_closure (method)
Section titled “inspect_session_closure (method)”async SessionEvidenceClosureStore.inspect_session_closure(session_id: str, *, policy: SessionClosurePolicy)erase_session_closure (method)
Section titled “erase_session_closure (method)”async SessionEvidenceClosureStore.erase_session_closure(session_id: str, *, policy: SessionClosurePolicy, plan_id: str)export_session_closure (method)
Section titled “export_session_closure (method)”async SessionEvidenceClosureStore.export_session_closure(session_id: str, *, policy: SessionClosurePolicy)Release source · Runtime guarantees · Capability guides
SharedSessionClosureStore
Section titled “SharedSessionClosureStore”from cayu import SharedSessionClosureStoreReference-only owner whose records are never session-owned.
Bases: RetainedSessionClosureStore.
init (method)
Section titled “init (method)”SharedSessionClosureStore.__init__(store_id: str, record_class: str='records') -> Noneinspect_session_closure (method)
Section titled “inspect_session_closure (method)”async SharedSessionClosureStore.inspect_session_closure(session_id: str, *, policy: SessionClosurePolicy)erase_session_closure (method)
Section titled “erase_session_closure (method)”async SharedSessionClosureStore.erase_session_closure(session_id: str, *, policy: SessionClosurePolicy, plan_id: str)export_session_closure (method)
Section titled “export_session_closure (method)”async SharedSessionClosureStore.export_session_closure(session_id: str, *, policy: SessionClosurePolicy)Release source · Runtime guarantees · Capability guides
TaskSessionClosureStore
Section titled “TaskSessionClosureStore”from cayu import TaskSessionClosureStoreBounded task-session adapter; deletion requires an explicit store seam.
init (method)
Section titled “init (method)”TaskSessionClosureStore.__init__(store: Any) -> Noneinspect_session_closure (method)
Section titled “inspect_session_closure (method)”async TaskSessionClosureStore.inspect_session_closure(session_id: str, *, policy: SessionClosurePolicy)claim_session_closure (method)
Section titled “claim_session_closure (method)”async TaskSessionClosureStore.claim_session_closure(session_id: str, *, policy: SessionClosurePolicy, plan_id: str) -> TaskSessionClosureClaimerase_session_closure (method)
Section titled “erase_session_closure (method)”async TaskSessionClosureStore.erase_session_closure(session_id: str, *, policy: SessionClosurePolicy, plan_id: str)export_session_closure (method)
Section titled “export_session_closure (method)”async TaskSessionClosureStore.export_session_closure(session_id: str, *, policy: SessionClosurePolicy)