cadrumo.application.user_profile.keys_validation module

Profile-key-catalogue validation projection used by the CLI status surface.

The wizard catalogue (application/wizard/catalogue.py) declares each WizardQuestion.profile_key as a canonical schema-TOML path (for example, identity.tax_id and preferences.output_language). The application profile-key catalogue compiles those declarations into ProfileKey records. The helpers in this module project a flat operator-supplied Mapping[str, str] over that catalogue and report which required keys are missing or set so the CLI status surface can render a deterministic readiness summary.

These helpers are intentionally projection-only: they do not read or write secure storage, do not touch WorkflowState, and do not depend on any CLI state. The flat-dict input is produced by application.user_profile.projections.record_to_values() or by the wizard runner’s canonical projection.

class ProfileValidationResult(**data)[source]

Bases: BaseModel

Typed result of validate_profile_values().

Parameters:

data (Any)

valid: bool
missing_required: tuple[str, ...]
present_required: tuple[str, ...]
present_optional: tuple[str, ...]
unknown_keys: tuple[str, ...]
present_keys: int
total_keys: int
validate_profile_values(values, *, operation)[source]

Validate values against the application profile-key catalogue.

values is keyed by canonical schema path (identity.tax_id, preferences.output_language etc.).

Return type:

ProfileValidationResult

Returns:

A typed validation result carrying missing, present, and unknown paths.

Parameters: