lib/validateMessagePayload.ts is the shared validator used by the REST send path and the main send_message socket handler. send_file_message has its own inline, weaker checks and never calls the shared validator, so file messages skip the envelope-presence rule entirely.
Acceptance criteria:
send_file_message calls the same validateMessagePayload the other send paths use
- Land this together with the envelope-migration issue — the file-type rule requires envelopes and
send_file_message doesn't create any yet in isolation
lib/validateMessagePayload.ts remains the single source of truth for send-payload validity, referenced by every send path
lib/validateMessagePayload.tsis the shared validator used by the REST send path and the mainsend_messagesocket handler.send_file_messagehas its own inline, weaker checks and never calls the shared validator, so file messages skip the envelope-presence rule entirely.Acceptance criteria:
send_file_messagecalls the samevalidateMessagePayloadthe other send paths usesend_file_messagedoesn't create any yet in isolationlib/validateMessagePayload.tsremains the single source of truth for send-payload validity, referenced by every send path