Conversation
… hardening Decompose, harden, and document the entire supervisor stack. - Decompose monolithic main.rs into focused modules: cli.rs (clap structs, config merge), commands.rs (status/list/kill/clean), config.rs (TOML loading, classifier config), terminal.rs (ANSI, status bar, termios guard) - Per-classifier config: simple and claude classifiers carry their own parameters (idle_threshold_ms, debounce_ms) in the config enum, CLI flags override per-classifier fields - Protocol boundary discipline: strict payload length validation (== not >=), golden byte tests asserting exact wire format against documented spec, catching symmetric pack/parse bugs that round-trip tests miss - Atomic ordering audit: Relaxed→Release/Acquire for exit_code and alive flag, correct EXIT broadcast ordering (broadcast before alive=false to prevent subscribers seeing stale state) - PID file abstraction (pidfile.rs): two-line format (supervisor PID line 1, child PID line 2), flock-protected, read/write/liveness API with 14 unit tests - Consolidate scattered .sock/.pid path construction into util::socket_path() and util::pid_path() - Extract die_session_locked() with PID retry loop, /proc diagnostics (uptime, cmdline), actionable error messages - Harden stale socket cleanup: surface permission errors instead of silent failure - Hard-fail on log file creation instead of silent /dev/null fallback - Add log_filter config/CLI for per-crate tracing directives - Extract event_loop() from 130-line closure into standalone async fn - Add hm clean subcommand: orphaned log cleanup with --older-than duration (default 24h), dry-run by default, --force to delete - Eliminate hot-path allocations: BytesMut zero-copy in pty read loop, pre-allocated frame buffer in socket write path - PTY primer docs with ASCII diagrams (data flow, architecture, fork-exec sequence) - Update ARCH.md with PID file format, flock lifecycle, module map - Migrate Python attach tests to uv + pytest - Pin rust-toolchain.toml to stable channel - 187 tests (126 unit + 61 integration), all passing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hm cleansubcommand for orphaned log cleanup with retention windowlog_filterconfig/CLI for per-crate tracing directivesTest plan
cargo test— 126 unit tests passcargo test --test integration— 61 integration tests passcargo clippy -- -W clippy::all— zero warningshm cleanvalidated with 4 integration tests (remove old, preserve young, dry-run default, skip live)