Skip to main content

validate_kind

Function validate_kind 

Source
pub fn validate_kind(kind: Option<&str>) -> Result<()>
Expand description

v0.7.0 #1467 — validate the optional Form-6 kind wire value.

None is Ok (the caller omitted it; the write path’s auto-classify hook or the Observation default applies). A Some(s) value is Ok iff it matches a crate::models::MemoryKind variant exactly (lowercase, case-sensitive — matching the CLI’s --kind gate). Any other Some value — wrong case ("Claim"), unknown ("bogus"), trailing whitespace ("claim "), or empty ("") — is rejected so all three write surfaces (CLI, HTTP, MCP) agree instead of two silently data-lossing the field where the third rejects it.