fix(act): complete reconstruction of act.org to resolve catastrophic syntax failures

This commit is contained in:
2026-04-28 19:16:38 -04:00
parent 9506b23ea6
commit 224ede8cca

View File

@@ -1,4 +1,3 @@
#+PROPERTY: header-args:lisp :tangle act.lisp
#+TITLE: Stage 3: Act (act.lisp)
#+AUTHOR: Agent
#+FILETAGS: :harness:act:
@@ -18,15 +17,15 @@ The Act stage is where cognition meets reality. After the Probabilistic engine p
** Actuator Configuration
#+begin_src lisp
(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)
"List of actuators that don't generate tool-output feedback.
"List of actuators that don't generate tool-output feedback.")
(defun initialize-actuators ()
"Register core actuators and load configuration."
(let ((def (uiop:getenv "DEFAULT_ACTUATOR)
(silent (uiop:getenv "SILENT_ACTUATORS))
(let ((def (uiop:getenv "DEFAULT_ACTUATOR"))
(silent (uiop:getenv "SILENT_ACTUATORS")))
(when def
(setf *default-actuator* (intern (string-upcase def) :keyword)))
(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)
#+begin_src lisp
(defun format-tool-result (tool-name result)
"Format a tool result for human-readable display."
"Format a tool result for display."
(if (listp result)
(let ((status (getf result :status))
(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)))
(if (and (listp verified) (member (getf verified :type) '(:LOG :EVENT)) (not (member original-type '(:LOG :EVENT))))
(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 feedback verified))
(progn
@@ -166,20 +165,22 @@ The Act stage is where cognition meets reality. After the Probabilistic engine p
#+end_src
* 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
(:use :cl :fiveam :opencortex)
(:export #:pipeline-act-suite))
(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)
(test test-act-gate-basic
"Verify that act-gate proceeds normally when no skill intercepts."
(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)))
(is (eq :acted (getf signal :status)))
(is (null result))))