Expand description
The durable copy of the jekt audit trail. The handler keeps the last
AUDIT_LOG_MAX entries in memory for
GET /agentmux/reactive/audit, and loses them at every restart. Every entry
is also appended here, as one JSON line, to a file that is never rotated or
truncated: AgentMux keeps agent history, and the record of what agents did,
forever.
Entries hold a hash and the length of each message, never its text, plus the sender, target, outcome and a caller’s free-text note. The file is shared by every srv instance on the machine, so each line names its channel.
The handler records while holding its lock, so recording does no I/O: it queues the line for a writer thread.
Functions§
- default_
path <shared root>/audit/jekt-audit.jsonl, orNonewhile this srv has given the shared folder up.- install
- Start recording to
pathfor the rest of this process. The first call wins. - install_
for_ this_ srv - Start recording where this srv writes (
write_path), and say so in the log when that is its own file. - own_
path <this channel's folder>/audit/jekt-audit.jsonl: where a srv that gave the shared folder up keeps its own rows. A line goes to exactly one of this and the shared file. It is the channel’s own folder, not the per-version data folder (--wavedata,AGENTMUX_DATA_DIR): a srv that deferred is usually upgraded next, and the new version must still find the rows the old one kept.- read_
all - The entries in the file at
path, oldest first; lines that don’t parse are skipped. - record
- Queue
entryfor the audit file. Nothing happens beforeinstall. - shared_
path_ for_ reading - The shared file to read, whether or not this srv may write to it: a srv that gave the folder up still lists what the account’s other srvs recorded.
- write_
path - Where this srv appends: the shared file, or its own when it doesn’t use the shared folder.