Canonicalization and protection¶
canonical ¶
Versioned canonical JSON and protected-payload ports.
SafeReference
module-attribute
¶
SafeReference = Annotated[str, StringConstraints(min_length=1, max_length=255), AfterValidator(_validate_safe_reference)]
OpaquePayload
module-attribute
¶
CommitmentProviderPort
module-attribute
¶
CommitmentProviderPort = CommitmentProvider | ProposalBoundCommitmentProvider
ProtectionCodecPort
module-attribute
¶
ProtectionCodecPort = ProtectionCodec | ProposalBoundProtectionCodec
ExperimentalModel ¶
ProposalIdentity ¶
CanonicalizationError ¶
Bases: ValueError
Raised when a value cannot enter the canonical finance boundary.
KeyedCommitment ¶
ProtectedPayload ¶
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
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
ProtectionCodec ¶
Bases: Protocol
Host-owned protection boundary for canonical private snapshots.
Destruction must be idempotent so an interrupted erasure can resume safely.
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
model_json_object ¶
model_json_object(model: BaseModel) -> JsonObject
Convert a host Pydantic model to a checked JSON object.
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.