audit
audit
¶
Append-only, hash-chained audit log (audit-record/1, BE8).
One JSONL file per session at <root>/<dispatch_id>/<session_id>.jsonl.
record_hash_k = sha256(record_hash_{k-1} || canonical_json(record_k minus
record_hash/segment_hash)) with record_hash_{-1} = sha256("GENESIS")
(hex strings concatenated). The first record carries prev_hash = null.
Segment sealing is limited to stamping segment_hash on the terminal
record; rotation and archival are out of scope.
Classes¶
AuditLog
¶
Writer for per-session chained segments.
Source code in src/marianne/memory/gateway/audit.py
Methods:¶
append
¶
Append one record (fsynced) and return it. seal stamps segment_hash.
Source code in src/marianne/memory/gateway/audit.py
Functions:¶
verify_audit_file
¶
Recompute the chain; report the first line that is removed-after, edited or reordered.