openagent-skills-policy · audit
Declared module signatures, types, configuration, and source documentation.
Source: openagent-sdk/crates/openagent-skills-policy/rust/src/audit.rs. SHA-256: bcd120729293228acf0d04e5b12283d672de19108329b1136e444f3e455b609b.
This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.
audit::HASH_LEN
Length of a BLAKE3 hash in bytes.
pub const HASH_LEN: usize;Source line: 20.
audit::HashHex
A hex-encoded hash (used for JSON-friendly serialization).
#[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(transparent)]
pub struct HashHex(String);Source line: 25.
audit::HashHex::from_bytes
Build from raw bytes.
#[must_use]
pub fn from_bytes(bytes: &[u8; HASH_LEN]) -> Self;Source line: 30.
audit::HashHex::as_str
Return the hex string.
#[must_use]
pub fn as_str(&self) -> &str;Source line: 36.
audit::Receipt
A single invocation receipt.
Receipts are immutable. New invocations produce new receipts rather than mutating existing ones.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Receipt {
/// Monotonically increasing sequence number, starting at 0.
pub sequence: u64,
/// Skill that was invoked.
pub skill: String,
/// DID of the invoking agent.
pub agent: String,
/// Session ID the invocation happened under.
pub session: String,
/// When the invocation was recorded (UTC, RFC 3339).
pub invoked_at: String,
/// Audit level applied when recording.
pub audit_level: AuditLevel,
/// Hash of the arguments (always present; the argument payload itself is
/// only included when `audit_level = Full`).
pub arguments_hash: HashHex,
/// Full arguments JSON — only populated when `audit_level = Full`.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub arguments: Option<serde_json::Value>,
/// Hash of the previous receipt in the chain (or zero for the first).
pub previous_hash: HashHex,
/// Hash of *this* receipt — computed over all fields above plus
/// `previous_hash`.
pub receipt_hash: HashHex
}Source line: 58.
audit::AuditChain
Append-only chain of invocation receipts.
#[derive(Debug, Default, Clone)]
pub struct AuditChain {
}Source line: 86.
audit::AuditChain::new
Create an empty chain.
#[must_use]
pub fn new() -> Self;Source line: 94.
audit::AuditChain::len
Number of receipts in the chain.
#[must_use]
pub fn len(&self) -> usize;Source line: 100.
audit::AuditChain::is_empty
Whether the chain is empty.
#[must_use]
pub fn is_empty(&self) -> bool;Source line: 106.
audit::AuditChain::head
The current head hash (all-zero if the chain is empty).
#[must_use]
pub fn head(&self) -> HashHex;Source line: 112.
audit::AuditChain::get
Get a receipt by its sequence number.
#[must_use]
pub fn get(&self, sequence: u64) -> Option<&Receipt>;Source line: 118.
audit::AuditChain::iter
Iterate over all receipts in order.
pub fn iter(&self) -> impl Iterator<Item = &Receipt>;Source line: 123.
audit::AuditChain::verify
Verify that every receipt's receipt_hash and previous_hash
matches the recomputed chain. Returns true if intact.
#[must_use]
pub fn verify(&self) -> bool;Source line: 130.