cadrumo.adapters.persistence.profile.translated_bucket_event_history module

Bucket-event history exposed through an application-owned failure contract.

Several declaration lifecycles commit their bucket events beside their own records. Each binds the same encrypted history repository to the application port and differs only in which application error a storage failure becomes, so the binding is written once and the translation is supplied by the caller.

class AdapterFailureTranslator(*args, **kwargs)[source]

Bases: Protocol

Run one adapter operation, re-raising storage failures as an application error.

class TranslatedBucketEventHistoryRepository(*, repository, translate)[source]

Bases: BucketEventHistoryRepositoryProtocol

Translate bucket-event persistence to one application contract.

Parameters:
exists()[source]

Report event-history presence without exposing storage failures.

Return type:

bool

load()[source]

Load event history through the application-facing port.

Return type:

BucketEventHistoryCatalogue

load_revisioned()[source]

Load event history together with its optimistic-concurrency revision.

Return type:

tuple[BucketEventHistoryCatalogue, str]

save(catalogue)[source]

Persist event history while translating storage failures.

Return type:

None

Parameters:

catalogue (BucketEventHistoryCatalogue)

to_secure_object_write(catalogue, *, expected_revision_id=None)[source]

Prepare an event-history secure write for an atomic commit.

Return type:

SecureObjectWrite

Parameters: