cadrumo.application.profile_preconditions module¶
Application-owned profile and taxpayer precondition verdicts.
The shared CLI boundary observes profile-selection, session, and filing facts,
but it does not decide what those facts mean. This module owns that policy:
each failed condition becomes a strict PreconditionVerdict referencing
one canonical operator action or an explicit no-recovery outcome.
The records contain no localized text and no executable CLI strings. Human rendering and live command-schema projection remain entrypoint concerns.
- class ProfilePreconditionCondition(*values)[source]¶
Bases:
StrEnumStable identities for shared profile and taxpayer preconditions.
- ACTIVE_PROFILE_AVAILABLE¶
- PROFILE_SELECTION_NONBLANK¶
- PROFILE_SELECTION_KNOWN¶
- PROFILE_SELECTION_UNAMBIGUOUS¶
- PROFILE_SELECTION_LIVE¶
- PROFILE_TARGET_NOT_SELECTED¶
- SESSION_LOGGED_IN¶
- SESSION_CURRENT¶
- SESSION_SCHEMA_CURRENT¶
- SESSION_WELL_FORMED¶
- SESSION_INTEGRITY_VALID¶
- TAX_ID_DECLARED¶
- FORMER_PRODUCT_STATE_ABSENT¶
- class ProfilePreconditionEvidence(*values)[source]¶
Bases:
StrEnumStable evidence identities emitted by profile precondition policy.
- ACTIVE_PROFILE_STATE¶
- PROFILE_SELECTION¶
- PROFILE_SESSION¶
- TAXPAYER_IDENTITY¶
- FORMER_PRODUCT_STATE¶
- class ProfileSelectionFailure(*values)[source]¶
Bases:
StrEnumApplication meanings for failed profile selection facts.
- BLANK¶
- UNKNOWN¶
- AMBIGUOUS¶
- INACTIVE¶
- class FormerProductDetectionScope(*values)[source]¶
Bases:
StrEnumWhere refusal-only former-product state was detected.
- ROOT_PROFILE_NORMALISATION¶
- STARTUP¶
- inspect_active_profile_precondition(*, active_profile_present, registered_profile_count)[source]¶
Return the recovery verdict when no active profile is selected.
- Return type:
- Parameters:
- inspect_filing_taxpayer_identity_precondition(*, declared_tax_id, profile_name)[source]¶
Return the profile-edit verdict when filing identity is undeclared.
- Return type:
- Parameters:
- profile_deletion_requires_logout_verdict(*, requested_profile)[source]¶
Return the outcome for deleting the profile that is currently selected.
Deletion refuses its own selected target, and closing that session is a separate operation the operator already owns. Naming it on the action channel is what lets an automated operator recover without parsing prose.
- Return type:
- Parameters:
requested_profile (str)
- profile_selection_failure_verdict(failure, *, requested_profile, lifecycle_status=None)[source]¶
Return the canonical outcome for one failed profile selection.
- Return type:
- Parameters:
failure (ProfileSelectionFailure)
requested_profile (str)
lifecycle_status (str | None)
- profile_session_failure_verdict(reason, *, profile_name)[source]¶
Return the login action for one fail-closed session-resume outcome.
- Return type:
- Parameters:
reason (ProfileSessionRefusalReason)
profile_name (str)
- former_product_state_verdict(scope)[source]¶
Return the safety refusal for state Cadrumo deliberately cannot adopt.
- Return type:
- Parameters:
scope (FormerProductDetectionScope)