Releases: jhlee0409/proc-janitor
Releases · jhlee0409/proc-janitor
v0.8.1
Release v0.8.1
Install
macOS (Apple Silicon)
curl -fsSL https://raw.githubusercontent.com/jhlee0409/proc-janitor/main/scripts/install-binary.sh | shHomebrew
brew install jhlee0409/tap/proc-janitorCargo
cargo install proc-janitorManual download: Pick the archive for your platform below, extract, and place proc-janitor in your PATH.
v0.8.0
What's New
New Commands
restart- Stop + start the daemon in one command (--foreground,--dry-runsupported)reload- Send SIGHUP to reload config without restarting the daemonstats [--days N]- Query cleanup statistics fromstats.jsonl(default: last 7 days, supports--json)
New Flags
clean --min-age SECS- Only clean orphans older than N secondstree --pattern REGEX- Filter process tree by regex pattern
Improvements
- Signal handler hardening - AtomicBool guard prevents double-shutdown race condition
- Session auto-clean - Dry-run now shows actual target PIDs instead of just session metadata
- 6 new integration tests (94 total: 72 unit + 22 integration)
Full Changelog
v0.7.0
What's New
Daemon Dry-Run Mode
start --dry-run/-dscans and logs what would be killed without sending signals — perfect for testing new patterns
Config Edit Retry Loop
config editnow re-opens the editor when validation fails, instead of leaving a broken config
Scanner Optimization
- Merged 3-pass process table scan into 2-pass (root detection in single pass) — faster on large process tables
Stats File Rotation
stats.jsonlautomatically rotates tostats.jsonl.oldwhen it exceeds 5 MB
Shared Descendant Finder
- Deduplicated process tree traversal logic between scanner and session modules
Expanded Test Coverage
- 14 new config boundary tests (min/max values, pattern count/length limits)
- 6 new integration tests (version, doctor, config validate, dry-run daemon, quiet modes)
- 88 total tests (72 unit + 16 integration)
Full Changelog: v0.6.0...v0.7.0
v0.6.0
What's New
Watch Mode
scan --watch 5continuously monitors for orphans at a configurable interval with live-updating display
Interactive Clean
clean --interactiveprompts for confirmation before killing each process — great for selective cleanup
Process Details
- Scan output now shows memory usage and uptime for each orphaned process (e.g.,
267.0 MB 2h 14m)
Daemon Config Auto-Reload
- The daemon detects config file changes via mtime and automatically reloads — no restart needed
Desktop Notifications (macOS)
- Native Notification Center alerts when the daemon cleans orphaned processes
Cleanup Statistics
- Every cleanup is recorded to
~/.proc-janitor/stats.jsonlas append-only JSON Lines for auditing and analysis
Full Changelog: v0.5.1...v0.6.0
v0.5.1
Fixed
--quietflag now produces minimal output: PIDs only forscan,successful/totalcounts forclean
Full Changelog: v0.5.0...v0.5.1
v0.5.0
Added
versioncommand — shows version, license, and repository info--quiet/-qglobal flag — suppress non-essential output (spinners, hints). Useful for scripts and cron jobs.config validatesubcommand — validate configuration file and show summary without running anything- Man page auto-generation — via
clap_mangeninbuild.rs - Homebrew formula (
Formula/proc-janitor.rb) forbrew installdistribution - systemd user service file (
resources/proc-janitor.service) for Linux - Standalone
scripts/uninstall.shconvenience script
Install / Upgrade
cargo install proc-janitorFull Changelog: v0.4.1...v0.5.0
v0.4.1
Improved
- Show helpful hint when no target patterns are configured and
scan/cleanfinds nothing - Guides users to run
proc-janitor config initto set up targets - No double config loading — uses
targets_configuredfield on ScanResult/CleanSummary
Full Changelog: v0.4.0...v0.4.1
v0.4.0: Deduplicate scan/clean, add selective filters
Breaking Changes
scan --executeremoved —scanis now detection-only (never kills processes)clean --dry-runremoved — usescanto preview,cleanto execute- JSON schema changes:
scanoutput: removedcleaned_countandexecutedfieldscleanoutput: removeddry_runfield
Migration Guide
# Before (v0.3.0)
proc-janitor scan --execute # scan + kill
proc-janitor clean --dry-run # preview only
# After (v0.4.0)
proc-janitor scan # preview only (safe)
proc-janitor clean # kill all orphans
proc-janitor clean --pid 123 # kill specific PID
proc-janitor clean -m 'node' # kill by patternAdded
clean --pid(-p) — kill only specific orphan PIDs (space-separated)clean --pattern(-m) — kill only orphans matching a regex pattern- Filter intersection:
--pid+--pattern= only orphans matching both - Warning when filters specified but no orphans match
- 3 new integration tests (70 total: 60 unit + 10 integration)
- Hierarchical
AGENTS.mddocumentation across all directories
Changed
scanandcleanfully separated: scan detects, clean executes- Daemon loop calls scan then clean as explicit separate phases
- PID filter uses
HashSetfor O(1) lookup --patternvalidated with 1024-char length limit (ReDoS mitigation)- MSRV-compatible: Rust 1.70+ safe (no
is_none_or)
Fixed
- Process tree box alignment and formatting
- Status command JSON output enriched with daemon metadata
- Session validation hardened for orphan tree detection
- Pre-existing clippy warnings cleaned up
Full Changelog: v0.3.0...v0.4.0
v0.3.0: Security hardening, new commands, and open-source readiness
Security Hardening & New Commands
Added
doctorcommand with 8-point health diagnostics (config, daemon, sessions, permissions)completionscommand for shell completion generation (bash, zsh, fish, powershell)config initwith smart process detection and preset system (claude,dev,minimal)config editcommand to edit config in$EDITORconfig envcommand to show environment variable overridesdashboard --livemode with auto-refresh- Short flags for common options (
-f,-d,-t,-e,-j,-n,-l) kill.rsmodule with unified process termination logic, system PID guards, and PID reuse mitigationutil.rsmodule with symlink-safe file writes (O_NOFOLLOW)- Session tracking with
TrackedPid(PID + start_time) for identity verification - Environment variable overrides for all config options with bounds checking
- Path security validation (directory traversal and system path blocking)
- Subresource Integrity (SRI) hash verification for CDN scripts in dashboard
- GitHub Actions CI workflow (test, clippy, fmt on macOS + Linux)
- CONTRIBUTING.md, SECURITY.md, issue templates, and PR template
- 33 new unit tests across 6 modules (42 → 75 total)
Security
- Eliminate TOCTOU race conditions in config writes, PID file creation, log redirection, and dashboard generation
- Add symlink attack prevention via
O_NOFOLLOWatomic file operations - Fix XSS vulnerability in HTML dashboard with proper HTML and JSON escaping
- Fix command injection in
$EDITORvalidation - Add exclusive file locking across session store read-modify-write cycles
- Harden directory permissions to
0o700(owner-only) - Add CORS
crossoriginattribute to external CDN scripts - Protect system PIDs (0, 1, 2) from termination
Changed
- Native Rust log tailing replaces external
tailcommand dependency Systeminstance reuse reduces redundant system calls in scan loop- Targeted single-PID refresh via
ProcessesToUpdateinstead of full process table refresh - Scanner preserves grace period state across scan cycles
- Daemon owns Scanner instance for persistent state
- Config loading uses safe fallback when
$HOMEis unavailable - Improved error messages with
anyhow::context()throughout
Fixed
- Daemon startup race condition (EDEADLK from duplicate PID file locking)
- Session lock contention under concurrent access
- UTF-8 string truncation panic on multi-byte characters
- Dashboard rendering issues with process graph visualization
- Signal handler output redirected to stderr for safety
Full Changelog: v0.2.0...v0.3.0
v0.2.0
JSON Output & Bug Fixes
Added
- JSON output support for
status,config show,scan, andcleancommands via--json/-jflag - Global
--jsonoption for machine-readable output - Documentation for JSON output in README
Fixed
- Daemon startup error (errno 35 - EDEADLK) caused by duplicate PID file locking
- Session track command now returns proper error for invalid session IDs
- 3 clippy warnings (manual range contains, collapsible else-if)
- 100+ code formatting violations
Changed
- Improved error handling for session commands
- Code now follows Rust best practices (clippy clean, rustfmt compliant)
Full Changelog: v0.1.0...v0.2.0