cayu.knowledge.changes
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.
KnowledgeChange
Section titled “KnowledgeChange”from cayu.storage import KnowledgeChangeMetadata-only canonical knowledge mutation published in commit order.
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 |
|---|---|---|
id |
str |
required |
sequence |
int |
required |
kind |
KnowledgeChangeKind |
required |
entry_id |
str |
required |
entry_revision |
int |
required |
committed_at |
datetime |
required |
operation_id |
str | None |
None |
relation_id |
str | None |
None |
validate_identity (method)
Section titled “validate_identity (method)”KnowledgeChange.validate_identity(value: str | None, info) -> str | Nonevalidate_relation_id (method)
Section titled “validate_relation_id (method)”KnowledgeChange.validate_relation_id(value: str | None) -> str | Nonevalidate_entry_id (method)
Section titled “validate_entry_id (method)”KnowledgeChange.validate_entry_id(value: str) -> strvalidate_sequence (method)
Section titled “validate_sequence (method)”KnowledgeChange.validate_sequence(value: int) -> intvalidate_entry_revision (method)
Section titled “validate_entry_revision (method)”KnowledgeChange.validate_entry_revision(value: int) -> intvalidate_committed_at (method)
Section titled “validate_committed_at (method)”KnowledgeChange.validate_committed_at(value: datetime) -> datetimevalidate_relation_change (method)
Section titled “validate_relation_change (method)”KnowledgeChange.validate_relation_change() -> KnowledgeChangeRelease source · Runtime guarantees · Capability guides
KnowledgeChangeBatch
Section titled “KnowledgeChangeBatch”from cayu.storage import KnowledgeChangeBatchOne bounded ordered change page and its captured accessible high-water mark.
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 |
|---|---|---|
changes |
list[KnowledgeChange] |
Field(default_factory=list) |
after_sequence |
int |
0 |
next_after_sequence |
int |
0 |
high_water_sequence |
int |
0 |
truncated |
bool |
False |
limit |
int |
required |
copy_changes (method)
Section titled “copy_changes (method)”KnowledgeChangeBatch.copy_changes(value) -> list[KnowledgeChange]validate_sequences (method)
Section titled “validate_sequences (method)”KnowledgeChangeBatch.validate_sequences(value: int, info) -> intvalidate_limit (method)
Section titled “validate_limit (method)”KnowledgeChangeBatch.validate_limit(value: int) -> intvalidate_truncated (method)
Section titled “validate_truncated (method)”KnowledgeChangeBatch.validate_truncated(value) -> boolvalidate_page (method)
Section titled “validate_page (method)”KnowledgeChangeBatch.validate_page() -> KnowledgeChangeBatchRelease source · Runtime guarantees · Capability guides
KnowledgeChangeClaim
Section titled “KnowledgeChangeClaim”from cayu.storage import KnowledgeChangeClaimOne fenced at-least-once lease over an ordered knowledge change.
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 |
|---|---|---|
consumer_id |
str |
required |
worker_id |
str |
required |
claim_id |
str |
required |
change |
KnowledgeChange |
required |
attempt |
int |
required |
claimed_at |
datetime |
required |
lease_expires_at |
datetime |
required |
validate_identity (method)
Section titled “validate_identity (method)”KnowledgeChangeClaim.validate_identity(value: str, info) -> strcopy_change (method)
Section titled “copy_change (method)”KnowledgeChangeClaim.copy_change(value: KnowledgeChange) -> KnowledgeChangevalidate_attempt (method)
Section titled “validate_attempt (method)”KnowledgeChangeClaim.validate_attempt(value: int) -> intvalidate_datetime (method)
Section titled “validate_datetime (method)”KnowledgeChangeClaim.validate_datetime(value: datetime, info) -> datetimevalidate_lease_window (method)
Section titled “validate_lease_window (method)”KnowledgeChangeClaim.validate_lease_window() -> KnowledgeChangeClaimRelease source · Runtime guarantees · Capability guides
KnowledgeChangeConsumerConflict
Section titled “KnowledgeChangeConsumerConflict”from cayu.storage import KnowledgeChangeConsumerConflictA knowledge-change consumer or lease fence conflicts with durable state.
Bases: RuntimeError.
init (method)
Section titled “init (method)”KnowledgeChangeConsumerConflict.__init__(reason: str) -> NoneRelease source · Runtime guarantees · Capability guides
KnowledgeChangeConsumerState
Section titled “KnowledgeChangeConsumerState”from cayu.storage import KnowledgeChangeConsumerStateDurable cursor and active lease state for one scope-bound consumer.
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 |
|---|---|---|
consumer_id |
str |
required |
access_scope_sha256 |
str |
required |
cursor_sequence |
int |
0 |
pending_change_sequence |
int | None |
None |
pending_claim_id |
str | None |
None |
pending_worker_id |
str | None |
None |
pending_attempt |
int |
0 |
claimed_at |
datetime | None |
None |
lease_expires_at |
datetime | None |
None |
last_acknowledged_claim_id |
str | None |
None |
updated_at |
datetime |
required |
validate_identity (method)
Section titled “validate_identity (method)”KnowledgeChangeConsumerState.validate_identity(value: str | None, info) -> str | Nonevalidate_scope_digest (method)
Section titled “validate_scope_digest (method)”KnowledgeChangeConsumerState.validate_scope_digest(value: str) -> strvalidate_cursor (method)
Section titled “validate_cursor (method)”KnowledgeChangeConsumerState.validate_cursor(value: int) -> intvalidate_pending_sequence (method)
Section titled “validate_pending_sequence (method)”KnowledgeChangeConsumerState.validate_pending_sequence(value: int | None) -> int | Nonevalidate_pending_attempt (method)
Section titled “validate_pending_attempt (method)”KnowledgeChangeConsumerState.validate_pending_attempt(value: int) -> intvalidate_datetime (method)
Section titled “validate_datetime (method)”KnowledgeChangeConsumerState.validate_datetime(value: datetime | None, info) -> datetime | Nonevalidate_pending_lease (method)
Section titled “validate_pending_lease (method)”KnowledgeChangeConsumerState.validate_pending_lease() -> KnowledgeChangeConsumerStateRelease source · Runtime guarantees · Capability guides
KnowledgeChangeKind
Section titled “KnowledgeChangeKind”from cayu.storage import KnowledgeChangeKindBases: 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 |
|---|---|---|
CREATED |
class attribute |
'created' |
REVISION_APPENDED |
class attribute |
'revision_appended' |
STATUS_TRANSITIONED |
class attribute |
'status_transitioned' |
TOMBSTONED |
class attribute |
'tombstoned' |
HARD_DELETED |
class attribute |
'hard_deleted' |
EXPIRED |
class attribute |
'expired' |
RELATION_PUBLISHED |
class attribute |
'relation_published' |
Release source · Runtime guarantees · Capability guides
MAX_KNOWLEDGE_CHANGE_LIMIT
Section titled “MAX_KNOWLEDGE_CHANGE_LIMIT”from cayu.storage import MAX_KNOWLEDGE_CHANGE_LIMITMAX_KNOWLEDGE_CHANGE_LIMIT = 1000Release source · Runtime guarantees · Capability guides
MAX_KNOWLEDGE_CHANGE_SEQUENCE
Section titled “MAX_KNOWLEDGE_CHANGE_SEQUENCE”from cayu.storage import MAX_KNOWLEDGE_CHANGE_SEQUENCEMAX_KNOWLEDGE_CHANGE_SEQUENCE = 2 ** 63 - 1