AuditTrail

class AuditTrail(context: Context, retentionProvider: () -> RetentionPolicy, clock: Clock, crypto: CryptoProvider)

Local tamper-evident audit trail.

This is not “unbreakable”. It is designed to make accidental corruption and casual tampering obvious. We keep it local-first and encrypt-at-rest when crypto is enabled.

Constructors

Link copied to clipboard
constructor(context: Context, retentionProvider: () -> RetentionPolicy, clock: Clock, crypto: CryptoProvider)

Functions

Link copied to clipboard
Link copied to clipboard

Deletes audit files older than the configured retention period. Files are retained for RetentionPolicy.retainAuditDays full days.

Link copied to clipboard
fun record(name: String, fields: Map<String, String> = emptyMap())

Records an audit event with hash-chain linking.