#[non_exhaustive]pub enum ReceiptError {
Jcs(JcsError),
Serde(Error),
Key(KeyError),
Base64,
KeyMismatch(String),
DuplicateKey(String),
SemanticInvariant(String),
}Expand description
Receipt errors.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Jcs(JcsError)
Canonicalization failed (unsafe numbers in body).
Serde(Error)
Serialization failed.
Key(KeyError)
Key/signature failure.
Base64
Signature or public key not valid base64.
KeyMismatch(String)
The receipt’s embedded public key does not match the keyring entry for its key id (substitution attempt).
DuplicateKey(String)
A JSON object at some nesting level carried a duplicate key. Rejecting these closes the last-wins vs first-wins auditor split-brain that would otherwise let a hostile issuer sign under one interpretation while an external audit tool displayed the other.
The payload is a complete scanner message (duplicate key,
nesting-depth, or explicit-null refusal), so the template
must not re-wrap it in a key-shaped slot — a
“duplicate JSON key {0} at nesting” template produced garbled
double-wrapped diagnostics like duplicate JSON key `duplicate key `x` in JSON object …` at nesting.
SemanticInvariant(String)
A receipt carries a semantically-invalid field.
Enforced by verify_semantic_invariants: supported
receipt_version ∈ {1, 2}, ai_agent.charter.type_id == 1
(OCSF Regular File), non-empty required string fields
(receipt_id, session_id, ai_agent.charter.name,
ai_agent.charter.instance_uid), 64-hex chain_head and
per-step trajectory_digest, issued_at_iso == iso8601_ms(issued_at), stop-reason ↔ stop-reason-id
cross-wiring, and AtifTrajectory.retroactive == true.
Distinct from Serde and DuplicateKey so ops triage
can name the class.
Trait Implementations§
Source§impl Debug for ReceiptError
impl Debug for ReceiptError
Source§impl Display for ReceiptError
impl Display for ReceiptError
Source§impl Error for ReceiptError
impl Error for ReceiptError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()