pub fn new_run_id(agent_name: &str) -> StringExpand description
Generate a unique run ID: <agent_name>-<timestamp>-<random>.
The suffix is random, not derived. A derived suffix like
(now ^ (now >> 16) ^ counter) over a process-local counter defends a
lev run --count N batch inside one process but degenerates to a pure
function of the current second across separate processes: three concurrent
lev run invocations all mint fetcher-1785127214-8b48 and silently share
one run directory. Nothing downstream detects that - create_dir_all is a
no-op on an existing directory and the persistence worker then
last-writer-wins over meta.json / context.json / run.lvr, interleaving
two runs’ state irrecoverably.
The <name>-<secs>-<hex> shape is preserved: the timestamp keeps IDs sorting
and reading chronologically, and the dashboard’s short-ID display
(split('-').next_back()) still lands on the unique component.