Parent: #161
Goal
Extend fd5 validate to verify audit chain integrity alongside the Merkle tree.
Spec
verify_chain(file: h5py.File) -> ChainStatus
- ChainStatus:
Valid, NoLog, BrokenChain(index, expected, actual), Error(msg)
- Validation rules:
- Each entry's parent_hash must equal the previous entry's implicit new hash
- The first entry's parent_hash should be a valid sha256: prefixed hash
- No duplicate timestamps with identical changes
- Integrate into
fd5 validate output: show "Audit chain: N entries, valid" or error
verify() function already exists — add chain check as separate function, call from CLI
TDD
- Test valid chain passes
- Test tampered entry detected (modify middle entry)
- Test missing entry detected (gap in chain)
- Test file with no log returns NoLog
- Test single-entry chain
Parent: #161
Goal
Extend
fd5 validateto verify audit chain integrity alongside the Merkle tree.Spec
verify_chain(file: h5py.File) -> ChainStatusValid,NoLog,BrokenChain(index, expected, actual),Error(msg)fd5 validateoutput: show "Audit chain: N entries, valid" or errorverify()function already exists — add chain check as separate function, call from CLITDD