Skip to main content

Module liveness

Module liveness 

Source
Expand description

Process-liveness tracking via OS advisory locks.

Each session holds an exclusive flock on .oxicode/issues/.alive/<session_id>. The lock is released by the OS when the process exits (including crashes and kill -9). This lets us answer “is session X still alive?” without any wall-clock timeout, PID-recycling heuristics, or heartbeats.

Structs§

AliveGuard
RAII guard for an acquired alive-lock.

Constants§

ORPHAN_AGE_SECS
Minimum age (seconds) a dead alive-lock file must reach before reaping.
TUI_OWNERSHIP_ID
Single source of truth for the liveness identity used by the TUI (and any in-TUI operations: agent tool, /issue slash command, panel).

Functions§

acquire
Try to acquire (and hold) an exclusive advisory lock for session_id.
alive_path
Path of the alive-lock file for session_id under issues_dir.
is_session_alive
Returns true iff a live process currently holds the alive-lock for session_id. Used to decide whether an crate::store::issues::Assignment is still valid.
reap_orphans
Best-effort, idempotent cleanup of dead alive-lock files under <issues_dir>/.alive/.