Write apps/backend/docs/concepts-protocol-negotiation.md covering lib/capabilities.ts and services/e2eeProtocol.ts: how a device advertises supported protocols at registration, how normalizeCapabilities defaults an older client to the sealed-box baseline, how a sender picks a mutually-supported protocol, and how checkEnvelopeProtocols rejects an envelope whose declared protocol the recipient device does not support.
Acceptance criteria:
- Documents the capability payload shape and the
BASELINE_PROTOCOL default for clients predating the field
- Explains the per-envelope
protocol column and why it is recorded per envelope rather than per device
- Documents the
protocol_mismatch rejection and what a client should do on receiving it
- Explains how this enables a staged sealed-box → Signal rollout without breaking older clients
Write
apps/backend/docs/concepts-protocol-negotiation.mdcoveringlib/capabilities.tsandservices/e2eeProtocol.ts: how a device advertises supported protocols at registration, hownormalizeCapabilitiesdefaults an older client to the sealed-box baseline, how a sender picks a mutually-supported protocol, and howcheckEnvelopeProtocolsrejects an envelope whose declared protocol the recipient device does not support.Acceptance criteria:
BASELINE_PROTOCOLdefault for clients predating the fieldprotocolcolumn and why it is recorded per envelope rather than per deviceprotocol_mismatchrejection and what a client should do on receiving it