Skip to content

Releases: jhlee0409/proc-janitor

v0.8.1

15 Feb 20:58

Choose a tag to compare

Release v0.8.1


Install

macOS (Apple Silicon)

curl -fsSL https://raw.githubusercontent.com/jhlee0409/proc-janitor/main/scripts/install-binary.sh | sh

Homebrew

brew install jhlee0409/tap/proc-janitor

Cargo

cargo install proc-janitor

Manual download: Pick the archive for your platform below, extract, and place proc-janitor in your PATH.

v0.8.0

09 Feb 01:54

Choose a tag to compare

What's New

New Commands

  • restart - Stop + start the daemon in one command (--foreground, --dry-run supported)
  • reload - Send SIGHUP to reload config without restarting the daemon
  • stats [--days N] - Query cleanup statistics from stats.jsonl (default: last 7 days, supports --json)

New Flags

  • clean --min-age SECS - Only clean orphans older than N seconds
  • tree --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...v0.8.0

v0.7.0

06 Feb 07:55

Choose a tag to compare

What's New

Daemon Dry-Run Mode

  • start --dry-run/-d scans and logs what would be killed without sending signals — perfect for testing new patterns

Config Edit Retry Loop

  • config edit now 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.jsonl automatically rotates to stats.jsonl.old when 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

06 Feb 07:40

Choose a tag to compare

What's New

Watch Mode

  • scan --watch 5 continuously monitors for orphans at a configurable interval with live-updating display

Interactive Clean

  • clean --interactive prompts 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.jsonl as append-only JSON Lines for auditing and analysis

Full Changelog: v0.5.1...v0.6.0

v0.5.1

06 Feb 06:59

Choose a tag to compare

Fixed

  • --quiet flag now produces minimal output: PIDs only for scan, successful/total counts for clean

Full Changelog: v0.5.0...v0.5.1

v0.5.0

06 Feb 06:53

Choose a tag to compare

Added

  • version command — shows version, license, and repository info
  • --quiet / -q global flag — suppress non-essential output (spinners, hints). Useful for scripts and cron jobs.
  • config validate subcommand — validate configuration file and show summary without running anything
  • Man page auto-generation — via clap_mangen in build.rs
  • Homebrew formula (Formula/proc-janitor.rb) for brew install distribution
  • systemd user service file (resources/proc-janitor.service) for Linux
  • Standalone scripts/uninstall.sh convenience script

Install / Upgrade

cargo install proc-janitor

Full Changelog: v0.4.1...v0.5.0

v0.4.1

06 Feb 06:33

Choose a tag to compare

Improved

  • Show helpful hint when no target patterns are configured and scan/clean finds nothing
  • Guides users to run proc-janitor config init to set up targets
  • No double config loading — uses targets_configured field on ScanResult/CleanSummary

Full Changelog: v0.4.0...v0.4.1

v0.4.0: Deduplicate scan/clean, add selective filters

06 Feb 05:26

Choose a tag to compare

Breaking Changes

  • scan --execute removedscan is now detection-only (never kills processes)
  • clean --dry-run removed — use scan to preview, clean to execute
  • JSON schema changes:
    • scan output: removed cleaned_count and executed fields
    • clean output: removed dry_run field

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 pattern

Added

  • 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.md documentation across all directories

Changed

  • scan and clean fully separated: scan detects, clean executes
  • Daemon loop calls scan then clean as explicit separate phases
  • PID filter uses HashSet for O(1) lookup
  • --pattern validated 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

06 Feb 05:28

Choose a tag to compare

Security Hardening & New Commands

Added

  • doctor command with 8-point health diagnostics (config, daemon, sessions, permissions)
  • completions command for shell completion generation (bash, zsh, fish, powershell)
  • config init with smart process detection and preset system (claude, dev, minimal)
  • config edit command to edit config in $EDITOR
  • config env command to show environment variable overrides
  • dashboard --live mode with auto-refresh
  • Short flags for common options (-f, -d, -t, -e, -j, -n, -l)
  • kill.rs module with unified process termination logic, system PID guards, and PID reuse mitigation
  • util.rs module 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_NOFOLLOW atomic file operations
  • Fix XSS vulnerability in HTML dashboard with proper HTML and JSON escaping
  • Fix command injection in $EDITOR validation
  • Add exclusive file locking across session store read-modify-write cycles
  • Harden directory permissions to 0o700 (owner-only)
  • Add CORS crossorigin attribute to external CDN scripts
  • Protect system PIDs (0, 1, 2) from termination

Changed

  • Native Rust log tailing replaces external tail command dependency
  • System instance reuse reduces redundant system calls in scan loop
  • Targeted single-PID refresh via ProcessesToUpdate instead 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 $HOME is 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

05 Feb 04:18
bee32bb

Choose a tag to compare

JSON Output & Bug Fixes

Added

  • JSON output support for status, config show, scan, and clean commands via --json / -j flag
  • Global --json option 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