pub struct ChioReceipt {Show 16 fields
pub id: String,
pub timestamp: u64,
pub capability_id: String,
pub tool_server: String,
pub tool_name: String,
pub action: ToolCallAction,
pub decision: Decision,
pub content_hash: String,
pub policy_hash: String,
pub evidence: Vec<GuardEvidence>,
pub metadata: Option<Value>,
pub trust_level: TrustLevel,
pub tenant_id: Option<String>,
pub kernel_key: PublicKey,
pub algorithm: Option<SigningAlgorithm>,
pub signature: Signature,
}Expand description
A Chio receipt. Signed proof that a tool call was evaluated by the Kernel.
Fields§
§id: StringUnique receipt ID (UUIDv7 recommended).
timestamp: u64Unix timestamp (seconds) when the receipt was created.
capability_id: StringID of the capability token that was exercised (or presented).
tool_server: StringTool server that handled the invocation.
tool_name: StringTool that was invoked (or attempted).
action: ToolCallActionThe action that was evaluated.
decision: DecisionThe Kernel’s decision.
content_hash: StringSHA-256 hash of the evaluated content for this receipt.
policy_hash: StringSHA-256 hash of the policy that was applied.
evidence: Vec<GuardEvidence>Per-guard evidence collected during evaluation.
metadata: Option<Value>Optional receipt metadata for stream/accounting details.
trust_level: TrustLevelStrength of kernel mediation that produced this receipt. Defaults
to Mediated. Older receipts that omit this field deserialize
to Mediated for backward compatibility.
tenant_id: Option<String>Phase 1.5 multi-tenant receipt isolation: tenant identifier for
multi-tenant deployments. None in single-tenant mode; derived
from the authenticated session’s enterprise identity context and
MUST NOT be taken from caller-provided request fields (caller
choice would defeat the isolation intent).
Serialized only when set, so receipts emitted by single-tenant deployments remain byte-identical on the wire.
kernel_key: PublicKeyThe Kernel’s public key (for verification without out-of-band lookup).
algorithm: Option<SigningAlgorithm>Signing algorithm used for ChioReceipt::signature. Absent means
Ed25519 for backward compatibility with receipts issued prior to the
introduction of SigningAlgorithm. Informational only: verification
dispatches off the self-describing encoding of the signature itself.
signature: SignatureSignature over canonical JSON of all fields above.
Implementations§
Source§impl ChioReceipt
impl ChioReceipt
Sourcepub fn sign(
body: ChioReceiptBody,
keypair: &Keypair,
) -> Result<ChioReceipt, Error>
pub fn sign( body: ChioReceiptBody, keypair: &Keypair, ) -> Result<ChioReceipt, Error>
Sign a receipt body with the Kernel’s Ed25519 keypair.
Sourcepub fn sign_with_backend(
body: ChioReceiptBody,
backend: &dyn SigningBackend,
) -> Result<ChioReceipt, Error>
pub fn sign_with_backend( body: ChioReceiptBody, backend: &dyn SigningBackend, ) -> Result<ChioReceipt, Error>
Sign a receipt body with an arbitrary SigningBackend.
The body.kernel_key must equal backend.public_key().
Sourcepub fn body(&self) -> ChioReceiptBody
pub fn body(&self) -> ChioReceiptBody
Extract the body for re-verification.
Sourcepub fn verify_signature(&self) -> Result<bool, Error>
pub fn verify_signature(&self) -> Result<bool, Error>
Verify the receipt signature against the embedded kernel key.
Sourcepub fn is_allowed(&self) -> bool
pub fn is_allowed(&self) -> bool
Whether this receipt records an allow decision.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether this receipt records a cancelled terminal outcome.
Sourcepub fn is_incomplete(&self) -> bool
pub fn is_incomplete(&self) -> bool
Whether this receipt records an incomplete terminal outcome.
Sourcepub fn financial_metadata(&self) -> Option<FinancialReceiptMetadata>
pub fn financial_metadata(&self) -> Option<FinancialReceiptMetadata>
Extract typed financial receipt metadata when present.
Extract typed budget-authority lineage for monetary receipts when present.
Trait Implementations§
Source§impl Clone for ChioReceipt
impl Clone for ChioReceipt
Source§fn clone(&self) -> ChioReceipt
fn clone(&self) -> ChioReceipt
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more