fix!: re-exec config preservation, protocol state names, test coverage#8
Merged
fix!: re-exec config preservation, protocol state names, test coverage#8
Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
Fix the non-detached `hm run` re-exec path to preserve all resolved config. The supervisor now serializes the full Config to a temp TOML file and passes it via --config, preserving [[env]], classifier thresholds, kill_process_group, session_env_var, and log_filter across the re-exec boundary. The temp config is cleaned up by CleanupGuard on session exit. - Fix to_detach_args() to serialize full resolved config to temp file instead of reconstructing CLI flags (which dropped env, classifier thresholds, and other config-only state) - Fix hm status state-name rendering: use protocol-global state names instead of local classifier config, preventing "unknown" for valid states when classifier configs differ between session and client - Add protocol::state_name() for protocol-level state byte mapping - Remove state_name from StateClassifier trait (test-only now) - Add Config::to_toml() with Serialize for Config, ClassifierConfig, EnvVar for round-trip config serialization - Add CleanupGuard config_path for ephemeral config file cleanup - Extract pure logic from pty.rs: prepare_argv(), prepare_env(), signal_target() — unit testable without fork/exec - Refactor terminal.rs rendering to accept generic AsyncWrite for testability — tests now call real draw_status_bar, setup_status_bar, resize_status_bar, reset_scroll_region instead of shadow copies - Add kill_process_group semantic tests: grandchild survives with false, dies with true (setsid isolation for clean signal contract) - Add subscribed-mode socket tests: input, status, resize, kill, and unknown frames while subscribed - Add non-detached re-exec e2e tests: env injection, session_env_var, kill_process_group all survive the re-exec path (Python/pexpect) - Add merge_run_args unit tests: CLI/config precedence, classifier switch, defaults, unknown classifier error - Fix codecov badge token in README - Add .gitignore entries for profraw and lcov.info - Add libc dev-dependency for process-group tests - 254 tests (181 unit + 73 integration), 92% coverage, 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 runre-exec to preserve all resolved config (including[[env]], classifier thresholds,kill_process_group) via temp TOML serialization instead of reconstructing CLI flagshm statusstate-name rendering to use protocol-global names instead of local classifier configpty.rs(prepare_argv,prepare_env,signal_target) for unit testabilityterminal.rsrendering to accept genericAsyncWrite— tests now call real functionsTest plan
cargo test— 181 unit + 73 integration, all passingcargo clippy --tests -- -W clippy::all— zero warningscargo fmt -- --check— cleanuv run pytest tests/ -v— 22 Python tests passingjust cov— 92% line coverage[[env]]