refactor: extract shared kild-protocol crate for IPC message types#375
Merged
Conversation
Extract ClientMessage, DaemonMessage, and SessionInfo wire types from kild-daemon into a new kild-protocol crate with only serde/serde_json dependencies. All three consumers (kild-daemon, kild-core, kild-tmux-shim) now import typed enums from kild-protocol instead of hand-crafting JSON, eliminating protocol drift across three independent implementations. - kild-protocol: new crate with typed enums and serde roundtrip tests - kild-daemon: re-exports types from kild-protocol (zero behavior change) - kild-core: replace json!() + .get() chains with typed construction/matching - kild-tmux-shim: same typed rewrite for all IPC functions
Owner
Author
PR Review SummaryCritical Issues (2 found)
Important Issues (2 found)
Suggestions (2 found)
Strengths
Documentation Updates
Agent Results
VerdictNEEDS FIXES — 2 critical silent failures in Recommended Actions
|
Replace stringly-typed fields with compile-checked enums: - SessionInfo.status: String → SessionStatus enum (Creating, Running, Stopped) - DaemonMessage::Error.code: String → ErrorCode enum with #[serde(other)] fallback - DaemonClientError::DaemonError now carries ErrorCode for typed error matching Fix silent failures in daemon client (kild-core): - read_scrollback: base64 decode errors now surface instead of unwrap_or_default() - read_scrollback: unexpected response types return ProtocolError instead of empty vec - get_session_info: unexpected responses return ProtocolError instead of Ok(None) - get_session_status: unexpected responses warn + return ProtocolError instead of silently returning Ok(None) with misleading "completed" event name Wire format unchanged — serde rename_all ensures backward compatibility.
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
ClientMessage,DaemonMessage, andSessionInfowire types fromkild-daemoninto a new lightweightkild-protocolcrate (serde + serde_json only)json!()construction and.get()chains inkild-coreandkild-tmux-shimwith typed enum construction and pattern matchingChanges
kild-protocol(new)ClientMessage,DaemonMessage,SessionInfo+ 18 serde roundtrip testskild-daemonkild-coresend_request()accepts&ClientMessage, returnsDaemonMessagekild-tmux-shimTest plan
cargo fmt --check— cleancargo clippy --all -- -D warnings— 0 warningscargo test --all— 1655+ tests pass, 0 failurescargo build --all— full workspace buildsCloses #328