Runtime¶
ActionRuntime coordinates the lifecycle. Its public methods are async and
always require an explicit typed action definition.
runtime ¶
Framework-neutral confirm-first action orchestration.
ActionRuntime ¶
ActionRuntime(*, store: ActionStore, retention_store: RetentionStore | None = None, clock: Clock | None = None, identifiers: IdentifierProvider | None = None, event_sink: EventSink | None = None, runtime_revision: str | None = None)
Coordinates host-owned controls without owning host business truth.
prepare
async
¶
prepare(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT], *, tenant_reference: str, command: CommandT, requesting_principal: RequestingPrincipal, proposing_agent: ProposingAgent | None = None) -> ActionOperationResult
record_authority
async
¶
record_authority(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT], *, evidence: AuthorityEvidence, authenticated_authority: ConfirmingAuthority, proposal_reference: str | None = None) -> ActionOperationResult
expire_due
async
¶
expire_due(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT], *, tenant_reference: str, proposal_reference: str) -> ActionOperationResult
Expire an unexecuted proposal once its prepared lifetime has elapsed.
execute
async
¶
execute(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT], *, tenant_reference: str, proposal_reference: str) -> ActionOperationResult
reconcile
async
¶
reconcile(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT], *, tenant_reference: str, proposal_reference: str) -> ActionOperationResult
read
async
¶
read(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT], *, proposal_reference: str, context: ReadContext) -> ProposalView
erase
async
¶
erase(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT], *, proposal_reference: str, context: ReadContext) -> ActionOperationResult
ActionOperationResult ¶
Bases: ExperimentalModel
display_preview
class-attribute
instance-attribute
¶
fresh_proposal_reference
class-attribute
instance-attribute
¶
fresh_proposal_reference: SafeReference | None = None
is_terminal
property
¶
Whether the proposal lifecycle has no valid transition left.
needs_reconciliation
property
¶
Whether authoritative reconciliation may advance this proposal.
ProposalView ¶
Bases: ExperimentalModel
OperationOutcome ¶
RuntimeReasonCode ¶
Bases: StrEnum
Reason codes generated by the runtime; hosts may still return their own.
PRIVATE_SNAPSHOT_UNAVAILABLE
class-attribute
instance-attribute
¶
PROPOSAL_COMMITMENT_UNAVAILABLE
class-attribute
instance-attribute
¶
AUTHORITY_NO_LONGER_SATISFIED
class-attribute
instance-attribute
¶
REAUTHORIZATION_FAILED
class-attribute
instance-attribute
¶
VERIFICATION_RETRIES_EXHAUSTED
class-attribute
instance-attribute
¶
PARTIAL_NOT_DECLARED
class-attribute
instance-attribute
¶
VERIFIED_TERMINAL_FAILURE
class-attribute
instance-attribute
¶
AUTHORITATIVE_FINAL_ABSENCE
class-attribute
instance-attribute
¶
SystemClock ¶
Production default that returns the current timezone-aware UTC time.
UuidIdentifiers ¶
Production default that creates opaque, cryptographically random references.
AuthorizationDeniedError ¶
Bases: PermissionError
InvalidAuthorityEvidenceError ¶
Bases: ValueError
InvalidActionResultError ¶
Bases: RuntimeError
RetentionStoreUnavailableError ¶
Bases: RuntimeError