fix: proto-get case-insensitive keyword lookup
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s
proto-get was using getf which does eq comparison, so :EXPLANATION from the LLM response didn't match :explanation in the policy gate. Now iterates the plist and compares uppercased strings.
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
(in-package :passepartout)
|
||||
|
||||
(defun proto-get (plist key)
|
||||
"Look up KEY in PLIST with keyword normalization."
|
||||
(getf plist (if (keywordp key) key (intern (string-upcase (string key)) :keyword))))
|
||||
"Look up KEY in PLIST with case-insensitive keyword normalization."
|
||||
(let ((key-upcase (string-upcase (string key))))
|
||||
(loop for (k v) on plist by #'cddr
|
||||
when (and (keywordp k)
|
||||
(string-equal (string k) key-upcase))
|
||||
do (return v))))
|
||||
|
||||
(defvar *actuator-registry* (make-hash-table :test 'equalp)
|
||||
"Global registry mapping target keywords to their physical actuator functions.")
|
||||
|
||||
Reference in New Issue
Block a user