Skip to content

Data models

All models are frozen dataclasses with to_dict() / from_dict() converters that produce and consume canonicalizable JSON.

Domain

approvo.models.Identity dataclass

A party allowed to interact with the system.

approvo.models.ApprovalRequest dataclass

identity_dict

identity_dict() -> dict

The identity-bearing fields: same inputs => same request_id.

context_digest

context_digest() -> str

What decisions bind to: the full request including created_at.

approvo.models.Decision dataclass

approvo.models.Record dataclass

Authoritative view of one request, re-derived from the ledger.

Never cached, never trusted from storage. This is what a deploy gate must consult — as opposed to :class:RequestView, which is a projection built for listing things in a UI.

Ledger

approvo.models.LedgerEntry dataclass

approvo.models.Checkpoint dataclass

A signed tree head: 'as of tree_size entries, the Merkle root was X'.

signed_dict

signed_dict() -> dict

The bytes the log key signs — everything except the signatures.

Policy results

approvo.models.PolicyResult dataclass

Read models (projections)

approvo.models.RequestView dataclass

Denormalized projection of a request, for list/filter/search screens.

Rebuildable from the ledger at any time (:meth:~approvo.service.ApprovalService.rebuild_projections). Safe to render; not safe to gate on. Gate on :meth:~approvo.service.ApprovalService.get_status.

approvo.models.RequestQuery dataclass

Filters for the projection store. All filters AND together.

approvo.models.Page dataclass

Bases: Generic[T]

Detached signing

approvo.models.DecisionChallenge dataclass

Exact bytes an approver must sign, produced by prepare_decision.

The BFF hands this to the client (browser, CLI, HSM agent). The client signs pae and returns the signature; the server never sees a private key, so it cannot forge an approval even if fully compromised.

Verification

approvo.models.Check dataclass

One line of a verification report.

approvo.models.VerificationReport dataclass