record
Records an audit event with hash-chain linking.
Note: The hash chain is process-local. After app restart, the chain restarts from "GENESIS". This is intentional and documents process lifetime boundaries. Cross-restart chain continuity would require persisting lastHash, which adds complexity without significant security benefit (an attacker who can modify files can also modify the persisted hash).
Parameters
name
Event name (e.g., "sync_batch_success", "enqueue_rejected")
fields
Optional key-value pairs for event context (avoid PII)