cadrumo.application.operations.interactions module

Revision-bound interaction requests and exact apply/reject responses.

class OperationInteractionRequest(**data)[source]

Bases: BaseModel

Immutable request for one exact operator continuation.

Parameters:

data (Any)

interaction_id: OperationInteractionId
identity: OperationIdentity
revision: OperationRevision
kind: OperationInteractionKind
presentation_code: OperationEventCode
response_schema_ref: OperationReference
continuation_digest: ContentDigest
expires_at: datetime | None
class OperationResponseIntent(*values)[source]

Bases: StrEnum

Closed operator decision for a review continuation.

APPLY
REJECT
OperationResponseIntentValue

Both members of the operator decision, for a surface that admits either.

An operation model graph must not customise its Pydantic core schema and a bare enum under strict validation refuses the plain token a serialised response carries, so the contracts, the TUI and the censal review all take this literal. Rooted in the enum above; the single-member narrowings on the concrete response models are rooted the same way and stay narrow.

alias of Literal[APPLY, REJECT]

class OperationApplyResponse(**data)[source]

Bases: _OperationInteractionResponseBase

Apply the exact reviewed proposal bound by both digests.

Parameters:

data (Any)

intent: Literal[OperationResponseIntent.APPLY]
baseline_digest: ContentDigest
proposed_effect_digest: ContentDigest
class OperationRejectResponse(**data)[source]

Bases: _OperationInteractionResponseBase

Reject the exact reviewed proposal without a governed effect.

Parameters:

data (Any)

intent: Literal[OperationResponseIntent.REJECT]
reason_code: OperationEventCode | None
class OperationPendingInteraction(**data)[source]

Bases: BaseModel

Credential-free durable checkpoint for one exact single-use response.

Parameters:

data (Any)

request: OperationInteractionRequest
response_token_digest: ContentDigest
reviewed_proposal_digest: ContentDigest
baseline_digest: ContentDigest | None
proposed_effect_digest: ContentDigest | None
property consumed: bool

Report that this checkpoint still awaits a response.

property response_action: None

Expose no decision before the checkpoint is consumed.

classmethod bind(*, request, response_token, reviewed_proposal_digest, baseline_digest=None, proposed_effect_digest=None)[source]

Digest the secret bearer token before it reaches journal state.

Return type:

OperationPendingInteraction

Parameters:
consume(response)[source]

Refuse every response that does not match this exact checkpoint.

Return type:

OperationConsumedInteraction

Parameters:

response (OperationApplyResponse | OperationRejectResponse)

class OperationConsumedInteraction(**data)[source]

Bases: BaseModel

Safe durable continuation intent bound to its exact consumed checkpoint.

Parameters:

data (Any)

interaction_id: OperationInteractionId
intent: OperationResponseIntent
response_digest: ContentDigest
consumed_at: datetime
checkpoint: OperationPendingInteraction
continuation_proof_digest: ContentDigest
property consumed: bool

Report that this checkpoint carries a durable response.

property reviewed_proposal_digest: ContentDigest

Expose only the digest required by the resumed executor.

property response_action: Literal[OperationResponseIntent.APPLY, OperationResponseIntent.REJECT]

Project the private intent enum as a safe closed action member.