Parent: #161
Goal
Add audit module to the fd5 Rust crate with AuditEntry struct and read/write functions.
Spec
AuditEntry struct (serde Serialize/Deserialize):
parent_hash: String
timestamp: String (ISO-8601)
author: Author (struct with author_type: String, id: String, name: String)
message: String
changes: Vec<Change> (struct with action: String, path: String, attr: String, old: Option<String>, new: Option<String>)
read_audit_log(file: &File) -> Fd5Result<Vec<AuditEntry>> — read/parse _fd5_audit_log
append_audit_entry(file: &File, entry: &AuditEntry) -> Fd5Result<()>
- JSON serialization via serde_json
- VarLenUnicode attribute storage
TDD
- Test round-trip: write → read → assert equal
- Test append preserves existing entries
- Test empty/missing log returns Ok(vec![])
- Test malformed JSON returns clear error
- Test serde serialization matches Python format exactly
Parent: #161
Goal
Add
auditmodule to thefd5Rust crate withAuditEntrystruct and read/write functions.Spec
AuditEntrystruct (serde Serialize/Deserialize):parent_hash: Stringtimestamp: String(ISO-8601)author: Author(struct withauthor_type: String,id: String,name: String)message: Stringchanges: Vec<Change>(struct withaction: String,path: String,attr: String,old: Option<String>,new: Option<String>)read_audit_log(file: &File) -> Fd5Result<Vec<AuditEntry>>— read/parse_fd5_audit_logappend_audit_entry(file: &File, entry: &AuditEntry) -> Fd5Result<()>TDD