pub fn archive_phase_files(
project_root: &Path,
evidence_root: &Path,
phase: u32,
retain: usize,
) -> Result<Option<String>, Error>Expand description
Archive the prior stage’s stdout/exit captures into bounded per-phase
history instead of wiping them outright, so a false-positive self-report
can be diagnosed after the fact (16b). Replaces the old
cleanup_phase_files, which deleted these files unconditionally.
At most retain capture generations are kept per phase; older ones are
pruned (see [prune_history]). The agent-pid file is still removed
outright — it is process bookkeeping, not diagnostic output. When there
is nothing to archive (first launch), this is a no-op success.