cadrumo.application.user_profile.censal_operation module¶
Resumable censo acquisition, exact review, and cotejo application.
- class CensalFieldIntent(*values)[source]¶
Bases:
StrEnumClosed operator intent for one reviewed censo-derived profile field.
- ADOPT¶
- PRESERVE¶
- class CensalReviewedFieldIntent(**data)[source]¶
Bases:
BaseModelOne exact field decision retained with the reviewed observation.
- Parameters:
data (Any)
- path: str¶
- intent: CensalFieldIntent¶
- class CensalProfileBaseline(**data)[source]¶
Bases:
BaseModelExact immutable profile revision against which the proposal was reviewed.
- Parameters:
data (Any)
- profile_id: ProfileId¶
- record_revision: int¶
- content_digest: ContentDigest¶
- classmethod from_record(record)[source]¶
Capture the canonical revision and self-verifying content digest.
Core types:
UserProfileRecord.- Return type:
- Parameters:
record (UserProfileRecord)
- CENSAL_REVIEWED_OPERAND_SCHEMA_VERSION: Final[Literal[1]]¶
Wire version of the reviewed-operand record. Named rather than written as a bare default so the number has one home: a reader can find every site bound to this shape, and a bump cannot land on the model while a writer stamping the old number silently disagrees with it.
- class CensalReviewedOperand(**data)[source]¶
Bases:
BaseModelEncrypted exact preimage approved or rejected by the operator.
- Parameters:
schema_version (Literal[1])
observation (CensalObservation)
baseline (CensalProfileBaseline)
field_intents (tuple[CensalReviewedFieldIntent, ...])
proposed_effect_digest (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=64, pattern=^(?:[0-9a-f]{64})?$, ascii_only=None)])
- schema_version: Literal[1]¶
- observation: CensalObservation¶
- baseline: CensalProfileBaseline¶
- field_intents: tuple[CensalReviewedFieldIntent, ...]¶
- proposed_effect_digest: ContentDigestOrAbsent¶
- class CensalOperationRequest(**data)[source]¶
Bases:
BaseModelExact preflight baseline and review choices with no bearer material.
- Parameters:
data (Any)
- baseline: CensalProfileBaseline¶
- field_intents: tuple[CensalReviewedFieldIntent, ...]¶
- build_censal_operation_request(record)[source]¶
Bind the exact baseline and safe per-field defaults for frontend review.
Core types:
UserProfileRecord.- Return type:
- Parameters:
record (UserProfileRecord)
- class CensalOperationOutcome(*values)[source]¶
Bases:
StrEnumSettled domain outcome represented by the executor result reference.
- APPLIED¶
- REJECTED¶
- class CensalOperationResult(**data)[source]¶
Bases:
BaseModelTyped schema for the safe result referenced by a completed continuation.
- Parameters:
data (Any)
- outcome: CensalOperationOutcome¶
- reviewed_proposal_digest: ContentDigest¶
- class CensalReviewResponse(**data)[source]¶
Bases:
BaseModelAuthority-free public decision submitted for a censal REVIEW.
- Parameters:
- response_version: Literal[1]¶
- intent: OperationResponseIntentValue¶
- class CensalReviewFieldProjectionV1(**data)[source]¶
Bases:
BaseModelOne safe censo field displayed for an exact REVIEW decision.
- Parameters:
data (Any)
- path: str¶
- intent: CensalFieldIntent¶
- observed_value: str | None¶
- class CensalReviewProjectionV1(**data)[source]¶
Bases:
BaseModelBearer-free public projection of the encrypted censal proposal.
- Parameters:
projection_version (Literal[1])
fields (tuple[CensalReviewFieldProjectionV1, ...])
- projection_version: Literal[1]¶
- fields: tuple[CensalReviewFieldProjectionV1, ...]¶
- build_censal_operation_registration(definition)[source]¶
Bind the canonical censal definition to its public REVIEW contract.
- Return type:
- Parameters:
definition (OperationDefinition)
- class CensalOperationAcquisition(observation, resource=None)[source]¶
Bases:
objectCompleted read plus its idempotently closeable acquisition resource.
- Parameters:
observation (CensalObservation)
resource (AsyncCloseable | None)
-
observation:
CensalObservation¶
-
resource:
AsyncCloseable|None¶
- class CensalOperationExecutor(*, certificate_secret_backend_factory, browser_session_factory, operator_scope_ports, censal_fetch_port, acquire=None, apply=None, before_irreversible_section=None)[source]¶
Bases:
objectAcquire once, publish one durable review, and resume only from it.
- Parameters:
certificate_secret_backend_factory (CertificateSecretBackendFactory)
browser_session_factory (BrowserSessionFactoryPort)
operator_scope_ports (OperatorScopePorts)
censal_fetch_port (CensalFetchPort)
acquire (Callable[[], Awaitable[CensalObservation | CensalOperationAcquisition]] | None)
apply (Callable[[CensalReviewedOperand], None] | None)
before_irreversible_section (Callable[[], Awaitable[None]] | None)
- async execute(request, context)[source]¶
Acquire the observation and publish one durable review checkpoint.
- Return type:
- Parameters:
request (OperationRequest[CensalOperationRequest])
context (OperationExecutorContext)
- async resume(request, checkpoint, context)[source]¶
Resume a consumed review checkpoint and apply or reject its operand.
- Return type:
- Parameters:
request (OperationRequest[CensalOperationRequest])
checkpoint (OperationResumeCheckpoint)
context (OperationExecutorContext)
- build_censal_operation_definition(*, certificate_secret_backend_factory, browser_session_factory, operator_scope_ports, censal_fetch_port, acquire=None, apply=None, before_irreversible_section=None)[source]¶
Build the one CENSO registration with its outer live authorities bound.
- Return type:
- Parameters:
certificate_secret_backend_factory (CertificateSecretBackendFactory)
browser_session_factory (BrowserSessionFactoryPort)
operator_scope_ports (OperatorScopePorts)
censal_fetch_port (CensalFetchPort)
acquire (Callable[[], Awaitable[CensalObservation | CensalOperationAcquisition]] | None)
apply (Callable[[CensalReviewedOperand], None] | None)
before_irreversible_section (Callable[[], Awaitable[None]] | None)