diff --git a/skills/org-skill-protocol-validator.org b/skills/org-skill-protocol-validator.org index 6686b91..a3a227c 100644 --- a/skills/org-skill-protocol-validator.org +++ b/skills/org-skill-protocol-validator.org @@ -53,7 +53,7 @@ Decouple protocol parsing (framing/unframing) from semantic validation. (unless (listp msg) (error "Communication Protocol Schema Error: Message must be a property list (got ~s)" (type-of msg))) - (let ((type (proto-get msg :type))) + (let ((type (let ((raw (proto-get msg :type))) (if (keywordp raw) (intern (string-upcase (string raw)) :keyword) raw)))) (unless (member type '(:REQUEST :EVENT :RESPONSE :LOG :STATUS)) (error "Communication Protocol Schema Error: Invalid message type '~a'" type)) diff --git a/src/communication-validator.lisp b/src/communication-validator.lisp index 31005a1..ef8831b 100644 --- a/src/communication-validator.lisp +++ b/src/communication-validator.lisp @@ -5,7 +5,7 @@ (unless (listp msg) (error "Communication Protocol Schema Error: Message must be a property list (got ~s)" (type-of msg))) - (let ((type (proto-get msg :type))) + (let ((type (let ((raw (proto-get msg :type))) (if (keywordp raw) (intern (string-upcase (string raw)) :keyword) raw)))) (unless (member type '(:REQUEST :EVENT :RESPONSE :LOG :STATUS)) (error "Communication Protocol Schema Error: Invalid message type '~a'" type))