Expand description
Per-run append-only event log.
Every omne run writes its lifecycle events to
.omne/var/runs/<run_id>/events.jsonl — one Event per line as
canonical JSON. There is deliberately no shared global log: each
run is its own independent stream (plan R3, Mutability notes). This
keeps parallel runs’ logs disjoint and makes Unit 13 omne status
a filesystem walk, not a parse-and-split.
Atomicity layers, in order:
- The file is opened
append + create, so eachwritecall is positioned at the current end-of-file by the kernel, not by the writer’s cached cursor. POSIX guarantees that a singlewriteup toPIPE_BUFis atomic against otherappendwriters; the event-line sizes we emit (hundreds of bytes) clear that bar comfortably. Windows’FILE_APPEND_DATAgives the same guarantee. - A per-instance
Mutex<File>serializes appends inside this process so we don’t rely on OS-level atomicity for multi-line bursts or flush ordering. - An
fs2advisory exclusive lock (same helper shape ascrate::ulid) serializes appends across processes — the MCP server planned for post-v1 and any other tool that might open the same file.
Lock acquisition uses a 5-second default budget, same as the ULID
allocator. Exceeding the budget returns Error::LockTimeout.
Structs§
- Event
Log - A long-lived writer for one run’s
events.jsonl.
Enums§
Constants§
- DEFAULT_
LOCK_ TIMEOUT - Default budget for acquiring the per-file advisory lock. Matches the ULID allocator so callers can reason about one deadline model across both subsystems.
Functions§
- enumerate_
runs - Enumerate run IDs by walking
.omne/var/runs/. - read_
run - Read every event in one run’s
events.jsonl, in order. - run_
exists - Check whether a run’s directory exists. Convenience for preflight
paths (
omne runcollision detection,omne statuslookup) that want a typed boolean rather than aread_dirprobe.