newest_run_dir

Function newest_run_dir 

Source
pub fn newest_run_dir() -> Option<PathBuf>
Expand description

Find the most recently modified run directory under runs_root.

Used by bare cargo ktstr stats (no subcommand) when KTSTR_SIDECAR_DIR isn’t set: the stats command doesn’t itself run a kernel, so it can’t reconstruct the {kernel}-{project_commit} key that the test process used. Picking the newest subdirectory by mtime mirrors “show me the report from my last test run.”

Dotfile-prefixed entries (notably the flock sentinel subdirectory .locks/) are excluded via is_run_directory so the lock infrastructure cannot claim the “most recent run” bucket — .locks/’s mtime tracks per-write flock activity and would otherwise eclipse the actual newest run dir on every default-path sidecar write.