pub fn prune(path: &Path, opts: &PruneOptions) -> Result<PruneOutcome>Expand description
Prunes the log at path by age and/or size, rewriting it in place.
Non-empty lines are retained by two successive filters: age (older_than)
then size (max_size, keeping the most recent records that fit). The kept
lines are written to a same-directory temp file (0600 on unix) and
atomically renamed over the original, so a reader never sees a half-written
file. A missing log is a no-op; a no-change prune skips the rewrite (leaving
the file’s inode — and any concurrent appends — untouched).
Refuses outright when path resolves to the audit file
— regardless of who computed path, since --audit’s own refusal
(src/cli/log/prune.rs) only catches that one flag, not a
OMNI_DEV_LOG_FILE override spelled to name audit.jsonl directly, via
.., or via a symlink. Exemption from pruning is the point (ADR-0080
§11); this applies even under dry_run, since omni-dev log --audit is
the supported way to read the file.