cadrumo.adapters.persistence.profile.m036_lifecycle module

Persistence adapters for the Modelo 036 declaration lifecycle capability.

The application service speaks only the focused M036 lifecycle ports. This module binds those ports to the existing secure-object and bucket-event repositories, translating storage failures and keeping envelope, namespace, and object-store details outside the application boundary.

class M036DeclarationRepositoryAdapter(*, repository)[source]

Bases: M036DeclarationRepositoryPort

Translate the generic secure snapshot repository to the M036 port.

Parameters:

repository (SecureSnapshotRepository[M036DeclarationResult])

exists(declaration_id)[source]

Report declaration presence without exposing storage failures.

Return type:

bool

Parameters:

declaration_id (str)

load(declaration_id)[source]

Load one declaration by full id while preserving lookup errors.

Return type:

M036DeclarationResult

Parameters:

declaration_id (str)

list_snapshots()[source]

List declarations while translating malformed storage failures.

Return type:

tuple[M036DeclarationResult, ...]

resolve(declaration_id)[source]

Resolve one full id or unique prefix while hiding adapter errors.

Return type:

M036DeclarationResult

Parameters:

declaration_id (str)

save(declaration)[source]

Persist one declaration through the secure-object repository.

Return type:

None

Parameters:

declaration (M036DeclarationResult)

save_with_secure_object_writes(declaration, extra_writes)[source]

Commit a declaration and its related secure writes atomically.

Return type:

None

Parameters:
build_m036_lifecycle_ports(*, bucket_id)[source]

Bind secure declaration and event repositories for one profile bucket.

Return type:

M036LifecyclePorts

Parameters:

bucket_id (str)