fix(act): complete reconstruction of act.org to resolve catastrophic syntax failures
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
#+PROPERTY: header-args:lisp :tangle act.lisp
|
|
||||||
#+TITLE: Stage 3: Act (act.lisp)
|
#+TITLE: Stage 3: Act (act.lisp)
|
||||||
#+AUTHOR: Agent
|
#+AUTHOR: Agent
|
||||||
#+FILETAGS: :harness:act:
|
#+FILETAGS: :harness:act:
|
||||||
@@ -18,15 +17,15 @@ The Act stage is where cognition meets reality. After the Probabilistic engine p
|
|||||||
** Actuator Configuration
|
** Actuator Configuration
|
||||||
#+begin_src lisp
|
#+begin_src lisp
|
||||||
(defvar *default-actuator* :cli
|
(defvar *default-actuator* :cli
|
||||||
"The actuator used when no explicit target is specified.
|
"The actuator used when no explicit target is specified.")
|
||||||
|
|
||||||
(defvar *silent-actuators* '(:cli :system-message :emacs)
|
(defvar *silent-actuators* '(:cli :system-message :emacs)
|
||||||
"List of actuators that don't generate tool-output feedback.
|
"List of actuators that don't generate tool-output feedback.")
|
||||||
|
|
||||||
(defun initialize-actuators ()
|
(defun initialize-actuators ()
|
||||||
"Register core actuators and load configuration."
|
"Register core actuators and load configuration."
|
||||||
(let ((def (uiop:getenv "DEFAULT_ACTUATOR)
|
(let ((def (uiop:getenv "DEFAULT_ACTUATOR"))
|
||||||
(silent (uiop:getenv "SILENT_ACTUATORS))
|
(silent (uiop:getenv "SILENT_ACTUATORS")))
|
||||||
(when def
|
(when def
|
||||||
(setf *default-actuator* (intern (string-upcase def) :keyword)))
|
(setf *default-actuator* (intern (string-upcase def) :keyword)))
|
||||||
(when silent
|
(when silent
|
||||||
@@ -114,7 +113,7 @@ The Act stage is where cognition meets reality. After the Probabilistic engine p
|
|||||||
** Tool Result Formatting (format-tool-result)
|
** Tool Result Formatting (format-tool-result)
|
||||||
#+begin_src lisp
|
#+begin_src lisp
|
||||||
(defun format-tool-result (tool-name result)
|
(defun format-tool-result (tool-name result)
|
||||||
"Format a tool result for human-readable display."
|
"Format a tool result for display."
|
||||||
(if (listp result)
|
(if (listp result)
|
||||||
(let ((status (getf result :status))
|
(let ((status (getf result :status))
|
||||||
(content (getf result :content))
|
(content (getf result :content))
|
||||||
@@ -140,7 +139,7 @@ The Act stage is where cognition meets reality. After the Probabilistic engine p
|
|||||||
(verified (deterministic-verify approved signal)))
|
(verified (deterministic-verify approved signal)))
|
||||||
(if (and (listp verified) (member (getf verified :type) '(:LOG :EVENT)) (not (member original-type '(:LOG :EVENT))))
|
(if (and (listp verified) (member (getf verified :type) '(:LOG :EVENT)) (not (member original-type '(:LOG :EVENT))))
|
||||||
(progn
|
(progn
|
||||||
(harness-log "ACT BLOCKED: Action failed last-mile deterministic check.
|
(harness-log "ACT BLOCKED: Action failed last-mile deterministic check.")
|
||||||
(setf (getf signal :approved-action) nil)
|
(setf (getf signal :approved-action) nil)
|
||||||
(setf feedback verified))
|
(setf feedback verified))
|
||||||
(progn
|
(progn
|
||||||
@@ -166,20 +165,22 @@ The Act stage is where cognition meets reality. After the Probabilistic engine p
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Test Suite
|
* Test Suite
|
||||||
#+begin_src lisp :tangle act.lisp
|
#+begin_src lisp :tangle tests/pipeline-act-tests.lisp
|
||||||
|
(eval-when (:compile-toplevel :load-toplevel :execute)
|
||||||
|
(ql:quickload :fiveam :silent t))
|
||||||
|
|
||||||
(defpackage :opencortex-pipeline-act-tests
|
(defpackage :opencortex-pipeline-act-tests
|
||||||
(:use :cl :fiveam :opencortex)
|
(:use :cl :fiveam :opencortex)
|
||||||
(:export #:pipeline-act-suite))
|
(:export #:pipeline-act-suite))
|
||||||
|
|
||||||
(in-package :opencortex-pipeline-act-tests)
|
(in-package :opencortex-pipeline-act-tests)
|
||||||
|
|
||||||
(def-suite pipeline-act-suite :description "Test suite for Act pipeline
|
(def-suite pipeline-act-suite :description "Test suite for Act pipeline")
|
||||||
(in-suite pipeline-act-suite)
|
(in-suite pipeline-act-suite)
|
||||||
|
|
||||||
(test test-act-gate-basic
|
(test test-act-gate-basic
|
||||||
"Verify that act-gate proceeds normally when no skill intercepts."
|
|
||||||
(clrhash opencortex::*skills-registry*)
|
(clrhash opencortex::*skills-registry*)
|
||||||
(let* ((signal (list :type :EVENT :status nil :depth 0 :approved-action '(:target :cli :payload (:text "Hello)))
|
(let* ((signal (list :type :EVENT :status nil :depth 0 :approved-action '(:target :cli :payload (:text "Hello"))))
|
||||||
(result (act-gate signal)))
|
(result (act-gate signal)))
|
||||||
(is (eq :acted (getf signal :status)))
|
(is (eq :acted (getf signal :status)))
|
||||||
(is (null result))))
|
(is (null result))))
|
||||||
|
|||||||
Reference in New Issue
Block a user