fix: proto-get case-insensitive keyword lookup
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:
2026-05-03 20:28:10 -04:00
parent 59fef20630
commit 7dad50910f
2 changed files with 12 additions and 4 deletions

View File

@@ -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.")