-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
area:corefd5 core libraryfd5 core libraryaudit-trailAudit trail / provenance chain featureAudit trail / provenance chain featureeffort:medium1-4 hours1-4 hoursfeatureNew feature or requestNew feature or request
Description
Parent: #161
Goal
Create fd5.audit module with AuditEntry dataclass and read/write functions for the _fd5_audit_log root attribute.
Spec
AuditEntrydataclass:parent_hash,timestamp(ISO-8601),author(dict withtype/id/name),message,changes(list of dicts withaction/path/attr/old/new)read_audit_log(file: h5py.File) -> list[AuditEntry]— parse JSON from_fd5_audit_logattributeappend_audit_entry(file: h5py.File, entry: AuditEntry)— read existing log, append, write back as JSONAuditEntry.to_dict()/AuditEntry.from_dict()for JSON serialization- The
_fd5_audit_logattribute is a VarLenUnicode string (JSON array) - NOT excluded from content_hash computation (tamper-evident)
TDD
- Test round-trip: write entry → read back → assert equal
- Test append to existing log
- Test empty log returns []
- Test malformed JSON raises clear error
- Test entry validation (required fields)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:corefd5 core libraryfd5 core libraryaudit-trailAudit trail / provenance chain featureAudit trail / provenance chain featureeffort:medium1-4 hours1-4 hoursfeatureNew feature or requestNew feature or request