Skip to content

docs(design): evaluate type-state pattern for protocol-negotiation phases (#2134) - #4208

Merged
oferchen merged 1 commit into
masterfrom
docs/typestate-protocol-negotiation-2134
May 17, 2026
Merged

oferchen merged 1 commit into
masterfrom
docs/typestate-protocol-negotiation-2134

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds docs/design/typestate-protocol-negotiation.md covering task Generate CLI parity matrix from help output #2134.
  • Surveys six state machines in the protocol and daemon negotiation paths with file:line citations: 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 at async_session/session.rs:118.
  • Sketches a concrete 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).
  • Opinionated recommendation: adopt for the daemon connection lifecycle and the setup_protocol negotiation prologue, keep DynamicProtocolState and SessionState as runtime mirrors, reject for the multi-thread transfer phase.
  • Cross-references Track oc-only CLI flags in parity matrix #2133, Refresh rsync parity matrix for 3.4.1 CLI snapshot #2135, Add parity test for sparse with preallocate #2136 and the pre-existing type-state-protocol-phases.md.

Test plan

  • Pure docs change; no source files touched.
  • cargo fmt --all clean.
  • No em-dashes, no banned terms in the document.

…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.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 17, 2026
@oferchen
oferchen merged commit 8f6d8e8 into master May 17, 2026
8 checks passed
@oferchen
oferchen deleted the docs/typestate-protocol-negotiation-2134 branch May 17, 2026 08:56
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant