fix(core): decouple process/ from sessions/ module#616
Merged
Conversation
process/cleanup.rs imported Session from sessions/, creating a bidirectional dependency between what should be a lower-level utility module and the session domain. Invert the dependency: rename cleanup_session_pid_files to cleanup_pid_files accepting &[String] (PID keys) instead of &Session. Add Session::pid_keys() method so the session-aware key extraction stays in sessions/types where it belongs. After this change, process/ has zero imports from sessions/. Closes #589
Address review findings: - Restore warn! log in pid_keys() when session has no tracked agents (diagnostic signal was accidentally dropped during refactor) - Clarify pid_keys() doc to mention empty-spawn-id edge case and potential duplicate keys for legacy agents - Reference get_pid_file_path in cleanup_pid_files doc for path format
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
process/andsessions/—process/cleanup.rsno longer importsSessioncleanup_session_pid_files→cleanup_pid_filesaccepting&[String]PID keys instead of&SessionSession::pid_keys()method to keep session-aware key extraction in the session domainAfter this change,
process/is a pure lower-level utility module with zero imports fromsessions/.Test plan
cargo fmt --checkpassescargo clippy --all -- -D warningspassescargo test --allpasses (3 pre-existing failures inresolve_self_branchtests unrelated to this change)Closes #589