Pure handshake negotiation: given what the client speaks and what the server
supports, decide the agreed protocol version and capability set. A function,
not a state machine — identical across languages (conformance/vectors/negotiate).
Mirrors Terminalwire::V2::Negotiator.
Summary
Functions
Returns {:welcome, protocol, capabilities} or {:incompatible, min, max}.