From e2d1d9ac8fd563e21c1e5db2cccd6e7eadc30b06 Mon Sep 17 00:00:00 2001 From: Amr Gharbeia Date: Sun, 19 Apr 2026 19:47:21 -0400 Subject: [PATCH] fix(protocol): Force uppercase normalization for message types in validator --- skills/org-skill-protocol-validator.org | 2 +- src/communication-validator.lisp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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))