Repository navigation
docs(design): evaluate type-state pattern for protocol-negotiation phases (#2134) - #4208
Merged
Merged
Conversation
…ases (#2134) Survey the six state machines in the protocol and daemon negotiation paths (SessionState, DynamicProtocolState, ProtocolState<P>, NegotiationPipeline<S>, setup_protocol, handle_legacy_session) with file:line citations, sketch a DaemonConnection<S> shape for the legacy handshake, and recommend selective adoption: type-state the daemon connection lifecycle and the setup_protocol negotiation prologue, keep the runtime enums as registry/observability mirrors, and reject for the multi-thread transfer phase.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…ases (#2134) (#4208) Survey the six state machines in the protocol and daemon negotiation paths (SessionState, DynamicProtocolState, ProtocolState<P>, NegotiationPipeline<S>, setup_protocol, handle_legacy_session) with file:line citations, sketch a DaemonConnection<S> shape for the legacy handshake, and recommend selective adoption: type-state the daemon connection lifecycle and the setup_protocol negotiation prologue, keep the runtime enums as registry/observability mirrors, and reject for the multi-thread transfer phase.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…ases (#2134) (#4208) Survey the six state machines in the protocol and daemon negotiation paths (SessionState, DynamicProtocolState, ProtocolState<P>, NegotiationPipeline<S>, setup_protocol, handle_legacy_session) with file:line citations, sketch a DaemonConnection<S> shape for the legacy handshake, and recommend selective adoption: type-state the daemon connection lifecycle and the setup_protocol negotiation prologue, keep the runtime enums as registry/observability mirrors, and reject for the multi-thread transfer phase.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…ases (#2134) (#4208) Survey the six state machines in the protocol and daemon negotiation paths (SessionState, DynamicProtocolState, ProtocolState<P>, NegotiationPipeline<S>, setup_protocol, handle_legacy_session) with file:line citations, sketch a DaemonConnection<S> shape for the legacy handshake, and recommend selective adoption: type-state the daemon connection lifecycle and the setup_protocol negotiation prologue, keep the runtime enums as registry/observability mirrors, and reject for the multi-thread transfer phase.
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
docs/design/typestate-protocol-negotiation.mdcovering task Generate CLI parity matrix from help output #2134.SessionState(session_registry.rs:35),DynamicProtocolState::Phase(dynamic.rs:12),ProtocolState<P>(typestate.rs:14),NegotiationPipeline<S>(compress/type_state.rs:73),setup_protocol(transfer/setup/mod.rs:67),handle_legacy_session(daemon/sections/session_runtime.rs:206) plus the async session atasync_session/session.rs:118.DaemonConnection<S>for the legacy handshake (Greeting -> ModuleSelect -> Authenticating -> Transferring -> Closing), enumerates pros (compile-time ordering, no runtime branch, self-documenting carried state, correct-by-construction Drop) and cons (API surface explosion, generics in error returns, harder dynamic inspection, log/telemetry friction, refactor blast radius across legacy + async paths).setup_protocolnegotiation prologue, keepDynamicProtocolStateandSessionStateas runtime mirrors, reject for the multi-thread transfer phase.type-state-protocol-phases.md.Test plan
cargo fmt --allclean.