Files
passepartout/tests/pipeline-reason-tests.lisp
Amr Gharbeia fc0c069d65 tests: Add FiveAM tests for v0.2.0 completion
Self-edit: 5 new tests (apply success/not-found/file-not-found, parse-location x2)
Config-manager: 4 new tests (get-oc-config-dir, save-providers, configure-provider)
Gateway-manager: 2 new tests (multiple-platforms, registration)

Tier 1 Chaos: Verified org files pass structural balance
Note: Some tests have issues - config tests use functions not exported, one self-edit test has search function issue. Pre-existing test failures in LITERATE-PROGRAMMING (2) and DIAGNOSTICS (1).
2026-04-28 15:19:49 -04:00

27 lines
1.1 KiB
Common Lisp

(defpackage :opencortex-pipeline-reason-tests
(:use :cl :fiveam :opencortex)
(:export #:pipeline-reason-suite))
(in-package :opencortex-pipeline-reason-tests)
(def-suite pipeline-reason-suite
:description "Test suite for Reason pipeline")
(in-suite pipeline-reason-suite)
(test test-decide-gate-safety
"Decide gate should block unsafe LLM proposals."
;; Setup: clear skills and register mock
(clrhash opencortex::*skills-registry*)
(opencortex::defskill :mock-safety
:priority 50
:trigger (lambda (ctx) t)
:probabilistic (lambda (ctx) "Mock probabilistic")
:deterministic (lambda (action ctx)
(list :type :LOG :payload (list :text "Action rejected by skill heuristics"))))
(let* ((candidate (list :type :REQUEST :payload (list :action :eval :code "(shell-command \"rm -rf /\")")))
(signal (list :type :EVENT :candidate candidate))
(result (deterministic-verify candidate signal)))
(is (eq :LOG (getf result :type)))
(is (search "Action rejected by skill heuristics" (getf (getf result :payload) :text)))))