Skip to main content

Module record_events

Module record_events 

Source
Expand description

Events for the record AgentMux keeps on this computer (docs/specs/SPEC_LONG_RUNNING_ZERO_DEGRADATION_2026_11_16.md §6, task #47820): a stall of the host’s UI thread or of srv’s runtime, written as one JSON line in a file for its month, events-YYYY-MM.jsonl, next to the record’s days. srv reads them back (backend::record); the window host, a process of its own, writes the ones it sees from here, so the writer is in this crate.

A line is {"t": ms, "kind": "ui_stall", ...numbers}: numbers and stable names only, never a title or a path.

Functions§

append_event
Append an event of kind at t_ms to dir’s file for the month. fields is a JSON object of numbers and short names; t and kind are added to it. BLOCKING (a file append). Errors are the caller’s to log; an event is never a reason for anything else to fail.
file_name
The file for the month of t_ms: events-2026-11.jsonl.
month_of_file
Whether name is an events file, and the month it holds as 2026-11.
record_dir
Where this AgentMux keeps its record: the record folder of its channel (of a dev build’s own folder). Not the data folder: an installed AgentMux has one of those per version, and the record must outlast an upgrade.
record_dir_in
record_dir for the folders in paths.