Action definitions and ports¶
registry ¶
Typed action definitions and heterogeneous registry boundary.
SafeReference
module-attribute
¶
SafeReference = Annotated[str, StringConstraints(min_length=1, max_length=255), AfterValidator(_validate_safe_reference)]
CommandContraT
module-attribute
¶
PrivateContraT
module-attribute
¶
AuthorityBinding ¶
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)
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
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
ExperimentalModel ¶
Bases: BaseModel
Strict, immutable base for the experimental public contract.
model_config
class-attribute
instance-attribute
¶
GovernedExecutor ¶
Bases: ExperimentalModel
ProposingAgent ¶
Bases: ExperimentalModel
RequestingPrincipal ¶
Bases: ExperimentalModel
kind
class-attribute
instance-attribute
¶
ExternalReference ¶
ItemOutcome ¶
ItemOutcomeStatus ¶
PreparationContext ¶
Bases: ExperimentalModel
DecisionContext ¶
Bases: ExperimentalModel
ReadContext ¶
Bases: ExperimentalModel
ExecutionContext ¶
Bases: ExperimentalModel
AuthorizationResult ¶
Bases: ExperimentalModel
AuthorityEvaluation ¶
Bases: ExperimentalModel
PreparedAction
dataclass
¶
PreparedAction(private_snapshot: PrivateSnapshotT, display_preview: PreviewT, semantic_effect_reference: str)
Bases: Generic[PrivateSnapshotT, PreviewT]
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
ExecutionResult ¶
Bases: ExperimentalModel, Generic[ResultT]
external_reference
class-attribute
instance-attribute
¶
external_reference: ExternalReference | None = None
VerificationStatus ¶
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]
PreparationPort ¶
Bases: Protocol[CommandContraT, PrivateSnapshotT, PreviewT]
prepare
async
¶
prepare(command: CommandContraT, *, context: PreparationContext) -> PreparedAction[PrivateSnapshotT, PreviewT]
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
AuthorityEvaluatorPort ¶
Bases: Protocol
evaluate
async
¶
evaluate(*, binding: AuthorityBinding, evidence: tuple[AuthorityEvidence, ...]) -> AuthorityEvaluation
StateResolverPort ¶
Bases: Protocol[PrivateSnapshotT, PreviewT]
resolve
async
¶
resolve(snapshot: PrivateSnapshotT, *, context: ExecutionContext) -> ResolvedState[PrivateSnapshotT, PreviewT]
GovernedExecutorPort ¶
Bases: Protocol[PrivateContraT, ResultT]
execute
async
¶
execute(snapshot: PrivateContraT, *, context: ExecutionContext, execution_precondition: str) -> ExecutionResult[ResultT]
RetentionPort ¶
Bases: Protocol
authorize_erasure
async
¶
authorize_erasure(proposal_reference: str, *, context: ReadContext) -> bool
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: CommitmentProvider, protection_codec: ProtectionCodec, retention: RetentionPort, proposal_ttl: timedelta, executor_identity: GovernedExecutor, target_identity: AuthoritativeTarget, authority_audience: str, authority_channel_assurance: str, 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]
DefinitionConformanceError ¶
Bases: ValueError
Raised when declared boundary models cannot satisfy the runtime contract.
DuplicateActionError ¶
Bases: RuntimeError
ActionNotRegisteredError ¶
Bases: LookupError
DefinitionTypeMismatchError ¶
Bases: TypeError
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]
assert_definition_conforms ¶
assert_definition_conforms(definition: ActionDefinition[CommandT, PrivateSnapshotT, PreviewT, ResultT]) -> None
Reject declared model shapes that cannot satisfy the runtime boundary.