sequenceDiagram
  participant S as LSP Server / StdioTransport
  participant R as FrameReader
  participant P as LspMessage

  S->>R: "Content-Length: 45\n\n"
  R->>R: Parse header → extract Content-Length

  S->>R: {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{...}}
  R->>R: Read exactly 45 bytes

  R->>P: parse_frame(buf) → Frame(json_bytes)
  P->>P: serde_json::from_slice → LspMessage::Notification

  alt Invalid
    P-->>R: Error (Protocol | JsonParse)
  end

  Note over R,P: MAX_BODY_SIZE = 16 MB
