Skip to main content

validate_message

Function validate_message 

Source
pub fn validate_message(raw: &str) -> Result<AdmittedMessage>
Expand description

Validate one JSON document as an agent-wait/v0 message.

This function and validate_raw_documents are the only contract-admission path. Public serde::Deserialize on AgentWaitMessage can bypass schema and normative checks. Callers must not treat serde_json::from_str as admission.

File validation handles one message. Use validate_raw_documents when checking a directory or other multi-document set (revision freeze, fairness, ack/retention).

Entry is raw JSON so JCS uniqueness is checked before any typed value path can collapse duplicate keys.