cadrumo.core.identity.profile module

Profile UUID identity for the per-operator profile aggregate.

The profile identity is the immutable handle the bucket directory, the keystore directory, the secure-object key, and the active-profile pointer all key on. Promoting the alias to cadrumo.core.identity lets every consumer — adapters, persistence, application services, the CLI surface — import it without crossing a sibling-domain boundary.

Profile identities are minted as canonical UUIDv4 strings via cadrumo.domain.user_profile.values.new_profile_id(). Operator labels resolve to profile UUIDs through the application profile resolver before they reach this identity boundary.

canonical_profile_bucket_id(profile_id)[source]

Return the canonical bucket-identity spelling of profile_id.

The profile aggregate keys its bucket directory on the canonical profile UUID; this states the bridge from either spelling of that identity — the canonical string or a uuid.UUID object — to the one canonical string every persisted address composes on. It is the named counterpart of cadrumo.core.identity.bucket.canonical_bucket_id(), on the profile side of the boundary: where that function states a bucket identity, this one states a profile identity that is about to BECOME a bucket address.

Parameters:

profile_id (str | UUID) – A profile identity in either of its two spellings.

Return type:

str

Returns:

The canonical lowercase-hyphenated UUIDv4 string.

Raises:

ValueError – When the value is not a canonical profile identity. Deliberately the plain builtin: each caller translates it into its own typed refusal, so the shared helper does not impose one surface’s error class on every other.