Skip to content

cayu.memory.attribution

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.memory import MEMORY_ATTRIBUTION_VERSION
MEMORY_ATTRIBUTION_VERSION = 'cayu.memory_attribution.v1'

Release source · Runtime guarantees · Capability guides

from cayu.memory import MemoryAttribution

Versioned bounded projection of one session’s durable memory-use truth.

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.memory_attribution.v1'] MEMORY_ATTRIBUTION_VERSION
status MemoryAttributionStatus required
truncated StrictBool required
reason MemoryAttributionUnavailableReason | None None
observed_receipt_count StrictInt Field(ge=0, le=MEMORY_ATTRIBUTION_HARD_MAX_RECEIPTS)
observed_exposure_count StrictInt Field(ge=0, le=MEMORY_ATTRIBUTION_HARD_MAX_EXPOSURES)
observed_item_count StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
omitted_receipt_count_at_least StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
omitted_exposure_count_at_least StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
omitted_item_count_at_least StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
receipts tuple[MemoryRecallAttribution, ...] Field(default=(), max_length=MEMORY_ATTRIBUTION_HARD_MAX_RECEIPTS)
exposures tuple[MemoryContextExposureAttribution, ...] Field(default=(), max_length=MEMORY_ATTRIBUTION_HARD_MAX_EXPOSURES)
MemoryAttribution.validate_state() -> Self

Release source · Runtime guarantees · Capability guides

from cayu.memory import MemoryAttributionBounds

Global bounds shared by every session in one evidence capture.

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
max_receipts StrictInt Field(default=MEMORY_ATTRIBUTION_DEFAULT_MAX_RECEIPTS, ge=1, le=MEMORY_ATTRIBUTION_HARD_MAX_RECEIPTS)
max_exposures StrictInt Field(default=MEMORY_ATTRIBUTION_DEFAULT_MAX_EXPOSURES, ge=1, le=MEMORY_ATTRIBUTION_HARD_MAX_EXPOSURES)
max_items StrictInt Field(default=MEMORY_ATTRIBUTION_DEFAULT_MAX_ITEMS, ge=1, le=MEMORY_ATTRIBUTION_HARD_MAX_ITEMS)
max_source_bytes StrictInt Field(default=MEMORY_ATTRIBUTION_DEFAULT_MAX_SOURCE_BYTES, ge=1, le=MEMORY_ATTRIBUTION_HARD_MAX_SOURCE_BYTES)
max_projection_bytes StrictInt Field(default=MEMORY_ATTRIBUTION_DEFAULT_MAX_PROJECTION_BYTES, ge=1, le=MEMORY_ATTRIBUTION_HARD_MAX_PROJECTION_BYTES)

Release source · Runtime guarantees · Capability guides

from cayu.memory import MemoryAttributionStatus

Trust state of one session’s projected memory evidence.

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'
REDACTED class attribute 'redacted'
CONTRADICTORY class attribute 'contradictory'

Release source · Runtime guarantees · Capability guides

from cayu.memory import MemoryAttributionUnavailableReason

Stable reason memory attribution could not be represented.

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
STORE_UNSUPPORTED class attribute 'store_unsupported'
EVIDENCE_READ_FAILED class attribute 'evidence_read_failed'
ALIAS_KEY_UNAVAILABLE class attribute 'alias_key_unavailable'
CONTRADICTORY_EVIDENCE class attribute 'contradictory_evidence'

Release source · Runtime guarantees · Capability guides

from cayu.memory import MemoryContextExposureAttribution

Secret-free structural and lifecycle facts from one context exposure.

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
exposure_alias MemoryEvidenceAlias required
interaction_alias MemoryEvidenceAlias required
projection_ordinal StrictInt Field(ge=0, lt=MEMORY_ATTRIBUTION_HARD_MAX_EXPOSURES)
model_step_id str Field(max_length=MAX_MEMORY_EVIDENCE_ID_CHARS)
model_attempt_id str Field(max_length=MAX_MEMORY_EVIDENCE_ID_CHARS)
provider_attempt_id str Field(max_length=MAX_MEMORY_EVIDENCE_ID_CHARS)
created_at datetime required
updated_at datetime required
state ContextExposureState required
state_revision StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
provider_exposure_proven StrictBool required
receipt_aliases tuple[MemoryEvidenceAlias, ...] Field(default=(), max_length=MAX_CONTEXT_EXPOSURE_RECEIPTS)
contributor_count StrictInt Field(ge=0, le=MAX_CONTEXT_EXPOSURE_CONTRIBUTORS)
transitions tuple[MemoryExposureTransitionAttribution, ...] Field(default=(), max_length=MAX_CONTEXT_EXPOSURE_TRANSITIONS)
items tuple[MemoryExposureItemAttribution, ...] Field(default=(), max_length=MAX_RECALL_RECEIPT_ITEMS)
items_truncated StrictBool False
omitted_item_count_at_least StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
MemoryContextExposureAttribution.validate_attempt_ids(value: str, info: Any) -> str
MemoryContextExposureAttribution.normalize_timestamps(value: datetime, info: Any) -> datetime
MemoryContextExposureAttribution.validate_structure() -> Self

Release source · Runtime guarantees · Capability guides

from cayu.memory import MemoryEvidenceAlias

A domain- and session-scoped HMAC alias for a private durable identity.

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
algorithm Literal['hmac-sha256'] 'hmac-sha256'
key_id str Field(max_length=64)
kind Literal['receipt', 'exposure', 'item', 'interaction'] required
digest str Field(min_length=64, max_length=64)
MemoryEvidenceAlias.validate_key_id(value: str) -> str
MemoryEvidenceAlias.validate_digest(value: str) -> str

Release source · Runtime guarantees · Capability guides

from cayu.memory import MemoryExposureItemAttribution

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
item_alias MemoryEvidenceAlias required
receipt_alias MemoryEvidenceAlias required
ordinal StrictInt Field(ge=0, lt=MAX_RECALL_RECEIPT_ITEMS)
receipt_item_ordinal StrictInt Field(ge=0, lt=MAX_RECALL_RECEIPT_ITEMS)
admission RecallItemAdmission required
selection_reason RecallItemSelectionReason required
MemoryExposureItemAttribution.validate_structure() -> Self

Release source · Runtime guarantees · Capability guides

from cayu.memory import MemoryExposureTransitionAttribution

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
revision StrictInt Field(ge=0, lt=MAX_CONTEXT_EXPOSURE_TRANSITIONS)
state ContextExposureState required
occurred_at datetime required
evidence_kind ContextExposureEvidenceKind required
MemoryExposureTransitionAttribution.normalize_occurred_at(value: datetime) -> datetime
MemoryExposureTransitionAttribution.validate_evidence_kind() -> Self

Release source · Runtime guarantees · Capability guides

from cayu.memory import MemoryRecallAttribution

Secret-free structural facts from one recall receipt.

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
receipt_alias MemoryEvidenceAlias required
interaction_alias MemoryEvidenceAlias required
projection_ordinal StrictInt Field(ge=0, lt=MEMORY_ATTRIBUTION_HARD_MAX_RECEIPTS)
model_step_id str Field(max_length=MAX_MEMORY_EVIDENCE_ID_CHARS)
created_at datetime required
inspected_count StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
eligible_count StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
admitted_count StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
offered_count StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
silent_count StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
omitted_count StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
complete_source_count StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
partial_source_count StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
unavailable_source_count StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
failed_source_count StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
truncated StrictBool required
items tuple[MemoryRecallItemAttribution, ...] Field(default=(), max_length=MAX_RECALL_RECEIPT_ITEMS)
items_truncated StrictBool False
omitted_item_count_at_least StrictInt Field(ge=0, le=MAX_DURABLE_JSON_INTEGER)
MemoryRecallAttribution.validate_model_step_id(value: str) -> str
MemoryRecallAttribution.normalize_created_at(value: datetime) -> datetime
MemoryRecallAttribution.validate_structure() -> Self

Release source · Runtime guarantees · Capability guides

from cayu.memory import MemoryRecallItemAttribution

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
item_alias MemoryEvidenceAlias required
ordinal StrictInt Field(ge=0, lt=MAX_RECALL_RECEIPT_ITEMS)
admission RecallItemAdmission required
selection_reason RecallItemSelectionReason required
MemoryRecallItemAttribution.validate_structure() -> Self

Release source · Runtime guarantees · Capability guides