Public declaration syntax from forge-rs/crates/forge-code-safety/src/audit.rs Original source SHA-256: 46a6ccac555e715e99dfb328174cbf05b60b7070099f1cae1e0bb672f9745782 Function bodies and constant values are omitted. This is not the complete implementation. Source line 45 #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] pub enum FileOperation { /// Creating a new file. Create, /// Reading a file's contents. Read, /// Modifying an existing file. Modify, /// Deleting a file. Delete, /// Renaming or moving a file. Rename, /// Changing file permissions. Chmod, /// Creating a directory. CreateDir, /// Removing a directory. RemoveDir, } Source line 81 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub enum OperationResult { /// The operation succeeded. Success, /// The operation was denied by policy. Denied { /// Why it was denied. reason: String, }, /// The operation failed due to an error. Failed { /// What went wrong. reason: String, }, } Source line 108 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AuditEntry { /// Unique identifier for this entry. pub id: String, /// When the operation occurred. pub timestamp: DateTime, /// The DID of the agent that performed the operation. pub agent_did: String, /// The type of operation. pub operation: FileOperation, /// The file path targeted by the operation. pub path: PathBuf, /// The result of the operation. pub result: OperationResult, /// Optional additional context or notes. pub context: Option, /// BLAKE3 hash of the previous entry for chain integrity. pub previous_hash: String, /// BLAKE3 hash of this entry's content. pub entry_hash: String } Source line 137 pub struct FileAuditLog { } Source line 143 pub fn new() -> Self; Source line 158 pub async fn record( &self, agent_did: &str, operation: FileOperation, path: PathBuf, result: OperationResult, context: Option, ); Source line 204 pub async fn entries(&self) -> Vec; Source line 210 pub async fn len(&self) -> usize; Source line 216 pub async fn is_empty(&self) -> bool; Source line 222 pub async fn entries_by_agent(&self, agent_did: &str) -> Vec; Source line 232 pub async fn entries_by_operation(&self, operation: FileOperation) -> Vec; Source line 245 pub async fn verify_chain(&self) -> Result<(), String>;