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, proposal_reference: str | 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
resume_verification
async
¶
resume_verification(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT], *, tenant_reference: str, proposal_reference: str, expected_revision: int, operator: RecoveryOperator, intervention_reference: str) -> ActionOperationResult
Resume observation after a host operator resolves an external ambiguity.
This transition never calls the executor. It records the intervention, advances an unresolved or waiting verification state, and immediately performs one fresh authoritative observation through the action verifier.
read
async
¶
read(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT], *, proposal_reference: str, context: ReadContext) -> ProposalView
read_recovery
async
¶
read_recovery(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT], *, proposal_reference: str, context: ReadContext) -> ActionRecoveryView
Describe safe recovery options without granting authority or mutating state.
export_evidence
async
¶
export_evidence(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT], *, proposal_reference: str, context: ReadContext) -> ActionEvidenceBundle
Export one authorized, minimized proposal revision.
observation_context
async
¶
observation_context(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT], *, proposal_reference: str, context: ReadContext) -> ExecutionContext
Authorize a read-only target observation and bind it to stored identity.
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 this proposal has no reconciliation or recovery path.
automatic_processing_closed
property
¶
Whether unattended processing should stop for this proposal.
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
¶
EXECUTION_LEASE_EXPIRED
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
¶
OPERATOR_VERIFICATION_RESUMED
class-attribute
instance-attribute
¶
RECOVERY_NOT_AUTHORIZED
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