REFAC: Standardize on Cognitive Cycle and update documentation
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
(in-package :org-agent.skills.org-skill-architect)
|
||||
(in-package :opencortex.skills.org-skill-architect)
|
||||
|
||||
(defun architect-actuate (action context)
|
||||
(declare (ignore context))
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
(if (and note-path blueprint-content)
|
||||
(progn
|
||||
(org-agent:kernel-log "ARCHITECT - Appending PROTOCOL to ~a" note-path)
|
||||
(opencortex:kernel-log "ARCHITECT - Appending PROTOCOL to ~a" note-path)
|
||||
(with-open-file (out note-path :direction :output :if-exists :append)
|
||||
(format out "~%* Phase B: Blueprint (PROTOCOL)~%:PROPERTIES:~%:STATUS: SIGNED~%:END:~%~%~a"
|
||||
blueprint-content))
|
||||
(format nil "SUCCESS - Architect established PROTOCOL in ~a" note-path))
|
||||
(progn
|
||||
(org-agent:kernel-log "ARCHITECT FAILURE - Missing path or content in action: ~a" action)
|
||||
(opencortex:kernel-log "ARCHITECT FAILURE - Missing path or content in action: ~a" action)
|
||||
nil))))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(in-package :org-agent.skills.org-skill-architect)
|
||||
(in-package :opencortex.skills.org-skill-architect)
|
||||
|
||||
(defun neuro-skill-architect (context)
|
||||
(let* ((payload (getf context :payload))
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
(in-package :org-agent.skills.org-skill-architect)
|
||||
(in-package :opencortex.skills.org-skill-architect)
|
||||
|
||||
(defun architect-scan-all-notes ()
|
||||
(let* ((notes-dir (or (uiop:getenv "MEMEX_NOTES") "/home/user/memex/notes/"))
|
||||
(files (uiop:directory-files (uiop:ensure-directory-pathname notes-dir)))
|
||||
(ready-notes '()))
|
||||
(org-agent:kernel-log "ARCHITECT - Scanning ~a files in ~a" (length files) notes-dir)
|
||||
(opencortex:kernel-log "ARCHITECT - Scanning ~a files in ~a" (length files) notes-dir)
|
||||
(dolist (file files)
|
||||
(let ((name (pathname-name file))
|
||||
(type (pathname-type file)))
|
||||
@@ -13,5 +13,5 @@
|
||||
(string-equal type "org"))
|
||||
(let ((status (architect-perceive-frozen-prd file)))
|
||||
(when status (push status ready-notes))))))
|
||||
(org-agent:kernel-log "ARCHITECT - Found ~a ready notes." (length ready-notes))
|
||||
(opencortex:kernel-log "ARCHITECT - Found ~a ready notes." (length ready-notes))
|
||||
ready-notes))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(in-package :org-agent)
|
||||
(in-package :opencortex)
|
||||
|
||||
(defun execute-openrouter-request (prompt system-prompt &key model)
|
||||
(let ((api-key (uiop:getenv "OPENROUTER_API_KEY"))
|
||||
@@ -8,7 +8,7 @@
|
||||
(kernel-log "OPENROUTER DEBUG - Using Model: ~a" model-id)
|
||||
(let* ((headers `(("Content-Type" . "application/json")
|
||||
("Authorization" . ,(format nil "Bearer ~a" api-key))
|
||||
("HTTP-Referer" . "https://github.com/amr/org-agent")))
|
||||
("HTTP-Referer" . "https://github.com/amr/opencortex")))
|
||||
(body (cl-json:encode-json-to-string
|
||||
`((model . ,model-id)
|
||||
(messages . (( (role . "system") (content . ,system-prompt) )
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(in-package :org-agent)
|
||||
(in-package :opencortex)
|
||||
|
||||
(defun ask-neuro (prompt &key (system-prompt "You are the Probabilistic Engine engine of a Neurosymbolic Lisp Machine.") (cascade nil) (context nil))
|
||||
"Dispatches a neural request through the provider cascade.
|
||||
@@ -14,7 +14,7 @@
|
||||
(kernel-log "PROBABILISTIC ENGINE: Attempting backend ~a..." backend)
|
||||
(let* (;; Consult the Economist for the model ID if the skill is available
|
||||
(model (ignore-errors
|
||||
(uiop:symbol-call :org-agent.skills.org-skill-economist :economist-get-model-for-provider backend)))
|
||||
(uiop:symbol-call :opencortex.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))))
|
||||
@@ -30,7 +30,7 @@
|
||||
(unless api-key (return-from execute-openrouter-request "(:type :LOG :payload (:text \"OpenRouter API Key missing\"))"))
|
||||
(let* ((headers `(("Content-Type" . "application/json")
|
||||
("Authorization" . ,(format nil "Bearer ~a" api-key))
|
||||
("HTTP-Referer" . "https://github.com/amr/org-agent")))
|
||||
("HTTP-Referer" . "https://github.com/amr/opencortex")))
|
||||
(body (cl-json:encode-json-to-string
|
||||
`((model . ,model-id)
|
||||
(messages . (( (role . "system") (content . ,system-prompt) )
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(in-package :org-agent)
|
||||
(in-package :opencortex)
|
||||
|
||||
(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
|
||||
@@ -11,7 +11,7 @@
|
||||
(when backend-fn
|
||||
(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)))
|
||||
(uiop:symbol-call :opencortex.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))))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(in-package :org-agent)
|
||||
(in-package :opencortex)
|
||||
|
||||
(defun think (context)
|
||||
(let ((active-skill (find-triggered-skill context)))
|
||||
@@ -25,7 +25,7 @@
|
||||
(> (length cleaned-thought) 0))
|
||||
(kernel-log "PROBABILISTIC ENGINE: SALVAGING plain-text response.~%")
|
||||
(let* ((no-prefix (cl-ppcre:regex-replace "(?i)^(okay,? |sure,? |i will |i've |i have |here is |got it\\.? |understood\\.? |done\\.? |yes,? )+" cleaned-thought "")))
|
||||
`(:target :emacs :payload (:action :insert-at-end :buffer "*org-agent-chat*" :text ,no-prefix))))
|
||||
`(:target :emacs :payload (:action :insert-at-end :buffer "*opencortex-chat*" :text ,no-prefix))))
|
||||
(t
|
||||
(kernel-log "PROBABILISTIC ENGINE ERROR: Could not parse response as Lisp plist.~%")
|
||||
nil)))
|
||||
|
||||
Reference in New Issue
Block a user