Verified that all cleanup mechanisms are properly implemented:
- Orphan cleanup on startup (10-minute threshold)
- CleanupGuard for automatic RAII cleanup
- Global cleanup before process::exit()
- Idempotent cleanup with retry logic
All exit paths covered:
- Normal exit (success/error)
- Timeout exit
- Signal interruption (SIGINT/SIGTERM)
- Watchdog timeout
- Panic
- Early returns
All tests passing. No orphaned temp directories found.
Bead-Id: bf-2w7
- Add cleanup_performed flag to HookInstaller for idempotent cleanup
- Add Drop implementation to HookInstaller for automatic cleanup
- Enhance cleanup() to explicitly remove both FIFO and temp directory
- Ensure temp dirs are cleaned up on normal exit, error, timeout, signals, and panic
- cleanup_orphans() already called at startup to sweep stale temp dirs
Co-Authored-By: Claude <noreply@anthropic.com>
- Confirm all cleanup mechanisms are in place and working
- All 90 tests pass
- Orphan sweeping on startup, Drop guard for normal paths, global cleanup for process::exit()
- All exit paths covered: normal, error, watchdog timeout, signal interruption
Co-Authored-By: Claude <noreply@anthropic.com>
- Add cleanup_orphans() to HookInstaller: sweeps stale claude-print-* dirs on startup
- Add cleanup() method to HookInstaller: explicitly removes FIFO and temp dir artifacts
- Add CleanupGuard struct in session.rs: ensures cleanup via Drop on all exit paths
- Call cleanup_orphans() in HookInstaller::new() on each invocation
This prevents orphaned temp directories from accumulating after crashes,
timeouts, or signal interruptions.
Co-Authored-By: Claude <noreply@anthropic.com>
Bead-Id: bf-2w7