Public API¶
The supported import surface is re-exported from threvo_actions. Optional
adapter types live in their own modules so importing the core never imports a
database or agent framework.
Versioned support
Version 0.6.3 is the current supported exact root Python API and CLI.
Upgrading requires the release record's migration review. The
documented threvo_actions.experimental namespace follows its
separate 120-day evaluation window; it is intentionally absent from the
root export. Serialized interoperability forms also remain experimental.
See Versioning.
threvo_actions ¶
Experimental confirm-first financial action contracts.
CommitmentProviderPort
module-attribute
¶
CommitmentProviderPort = CommitmentProvider | ProposalBoundCommitmentProvider
ProtectionCodecPort
module-attribute
¶
ProtectionCodecPort = ProtectionCodec | ProposalBoundProtectionCodec
Participant
module-attribute
¶
Participant = Annotated[RequestingPrincipal | ProposingAgent | ConfirmingAuthority | GovernedExecutor | AuthoritativeTarget | EvidenceConsumer | RecoveryOperator, Field(discriminator='kind')]
Receipt
module-attribute
¶
Receipt = Annotated[ProposalReceipt | AuthorityReceipt | ExecutionReceipt | VerificationReceipt | RecoveryReceipt, Field(discriminator='receipt_type')]
__all__
module-attribute
¶
__all__ = ['Action', 'ActionConfigurationError', 'ActionDefinition', 'ActionNotRegisteredError', 'ActionOperationResult', 'ActionRegistry', 'ActionRecoveryView', 'ActionRuntime', 'ActionStore', 'ActionType', 'AnyApproval', 'ApprovalReasonCode', 'AuthoritativeTarget', 'AuthorityBinding', 'AuthorityDecision', 'AuthorityEvaluation', 'AuthorityEvaluatorPort', 'AuthorityEvidence', 'AuthorityReceipt', 'AuthorityReceiptStatus', 'AuthorityValidationFailure', 'AuthorityValidationResult', 'AuthorizationDeniedError', 'AuthorizationPort', 'AuthorizationResult', 'CanonicalizationError', 'Clock', 'CommitmentProvider', 'CommitmentProviderPort', 'ConfirmingAuthority', 'DecisionContext', 'DefinitionConformanceError', 'DefinitionTypeMismatchError', 'DuplicateActionError', 'EffectClaimResult', 'EffectKind', 'EventSink', 'EvidenceConsumer', 'ExecutionContext', 'ExecutionReceipt', 'ExecutionReceiptStatus', 'ExecutionResult', 'ExecutionStatus', 'ExternalReference', 'GovernedExecutor', 'GovernedExecutorPort', 'IdentifierProvider', 'InvalidActionResultError', 'InvalidAuthorityEvidenceError', 'ItemOutcome', 'ItemOutcomeStatus', 'KeyedCommitment', 'LifecycleStatus', 'MOfNApprovals', 'MemoryActionStore', 'Money', 'NoopEventSink', 'OperationOutcome', 'Participant', 'PreparationContext', 'PreparationPort', 'PreparedAction', 'ProposalAlreadyExistsError', 'ProposalNotFoundError', 'ProposalPersistenceOutcomeUnknownError', 'ProposalBoundCommitmentProvider', 'ProposalBoundProtectionCodec', 'ProposalIdentity', 'ProposalReceipt', 'ProposalReceiptStatus', 'ProposalView', 'ProposingAgent', 'ProtectedPayload', 'ProtectionCodec', 'ProtectionCodecPort', 'ReadContext', 'Receipt', 'RecoveryOperator', 'RecoveryReceipt', 'RecoveryReceiptStatus', 'RequestingPrincipal', 'ResolvedState', 'RetentionPort', 'RetentionStore', 'RetentionStoreUnavailableError', 'RuntimeAttributionError', 'RuntimeEvent', 'RuntimeEventType', 'RuntimeReasonCode', 'SingleApproval', 'StateResolverPort', 'StoreInvariantError', 'StoredProposal', 'SystemClock', 'UuidIdentifiers', 'VerificationReceipt', 'VerificationReceiptStatus', 'VerificationResult', 'VerificationStatus', 'VerifierPort', 'assert_definition_conforms', 'authority_evidence_matches_binding', 'canonicalize_v1', 'commitment_payload_v1', 'resolve_runtime_revision', 'validate_authority_evidence', 'validate_proposal_create', 'validate_proposal_update']
Action ¶
Action(*, authority_evaluator: AuthorityEvaluatorPort, commitment_provider: CommitmentProviderPort, protection_codec: ProtectionCodecPort)
Bases: ABC, Generic[CommandT, PrivateSnapshotT, PreviewT, ResultT]
Author an action as one typed object without creating a second runtime path.
Deployment services remain constructor-injected. Immutable action metadata
stays visible on the subclass. to_definition is the only bridge to the
runtime.
verification_lease_duration
class-attribute
¶
semantic_idempotency_strategy
class-attribute
¶
to_definition ¶
to_definition() -> ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT]
Compile this authoring facade to the runtime's public plumbing.
prepare
abstractmethod
async
¶
prepare(command: CommandT, *, context: PreparationContext) -> PreparedAction[PrivateSnapshotT, PreviewT]
can_prepare
abstractmethod
async
¶
can_prepare(command: CommandT, *, context: PreparationContext) -> AuthorizationResult
can_decide
abstractmethod
async
¶
can_decide(evidence: AuthorityEvidence, *, context: DecisionContext) -> AuthorizationResult
can_execute
abstractmethod
async
¶
can_execute(snapshot: PrivateSnapshotT, *, context: ExecutionContext) -> AuthorizationResult
can_recover
async
¶
can_recover(proposal_reference: str, *, context: RecoveryContext) -> AuthorizationResult
Deny operator recovery until an action explicitly authorizes it.
resolve
abstractmethod
async
¶
resolve(snapshot: PrivateSnapshotT, *, context: ExecutionContext) -> ResolvedState[PrivateSnapshotT, PreviewT]
execute
abstractmethod
async
¶
execute(snapshot: PrivateSnapshotT, *, context: ExecutionContext, execution_precondition: str) -> ExecutionResult[ResultT]
authorize_erasure
async
¶
authorize_erasure(proposal_reference: str, *, context: ReadContext) -> bool
ActionConfigurationError ¶
Bases: TypeError
Raised when an Action subclass cannot compile to ActionDefinition.
AnyApproval
dataclass
¶
AnyApproval(authorities: tuple[ConfirmingAuthority, ...])
Require one distinct authority from a declared set.
evaluate
async
¶
evaluate(*, binding: AuthorityBinding, evidence: tuple[AuthorityEvidence, ...]) -> AuthorityEvaluation
ApprovalReasonCode ¶
Bases: StrEnum
Reason codes generated by the evidence-only approval requirements.
MORE_AUTHORITY_REQUIRED
class-attribute
instance-attribute
¶
MOfNApprovals
dataclass
¶
MOfNApprovals(required: int, authorities: tuple[ConfirmingAuthority, ...])
Require approvals from a distinct M-of-N set of authorities.
evaluate
async
¶
evaluate(*, binding: AuthorityBinding, evidence: tuple[AuthorityEvidence, ...]) -> AuthorityEvaluation
SingleApproval
dataclass
¶
SingleApproval(authority: ConfirmingAuthority)
Require one specific authority after the host authorizes the decision.
evaluate
async
¶
evaluate(*, binding: AuthorityBinding, evidence: tuple[AuthorityEvidence, ...]) -> AuthorityEvaluation
RuntimeAttributionError ¶
Bases: RuntimeError
The runtime cannot identify the exact library code producing receipts.
AuthorityBinding ¶
AuthorityDecision ¶
AuthorityEvidence ¶
Bases: ExperimentalModel
A bound authority decision; it is not authorization by itself.
domain
class-attribute
instance-attribute
¶
schema_version
class-attribute
instance-attribute
¶
audience
class-attribute
instance-attribute
¶
audience: tuple[SafeReference, ...] = Field(min_length=1)
external_attestation
class-attribute
instance-attribute
¶
external_attestation: ExternalAuthorityAttestation | None = None
AuthorityValidationFailure ¶
AuthorityValidationResult ¶
Bases: ExperimentalModel
CanonicalizationError ¶
Bases: ValueError
Raised when a value cannot enter the canonical finance boundary.
CommitmentProvider ¶
Bases: Protocol
Host-owned proposal-scoped keyed commitment boundary.
Destruction must be idempotent so an interrupted erasure can resume safely.
verify
async
¶
verify(*, proposal_reference: str, canonical_payload: bytes, commitment: KeyedCommitment) -> bool
KeyedCommitment ¶
ProposalBoundCommitmentProvider ¶
Bases: Protocol
Commitment provider bound to a complete tenant-scoped proposal identity.
create_for
async
¶
create_for(*, proposal_identity: ProposalIdentity, canonical_payload: bytes) -> KeyedCommitment
verify_for
async
¶
verify_for(*, proposal_identity: ProposalIdentity, canonical_payload: bytes, commitment: KeyedCommitment) -> bool
destroy_commitment_for
async
¶
destroy_commitment_for(*, proposal_identity: ProposalIdentity, commitment: KeyedCommitment) -> None
ProposalBoundProtectionCodec ¶
Bases: Protocol
Protection codec bound to a complete tenant-scoped proposal identity.
protect_for
async
¶
protect_for(*, proposal_identity: ProposalIdentity, canonical_payload: bytes) -> ProtectedPayload
unprotect_for
async
¶
unprotect_for(*, proposal_identity: ProposalIdentity, payload: ProtectedPayload) -> bytes
destroy_payload_for
async
¶
destroy_payload_for(*, proposal_identity: ProposalIdentity, payload: ProtectedPayload) -> None
ProtectedPayload ¶
ProtectionCodec ¶
Bases: Protocol
Host-owned protection boundary for canonical private snapshots.
Destruction must be idempotent so an interrupted erasure can resume safely.
ActionType ¶
AuthoritativeTarget ¶
Bases: ExperimentalModel
kind
class-attribute
instance-attribute
¶
ConfirmingAuthority ¶
Bases: ExperimentalModel
kind
class-attribute
instance-attribute
¶
EvidenceConsumer ¶
Bases: ExperimentalModel
GovernedExecutor ¶
Bases: ExperimentalModel
LifecycleStatus ¶
Money ¶
Bases: ExperimentalModel
A monetary amount whose currency is explicit and precision is host-validated.
ProposalIdentity ¶
ProposingAgent ¶
Bases: ExperimentalModel
RecoveryOperator ¶
RequestingPrincipal ¶
Bases: ExperimentalModel
kind
class-attribute
instance-attribute
¶
AuthorityReceipt ¶
Bases: _ReceiptBase
AuthorityReceiptStatus ¶
EventSink ¶
Bases: Protocol
Best-effort, at-most-once projection called after durable state changes.
ExecutionReceipt ¶
Bases: _ReceiptBase
ExternalReference ¶
ItemOutcome ¶
ItemOutcomeStatus ¶
NoopEventSink ¶
ProposalReceipt ¶
Bases: _ReceiptBase
ProposalReceiptStatus ¶
RecoveryReceipt ¶
Bases: _ReceiptBase
RuntimeEvent ¶
RuntimeEventType ¶
VerificationReceipt ¶
Bases: _ReceiptBase
receipt_type
class-attribute
instance-attribute
¶
VerificationReceiptStatus ¶
Bases: StrEnum
VERIFIED_COMPLETION
class-attribute
instance-attribute
¶
VERIFIED_TERMINAL_FAILURE
class-attribute
instance-attribute
¶
PROVISIONAL_ABSENCE
class-attribute
instance-attribute
¶
AUTHORITATIVE_FINAL_ABSENCE
class-attribute
instance-attribute
¶
VERIFICATION_UNRESOLVED
class-attribute
instance-attribute
¶
ActionRecoveryView ¶
Bases: ActionModel
Versioned, read-only explanation of one proposal's recovery state.
schema_version
class-attribute
instance-attribute
¶
next_verification_at
class-attribute
instance-attribute
¶
max_verification_attempts
class-attribute
instance-attribute
¶
last_verification_status
class-attribute
instance-attribute
¶
last_verification_status: VerificationReceiptStatus | None = None
recommended_steps
class-attribute
instance-attribute
¶
ActionDefinition
dataclass
¶
ActionDefinition(action_type: ActionType, command_model: type[CommandT], private_snapshot_model: type[PrivateSnapshotT], display_preview_model: type[PreviewT], result_model: type[ResultT], preparation: PreparationPort[CommandT, PrivateSnapshotT, PreviewT], authorization: AuthorizationPort[CommandT, PrivateSnapshotT], authority_evaluator: AuthorityEvaluatorPort, state_resolver: StateResolverPort[PrivateSnapshotT, PreviewT], executor: GovernedExecutorPort[PrivateSnapshotT, ResultT], verifier: VerifierPort[ResultT], commitment_provider: CommitmentProviderPort, protection_codec: ProtectionCodecPort, retention: RetentionPort, proposal_ttl: timedelta, executor_identity: GovernedExecutor, target_identity: AuthoritativeTarget, authority_audience: str, authority_channel_assurance: str, recovery_authorization: RecoveryAuthorizationPort | None = None, verification_delay: timedelta = timedelta(0), max_verification_attempts: int = 3, effect_kind: EffectKind = 'single', allow_resend_after_final_absence: bool = False, verification_lease_duration: timedelta = timedelta(minutes=1), semantic_idempotency_strategy: Literal['host_defined'] = 'host_defined')
Bases: Generic[CommandT, PrivateSnapshotT, PreviewT, ResultT]
recovery_authorization
class-attribute
instance-attribute
¶
recovery_authorization: RecoveryAuthorizationPort | None = None
verification_delay
class-attribute
instance-attribute
¶
allow_resend_after_final_absence
class-attribute
instance-attribute
¶
verification_lease_duration
class-attribute
instance-attribute
¶
semantic_idempotency_strategy
class-attribute
instance-attribute
¶
ActionNotRegisteredError ¶
Bases: LookupError
ActionRegistry ¶
A heterogeneous registry with checked type recovery at its boundary.
register ¶
register(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT]) -> None
get_typed ¶
get_typed(action_type: ActionType, *, command_model: type[CommandT], private_snapshot_model: type[PrivateSnapshotT], display_preview_model: type[PreviewT], result_model: type[ResultT]) -> ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT]
AuthorityEvaluation ¶
Bases: ExperimentalModel
AuthorityEvaluatorPort ¶
Bases: Protocol
evaluate
async
¶
evaluate(*, binding: AuthorityBinding, evidence: tuple[AuthorityEvidence, ...]) -> AuthorityEvaluation
AuthorizationPort ¶
Bases: Protocol[CommandContraT, PrivateContraT]
can_prepare
async
¶
can_prepare(command: CommandContraT, *, context: PreparationContext) -> AuthorizationResult
can_decide
async
¶
can_decide(evidence: AuthorityEvidence, *, context: DecisionContext) -> AuthorizationResult
can_execute
async
¶
can_execute(snapshot: PrivateContraT, *, context: ExecutionContext) -> AuthorizationResult
AuthorizationResult ¶
Bases: ExperimentalModel
DecisionContext ¶
Bases: ExperimentalModel
DefinitionConformanceError ¶
Bases: ValueError
Raised when declared boundary models cannot satisfy the runtime contract.
DefinitionTypeMismatchError ¶
Bases: TypeError
DuplicateActionError ¶
Bases: RuntimeError
ExecutionContext ¶
Bases: ExperimentalModel
ExecutionResult ¶
Bases: ExperimentalModel, Generic[ResultT]
external_reference
class-attribute
instance-attribute
¶
external_reference: ExternalReference | None = None
GovernedExecutorPort ¶
Bases: Protocol[PrivateContraT, ResultT]
execute
async
¶
execute(snapshot: PrivateContraT, *, context: ExecutionContext, execution_precondition: str) -> ExecutionResult[ResultT]
PreparationContext ¶
Bases: ExperimentalModel
PreparationPort ¶
Bases: Protocol[CommandContraT, PrivateSnapshotT, PreviewT]
prepare
async
¶
prepare(command: CommandContraT, *, context: PreparationContext) -> PreparedAction[PrivateSnapshotT, PreviewT]
PreparedAction
dataclass
¶
PreparedAction(private_snapshot: PrivateSnapshotT, display_preview: PreviewT, semantic_effect_reference: str)
Bases: Generic[PrivateSnapshotT, PreviewT]
ReadContext ¶
Bases: ExperimentalModel
ResolvedState
dataclass
¶
ResolvedState(current_snapshot: PrivateSnapshotT, execution_precondition: str, materially_drifted: bool, replacement: PreparedAction[PrivateSnapshotT, PreviewT] | None = None)
Bases: Generic[PrivateSnapshotT, PreviewT]
replacement
class-attribute
instance-attribute
¶
replacement: PreparedAction[PrivateSnapshotT, PreviewT] | None = None
RetentionPort ¶
Bases: Protocol
authorize_erasure
async
¶
authorize_erasure(proposal_reference: str, *, context: ReadContext) -> bool
StateResolverPort ¶
Bases: Protocol[PrivateSnapshotT, PreviewT]
resolve
async
¶
resolve(snapshot: PrivateSnapshotT, *, context: ExecutionContext) -> ResolvedState[PrivateSnapshotT, PreviewT]
VerificationResult ¶
Bases: ExperimentalModel, Generic[ResultT]
external_reference
class-attribute
instance-attribute
¶
external_reference: ExternalReference | None = None
settling_boundary_passed
class-attribute
instance-attribute
¶
target_idempotency_guaranteed
class-attribute
instance-attribute
¶
absence_requires_consistent_evidence ¶
absence_requires_consistent_evidence() -> VerificationResult[ResultT]
VerificationStatus ¶
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.
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
AuthorizationDeniedError ¶
Bases: PermissionError
InvalidActionResultError ¶
Bases: RuntimeError
InvalidAuthorityEvidenceError ¶
Bases: ValueError
OperationOutcome ¶
ProposalPersistenceOutcomeUnknownError ¶
ProposalPersistenceOutcomeUnknownError(proposal_identity: ProposalIdentity)
Bases: RuntimeError
Raised when proposal persistence cannot be reconciled safely.
ProposalView ¶
Bases: ExperimentalModel
RetentionStoreUnavailableError ¶
Bases: RuntimeError
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.
ActionStore ¶
Bases: Protocol
Authoritative persistence for tenant-scoped proposal state.
A completed write, including one whose acknowledgement is lost, must be
visible to a subsequent get through the same adapter so the runtime can
reconcile before compensating protected state.
Cancellation must settle any background write before returning control. A subsequent absent read must not race a write that can still commit.
compare_and_set
async
¶
compare_and_set(*, tenant_reference: str, proposal_reference: str, expected_revision: int, expected_statuses: tuple[LifecycleStatus, ...], updated: StoredProposal) -> bool
admit_execution
async
¶
admit_execution(*, tenant_reference: str, proposal_reference: str, expected_revision: int, admitted_at: datetime, updated: StoredProposal) -> EffectClaimResult
get_effect_claim_owner
async
¶
get_effect_claim_owner(*, tenant_reference: str, action_type: ActionType, semantic_effect_reference: str) -> str | None
MemoryActionStore ¶
Bases: ActionStore, RetentionStore
An in-process conformance store with tenant-scoped guarded writes.
compare_and_set
async
¶
compare_and_set(*, tenant_reference: str, proposal_reference: str, expected_revision: int, expected_statuses: tuple[LifecycleStatus, ...], updated: StoredProposal) -> bool
admit_execution
async
¶
admit_execution(*, tenant_reference: str, proposal_reference: str, expected_revision: int, admitted_at: datetime, updated: StoredProposal) -> EffectClaimResult
get_effect_claim_owner
async
¶
get_effect_claim_owner(*, tenant_reference: str, action_type: ActionType, semantic_effect_reference: str) -> str | None
mark_erasure_pending
async
¶
mark_erasure_pending(*, tenant_reference: str, proposal_reference: str, expected_revision: int, pending_at: datetime) -> bool
complete_erasure
async
¶
complete_erasure(*, tenant_reference: str, proposal_reference: str, expected_revision: int, erased_at: datetime) -> bool
ProposalAlreadyExistsError ¶
Bases: RuntimeError
RetentionStore ¶
Bases: Protocol
Privileged persistence operations kept outside the runtime DB role.
mark_erasure_pending
async
¶
mark_erasure_pending(*, tenant_reference: str, proposal_reference: str, expected_revision: int, pending_at: datetime) -> bool
complete_erasure
async
¶
complete_erasure(*, tenant_reference: str, proposal_reference: str, expected_revision: int, erased_at: datetime) -> bool
StoredProposal ¶
Bases: ExperimentalModel
Persistence-neutral lifecycle record; private state is always protected.
display_preview
class-attribute
instance-attribute
¶
display_preview: JsonObject = Field(default_factory=dict)
requesting_principal
class-attribute
instance-attribute
¶
requesting_principal: RequestingPrincipal | None = None
authority_evidence
class-attribute
instance-attribute
¶
authority_evidence: tuple[AuthorityEvidence, ...] = ()
verification_attempts
class-attribute
instance-attribute
¶
max_verification_attempts
class-attribute
instance-attribute
¶
next_verification_at
class-attribute
instance-attribute
¶
execution_precondition
class-attribute
instance-attribute
¶
execution_precondition: SafeReference | None = None
erasure_pending_at
class-attribute
instance-attribute
¶
StoreInvariantError ¶
Bases: RuntimeError
resolve_runtime_revision ¶
Return an exact released version or source commit plus package-tree digest.
authority_evidence_matches_binding ¶
authority_evidence_matches_binding(evidence: AuthorityEvidence, *, binding: AuthorityBinding) -> bool
Check proposal binding dimensions without evaluating time or sufficiency.
validate_authority_evidence ¶
validate_authority_evidence(evidence: AuthorityEvidence, *, binding: AuthorityBinding, now: AwareDatetime) -> AuthorityValidationResult
Validate server-bound evidence without treating it as sufficient policy.
canonicalize_v1 ¶
Produce deterministic UTF-8 JSON for the internal canonical v1 profile.
commitment_payload_v1 ¶
Domain-separate a private snapshot commitment from every other digest.
assert_definition_conforms ¶
assert_definition_conforms(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT]) -> None
Reject declared model shapes that cannot satisfy the runtime boundary.
validate_proposal_update ¶
validate_proposal_update(*, current: StoredProposal, updated: StoredProposal) -> None