REFACTOR: Explanatory Core Architecture & Terminology Alignment
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
(:export #:bouncer-suite))
|
||||
(in-package :org-agent-bouncer-tests)
|
||||
|
||||
(def-suite bouncer-suite :description "Tests for System 2 Bouncer & Authorization Gate.")
|
||||
(def-suite bouncer-suite :description "Tests for Deterministic Engine Bouncer & Authorization Gate.")
|
||||
(in-suite bouncer-suite)
|
||||
|
||||
(test test-bouncer-interception
|
||||
|
||||
22
tests/lisp-validator-tests.lisp
Normal file
22
tests/lisp-validator-tests.lisp
Normal file
@@ -0,0 +1,22 @@
|
||||
(defpackage :org-agent-lisp-validator-tests
|
||||
(:use :cl :fiveam :org-agent)
|
||||
(:export #:lisp-validator-suite))
|
||||
(in-package :org-agent-lisp-validator-tests)
|
||||
|
||||
(def-suite lisp-validator-suite :description "Tests for the Lisp Validator.")
|
||||
(in-suite lisp-validator-suite)
|
||||
|
||||
(test test-basic-math-safe
|
||||
(is (org-agent:lisp-validator-validate "(+ 1 2)")))
|
||||
|
||||
(test test-blocked-eval
|
||||
(is (not (org-agent:lisp-validator-validate "(eval '(+ 1 2))"))))
|
||||
|
||||
(test test-blocked-shell
|
||||
(is (not (org-agent:lisp-validator-validate "(uiop:run-program \"ls\")"))))
|
||||
|
||||
(test test-nested-unsafe
|
||||
(is (not (org-agent:lisp-validator-validate "(let ((x 1)) (delete-file \"test.txt\"))"))))
|
||||
|
||||
(test test-safe-kernel-api
|
||||
(is (org-agent:lisp-validator-validate "(org-agent::lookup-object \"node-1\")")))
|
||||
@@ -9,7 +9,6 @@
|
||||
(defun setup-mock-skills ()
|
||||
"Register mock skills for testing."
|
||||
(clrhash org-agent::*skills-registry*)
|
||||
|
||||
(org-agent::defskill :mock-refactor
|
||||
:priority 100
|
||||
:trigger (lambda (ctx) (eq (getf (getf ctx :payload) :command) :organize-subtree))
|
||||
@@ -19,7 +18,6 @@
|
||||
:payload (:action :refactor-subtree
|
||||
:target-id nil
|
||||
:properties (("ID" . "node-123"))))))
|
||||
|
||||
(org-agent::defskill :mock-safety
|
||||
:priority 50
|
||||
:trigger (lambda (ctx) t) ; always triggers
|
||||
@@ -86,9 +84,9 @@
|
||||
|
||||
(test test-log-buffering
|
||||
"Verify that harness-log correctly populates the system logs."
|
||||
(harness-log "PSF TEST LOG")
|
||||
(harness-log "Engineering TEST LOG")
|
||||
(let ((logs (context-get-system-logs 5)))
|
||||
(is (cl:some (lambda (line) (search "PSF TEST LOG" line)) logs))))
|
||||
(is (cl:some (lambda (line) (search "Engineering TEST LOG" line)) logs))))
|
||||
|
||||
(test test-global-awareness-assembly
|
||||
"Verify that context-assemble-global-awareness reports active projects."
|
||||
@@ -103,25 +101,15 @@
|
||||
(clrhash org-agent::*object-store*)
|
||||
(clrhash org-agent::*history-store*)
|
||||
(setf org-agent::*object-store-snapshots* nil)
|
||||
|
||||
;; State A
|
||||
(ingest-ast (list :type :HEADLINE :properties (list :ID "node-1" :TITLE "State A") :contents nil))
|
||||
|
||||
(setup-mock-skills)
|
||||
;; Skill that crashes in Symbolic Gate
|
||||
(org-agent::defskill :crashing-skill
|
||||
:priority 200
|
||||
:trigger (lambda (ctx) t)
|
||||
:neuro (lambda (ctx) (list :type :REQUEST :payload (list :action :eval :code "(error \"BOOM\")")))
|
||||
:symbolic (lambda (action ctx) (error "CRASH IN SYSTEM 2")))
|
||||
|
||||
;; Run pipeline. This turn will:
|
||||
;; 1. Perceive (Take snapshot of State A)
|
||||
;; 2. Neuro (Think)
|
||||
;; 3. Decide (Crash!)
|
||||
;; 4. Rollback to State A.
|
||||
:symbolic (lambda (action ctx) (error "CRASH IN DETERMINISTIC ENGINE")))
|
||||
(process-signal (list :type :EVENT :payload (list :sensor :test)))
|
||||
|
||||
;; Verify that we are still in State A
|
||||
(let ((obj (lookup-object "node-1")))
|
||||
(is (not (null obj)))
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
(defpackage :org-agent-safety-tests
|
||||
(:use :cl :fiveam :org-agent)
|
||||
(:export #:safety-suite))
|
||||
(in-package :org-agent-safety-tests)
|
||||
|
||||
(def-suite safety-suite :description "Tests for the Global Safety Harness.")
|
||||
(in-suite safety-suite)
|
||||
|
||||
(test test-basic-math-safe
|
||||
(is (org-agent:safety-harness-validate "(+ 1 2)")))
|
||||
|
||||
(test test-blocked-eval
|
||||
(is (not (org-agent:safety-harness-validate "(eval '(+ 1 2))"))))
|
||||
|
||||
(test test-blocked-shell
|
||||
(is (not (org-agent:safety-harness-validate "(uiop:run-program \"ls\")"))))
|
||||
|
||||
(test test-nested-unsafe
|
||||
(is (not (org-agent:safety-harness-validate "(let ((x 1)) (delete-file \"test.txt\"))"))))
|
||||
|
||||
(test test-safe-kernel-api
|
||||
(is (org-agent:safety-harness-validate "(org-agent::lookup-object \"node-1\")")))
|
||||
@@ -23,7 +23,7 @@
|
||||
:neuro nil
|
||||
:symbolic (lambda (action context)
|
||||
(declare (ignore action context))
|
||||
(+ 1 \"two\"))) ; DELIBERATE BUG
|
||||
(+ 1 \"two\"))) ; DETERMINISTIC BUG
|
||||
#+end_src
|
||||
")))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user