feat(v0.2.0): finalize autonomous self-editing foundation
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 3s

- Hardened actuators: Fixed path-traversal vulnerabilities in file I/O tools and blocked .org files from regex replacements to force AST usage. Enforced Merkle snapshots on AST edits.
- Implemented Reflection Loops: Injected rejection traces from deterministic gates back into the LLM context to enable autonomous self-correction.
- Finalized tool permission tiers (ask/allow/deny) with proper LLM prompt filtering.
This commit is contained in:
2026-04-27 13:44:43 -04:00
parent c8d8f1412d
commit f1be82a00b
5 changed files with 132 additions and 39 deletions

View File

@@ -184,6 +184,7 @@ Write AST back to file preserving structure.
(defun emacs-edit-write-file (file-path ast)
"Writes AST back to FILE-PATH, preserving org structure.
Clears cache after write."
(opencortex::snapshot-memory)
(let ((org-text (emacs-edit-ast-to-org ast)))
(with-open-file (out file-path :direction :output :if-exists :supersede)
(write-string org-text out)))

View File

@@ -47,7 +47,7 @@ Tool permissions and embedding generation via multiple providers.
(case perm
(:allow :allow)
(:deny :deny)
(:ask (list :ask tool-name context))
(:ask (list :ask tool-name))
(t :allow))))
(def-cognitive-tool :get-embedding
@@ -111,10 +111,22 @@ Tool permissions and embedding generation via multiple providers.
(defskill :skill-tool-permissions
:priority 600
:trigger (lambda (c) (declare (ignore c)) nil)
;; Trigger whenever there's a tool call
:trigger (lambda (c)
(let* ((action (getf c :candidate))
(target (getf action :target)))
(or (eq target :TOOL) (eq target :tool))))
:deterministic (lambda (a c)
(let ((tool (getf (getf a :payload) :tool)))
(when tool (check-tool-permission-gate tool c)))))
(if tool
(let ((perm (check-tool-permission-gate tool c)))
(cond
((eq perm :deny)
(list :type :LOG :payload (list :text (format nil "Tool '~a' execution denied by permission tiers." tool))))
((and (listp perm) (eq (car perm) :ask))
(list :type :EVENT :status :suspended :reason :ask-permission :payload (list :tool tool :action a)))
(t a)))
a))))
#+end_src
* Test Suite