validate
Validate a SWML document against structural rules. Checks for required top-level
keys (version, sections), valid version strings, a main section, and correct
AI verb structure. Results are cached.
Parameters
swml
The SWML document as a JSON string or parsed object.
Returns
ValidationResult — An object with valid: boolean and errors: string[].