ARCH: Clean Core Refactor & Terminology Alignment

This commit is contained in:
2026-04-13 09:03:42 -04:00
parent 8ee1c0c4df
commit b6b39472da
16 changed files with 163 additions and 78 deletions

View File

@@ -1,6 +1,6 @@
(in-package :org-agent)
(defun ask-neuro (prompt &key (system-prompt "You are the System 1 engine of a Neurosymbolic Lisp Machine.") (cascade nil) (context nil))
(defun ask-neuro (prompt &key (system-prompt "You are the Probabilistic Engine engine of a Neurosymbolic Lisp Machine.") (cascade nil) (context nil))
(let ((backends (cond
((listp cascade) cascade)
((functionp cascade) (funcall cascade context))
@@ -9,14 +9,14 @@
(dolist (backend backends)
(let ((backend-fn (gethash backend *neuro-backends*)))
(when backend-fn
(kernel-log "SYSTEM 1: Attempting backend ~a..." backend)
(kernel-log "PROBABILISTIC ENGINE: Attempting backend ~a..." backend)
(let* ((model (ignore-errors
(uiop:symbol-call :org-agent.skills.org-skill-economist :economist-get-model-for-provider backend)))
(result (if model
(funcall backend-fn prompt system-prompt :model model)
(funcall backend-fn prompt system-prompt))))
(kernel-log "SYSTEM 1: Backend ~a returned: ~a" backend (if (stringp result) (subseq result 0 (min 50 (length result))) result))
(kernel-log "PROBABILISTIC ENGINE: Backend ~a returned: ~a" backend (if (stringp result) (subseq result 0 (min 50 (length result))) result))
(if (and (stringp result) (search ":LOG" result) (or (search "Failure" result) (search "missing" result)))
(kernel-log "SYSTEM 1: Backend ~a failed. Falling back..." backend)
(kernel-log "PROBABILISTIC ENGINE: Backend ~a failed. Falling back..." backend)
(return-from ask-neuro result))))))
"(:type :LOG :payload (:text \"Neural Cascade Failure\"))"))