cadrumo.core.operations module¶
Closed, frontend-neutral axes for supervised application operations.
- class OperationLifecycle(*values)[source]¶
Bases:
StrEnumGlobal position of an operation before, during, and after execution.
- CREATED¶
- QUEUED¶
- RUNNING¶
- WAITING_FOR_INTERACTION¶
- WAITING_FOR_EXTERNAL¶
- CANCELLATION_REQUESTED¶
- SETTLING¶
- TERMINAL¶
- LIFECYCLES_BEFORE_ANY_CANCELLATION_REQUEST: frozenset[OperationLifecycle]¶
Lifecycle stages an operation can only be in before any cancellation request has been made.
Requesting cancellation is an irreversible, immediate lifecycle transition: the moment a cancellation is requested, the operation moves to
CANCELLATION_REQUESTEDand can never return to one of these five stages. So a recorded cancellation-request fact is inconsistent with the lifecycle still sitting in this set – if a request exists, the lifecycle must already beCANCELLATION_REQUESTED,SETTLING, orTERMINAL.The complement is NOT “the states cancellation causes” –
SETTLINGandTERMINALare reached by every operation, cancelled or not. It is only the states a recorded cancellation-request fact remains CONSISTENT with, because the forward-only transition already ruled out coming back here.
- LIFECYCLES_BEFORE_EXECUTOR_ENTRY: frozenset[OperationLifecycle]¶
Lifecycle stages an operation occupies before its executor can have entered.
An operation in one of these two stages has not been handed to an executor, so it cannot have recorded an
executor_entered_atinstant.This set is NOT interchangeable with
executor_entered_at is None, and the direction matters. The persisted-snapshot validator enforces one implication only – a recorded entry instant means the lifecycle has already left this set – so this set is strictly NARROWER than “no entry recorded”. The converse does not hold: an operation can sit outside these stages with no entry instant, which is exactly the pre-entryTERMINALcase the journal validates separately. Swapping one condition for the other therefore changes behaviour, and a caller must pick the one it means: this set asks “has it been handed to an executor yet”, the field asks “did an executor ever enter”.
- class OperationTerminalCondition(*values)[source]¶
Bases:
StrEnumReason an operation reached its settled terminal lifecycle.
- SUCCEEDED¶
- REFUSED¶
- FAILED¶
- CANCELLED¶
- TIMED_OUT¶
- INTERRUPTED¶
- class OperationEffect(*values)[source]¶
Bases:
StrEnumAuthoritative extent of committed effect, independent of terminal condition.
- NONE¶
- UPDATED¶
- PARTIAL¶
- UNKNOWN¶
- EFFECTS_WITHOUT_PARTIAL_COMMIT: frozenset[OperationEffect]¶
Effects declarable by an operation that either does nothing, fully applies, or leaves an unknown extent, but never a partially-applied one.
OperationEffect.PARTIALis excluded deliberately: an operation whose sub-steps can fail independently and leave only some of them committed declaresPARTIALexplicitly in its ownpermitted_effectsinstead of using this set. Seecadrumo.application.live.filed_history_operation, whose replay operation returnsOperationEffect.PARTIALwhen some sub-operations fail, for the contrasting case.
- class OperationDurability(*values)[source]¶
Bases:
StrEnumPersistence and recovery guarantee declared by an operation definition.
- EPHEMERAL¶
- RECORDED¶
- RESUMABLE¶
- class OperationCancellation(*values)[source]¶
Bases:
StrEnumCancellation mechanism an operation can truthfully support.
- UNSUPPORTED¶
- COOPERATIVE¶
- CONTAINED¶
- class OperationDeadline(*values)[source]¶
Bases:
StrEnumAggregate deadline guarantee declared by an operation definition.
- ABSENT¶
- COOPERATIVE¶
- ENFORCED¶
- class OperationClosePolicy(*values)[source]¶
Bases:
StrEnumFrontend close behavior projected from operation policy.
- DETACH_ALLOWED¶
- REQUEST_CANCEL¶
- BLOCK_UNTIL_SETTLED¶
- class OperationEventKind(*values)[source]¶
Bases:
StrEnumClosed families of ordered, safe operation events.
- PHASE¶
- PROGRESS¶
- LOG¶
- EFFECT¶
- NOTICE¶
- RECONCILIATION¶
- DIAGNOSTIC¶
- INTERACTION¶
- TERMINAL¶
- class OperationInteractionKind(*values)[source]¶
Bases:
StrEnumClosed presentation families for typed operator interaction.
- INPUT¶
- CHOICE¶
- REVIEW¶
- APPLY¶
- REJECT¶
- profile_operation_subject(profile_id)[source]¶
Return the operation subject naming one profile.
The
profile:prefix is the wire form other subjects are distinguished from, so it is spelled once. Three modules each formatted it inline, which meant three places had to agree on a string that nothing validated.