fix(kernel): Hardened actuator registry and dispatch (case-insensitive, forced keywords)
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s

This commit is contained in:
2026-04-19 16:34:31 -04:00
parent 31f963243d
commit 92fd3cda14
2 changed files with 8 additions and 4 deletions

View File

@@ -1,11 +1,12 @@
(in-package :opencortex)
(defvar *actuator-registry* (make-hash-table :test 'equal)
(defvar *actuator-registry* (make-hash-table :test 'equalp)
"Global registry mapping target keywords to their physical actuator functions.")
(defun register-actuator (name fn)
"Registers an actuator function. Actuators receive: (ACTION CONTEXT)."
(setf (gethash name *actuator-registry*) fn))
(let ((key (if (keywordp name) name (intern (string-upcase (string name)) :keyword))))
(setf (gethash key *actuator-registry*) fn)))
(defun frame-message (msg-string)
"Prefixes MSG-STRING with a 6-character hex length.