Skip to content

cayu.knowledge.publication_contracts

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.storage import KnowledgePublicationConflict

An idempotent knowledge publication conflicts with durable state.

Bases: RuntimeError.

KnowledgePublicationConflict.__init__(reason: str) -> None

Release source · Runtime guarantees · Capability guides

from cayu.storage import KnowledgePublicationReceipt

Bounded immutable evidence for one atomic entry-and-chunks publication.

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
operation_id str Field(max_length=256)
entry_id str required
entry_revision int required
expected_revision int | None required
request_sha256 str required
entry_created_at datetime required
entry_updated_at datetime required
committed_at datetime required
replayed bool False
KnowledgePublicationReceipt.validate_clean_ids(value: str, info) -> str
KnowledgePublicationReceipt.validate_entry_id(value: str) -> str
KnowledgePublicationReceipt.validate_request_sha256(value: str) -> str
KnowledgePublicationReceipt.validate_entry_revision(value: int) -> int
KnowledgePublicationReceipt.validate_expected_revision(value: int | None) -> int | None
KnowledgePublicationReceipt.validate_revision_transition() -> KnowledgePublicationReceipt
KnowledgePublicationReceipt.validate_receipt_datetime(value: datetime, info) -> datetime
KnowledgePublicationReceipt.validate_replayed(value: bool) -> bool
KnowledgePublicationReceipt.validate_entry_timestamp_order() -> KnowledgePublicationReceipt

Release source · Runtime guarantees · Capability guides

from cayu.storage import prepare_knowledge_publication

Copy and bind one complete revision-publication authority tuple.

prepare_knowledge_publication(entry: KnowledgeEntry, chunks: list[KnowledgeChunk], *, evidence: list[KnowledgeEvidence] | None=None, operation_id: str, expected_revision: int | None=None, activation_authority: KnowledgeActivationAuthority | None=None) -> tuple[str, KnowledgeEntry, list[KnowledgeChunk], list[KnowledgeEvidence], str]

Release source · Runtime guarantees · Capability guides