cadrumo.application.workflow.active_profile module

Canonical active-profile selection and record-resolution contracts.

Workflow state is an encrypted record and must not become a second import surface for the process-wide active-profile selector. This module owns the translation from that core selector to a committed capsule and its authenticated profile record.

Core types: UserProfileRecord.

class ActiveProfileRecordResolution(record=None, unavailability=None)[source]

Bases: object

One active-profile record read, together with why it produced nothing.

Exactly one of record and unavailability is populated. The dataclass never crosses a serialization boundary, so it deliberately avoids eagerly importing the domain profile model at module import time.

Parameters:
record: UserProfileRecord | None
unavailability: ProfileRecordUnavailability | None
active_profile_selection()[source]

Return the raw active selector and its canonical live bucket UUID.

Return type:

tuple[str | None, str | None]

require_active_profile_bucket_id()[source]

Return the selected committed bucket or raise the canonical refusal.

Return type:

str

resolve_active_profile_record(*, profile_decode_context)[source]

Read the active profile record and name the reason when it is absent.

Return type:

ActiveProfileRecordResolution

Parameters:

profile_decode_context (ProfileDecodeContext)

active_transaction_catalogue_repository(*, repository_factory)[source]

Compose the active bucket’s transaction catalogue through an outward factory.

Return type:

TypeVar(RepositoryT, bound= TransactionCatalogueRepositoryProtocol)

Parameters:

repository_factory (Callable[[str], RepositoryT])