Parent: #161
Goal
Extend verify.rs to validate audit chain integrity.
Spec
ChainStatus enum: Valid(usize) (entry count), NoLog, BrokenChain { index, expected, actual }, Error(String)
verify_chain(file: &File) -> Fd5Result<ChainStatus>
- Integrate into
Fd5Status or return separately
- Validation:
- Walk entries in order
- Each entry\u2019s parent_hash must form a valid chain
- No gaps or tampered entries
TDD
- Test valid chain → Valid(N)
- Test tampered middle entry → BrokenChain
- Test no log → NoLog
- Test single entry chain
- Test content_hash mismatch with chain (Merkle tree catches audit log tampering)
Parent: #161
Goal
Extend
verify.rsto validate audit chain integrity.Spec
ChainStatusenum:Valid(usize)(entry count),NoLog,BrokenChain { index, expected, actual },Error(String)verify_chain(file: &File) -> Fd5Result<ChainStatus>Fd5Statusor return separatelyTDD