wip: paren balance fixes in policy blocks + engineering standards scaffolding
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 16s
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 16s
- Fix unbalanced parens in org-skill-policy.org (8 blocks) - Add org-skill-engineering-standards.lisp scaffolding - Add org-skill-self-fix.lisp helper - Add test runners and tool-permissions tests Note: Some fixes may be over-corrections. Full structural audit needed.
This commit is contained in:
@@ -10,25 +10,25 @@
|
||||
(in-suite emacs-edit-suite)
|
||||
|
||||
(test id-generation
|
||||
(let ((id1 (opencortex:emacs-edit-generate-id))
|
||||
(id2 (opencortex:emacs-edit-generate-id)))
|
||||
(let ((id1 (emacs-edit-generate-id))
|
||||
(id2 (emacs-edit-generate-id)))
|
||||
(is (plusp (length id1)))
|
||||
(is (not (string= id1 id2)))))
|
||||
(is (not (string= id1 id2)))) ;; Likely unique
|
||||
|
||||
(test id-format
|
||||
(let ((formatted (opencortex:emacs-edit-id-format "abc12345")))
|
||||
(let ((formatted (emacs-edit-id-format "abc12345")))
|
||||
(is (search "id:" formatted))))
|
||||
|
||||
(test property-setter
|
||||
(let ((ast (list :type :headline
|
||||
:properties (list :ID "id:test123" :TITLE "Test")
|
||||
:contents nil)))
|
||||
(opencortex:emacs-edit-set-property ast "id:test123" :STATUS "ACTIVE")
|
||||
(emacs-edit-set-property ast "id:test123" :STATUS "ACTIVE")
|
||||
(is (string= (getf (getf ast :properties) :STATUS) "ACTIVE"))))
|
||||
|
||||
(test todo-setter
|
||||
(let ((ast (list :type :headline
|
||||
:properties (list :ID "id:todo001" :TITLE "Task")
|
||||
:contents nil)))
|
||||
(opencortex:emacs-edit-set-todo ast "id:todo001" "DONE")
|
||||
(is (string= (getf (getf ast :properties) :TODO) "DONE"))))
|
||||
(emacs-edit-set-todo ast "id:todo001" "DONE")
|
||||
(is (string= (getf (getf ast :properties) :TODO) "DONE"))))
|
||||
|
||||
40
tests/tool-permissions-tests.lisp
Normal file
40
tests/tool-permissions-tests.lisp
Normal file
@@ -0,0 +1,40 @@
|
||||
(defpackage :opencortex-tool-permissions-tests
|
||||
(:use :cl :fiveam :opencortex)
|
||||
(:export #:tool-permissions-suite))
|
||||
|
||||
(in-package :opencortex-tool-permissions-tests)
|
||||
|
||||
(def-suite tool-permissions-suite
|
||||
:description "Tests for Tool Permission Tiers.")
|
||||
|
||||
(in-suite tool-permissions-suite)
|
||||
|
||||
(test default-permission-is-allow
|
||||
"Unknown tools default to :allow."
|
||||
(is (eq (get-tool-permission :unknown-tool-xyz) :allow)))
|
||||
|
||||
(test set-and-get-permission
|
||||
"Verify :allow, :deny, :ask persist correctly."
|
||||
(set-tool-permission :test-tool-abc :deny)
|
||||
(is (eq (get-tool-permission :test-tool-abc) :deny))
|
||||
(set-tool-permission :test-tool-abc :ask)
|
||||
(is (eq (get-tool-permission :test-tool-abc) :ask))
|
||||
(set-tool-permission :test-tool-abc :allow)
|
||||
(is (eq (get-tool-permission :test-tool-abc) :allow)))
|
||||
|
||||
(test permission-gate-allow
|
||||
":allow returns :allow."
|
||||
(set-tool-permission :gate-allow-tool :allow)
|
||||
(is (eq (check-tool-permission-gate :gate-allow-tool nil) :allow)))
|
||||
|
||||
(test permission-gate-deny
|
||||
":deny returns :deny."
|
||||
(set-tool-permission :gate-deny-tool :deny)
|
||||
(is (eq (check-tool-permission-gate :gate-deny-tool nil) :deny)))
|
||||
|
||||
(test permission-gate-ask
|
||||
":ask returns a signal list."
|
||||
(set-tool-permission :gate-ask-tool :ask)
|
||||
(let ((result (check-tool-permission-gate :gate-ask-tool nil)))
|
||||
(is (listp result))
|
||||
(is (eq (car result) :ask))))
|
||||
Reference in New Issue
Block a user