NumPy allowed · plain Python earns 10 bonus points
Implement audit-log hash-chain verification, a real tamper-evidence technique letting a security review detect if any historical agent-action log entry was altered or deleted after the fact.
Implement is_audit_chain_intact(log_entries). Each entry is {"data": str, "prev_hash": str, "hash": str}. For entry 0, prev_hash must be ''. For every entry, its hash must equal hashlib.sha256((entry['prev_hash'] + entry['data']).encode()).hexdigest(). For entry i > 0, its prev_hash must equal entry i-1's hash. Return True only if ALL these checks pass for every entry.
is_audit_chain_intact(log_entries: list[dict]) -> bool