FEAT: Implement Lisp Repair Syntax Gate

This commit is contained in:
2026-04-11 14:29:42 -04:00
parent 7eff65505a
commit 855157ccc6
8 changed files with 205 additions and 2 deletions

View File

@@ -129,7 +129,14 @@ To call a tool, you MUST use:
(let ((regs (nth-value 1 (cl-ppcre:scan-to-strings "(?s)```(?:lisp)?\\n?(.*?)\\n?```" raw-thought))))
(if (and regs (> (length regs) 0)) (elt regs 0) raw-thought))
(string-trim '(#\Space #\Newline #\Tab) raw-thought))))
(suggestion (ignore-errors (read-from-string cleaned-thought))))
(suggestion (handler-case (read-from-string cleaned-thought)
(error (c)
(if (and (member :skill-lisp-repair *loaded-skills*)
(fboundp 'repair-lisp-syntax))
(repair-lisp-syntax cleaned-thought (format nil "~a" c))
(progn
(kernel-log "SYSTEM 1 ERROR: Invalid output format from LLM.~%")
nil))))))
(kernel-log "SYSTEM 1 Suggestion: ~a~%" cleaned-thought)
(when (and suggestion (listp suggestion))
(push suggestion suggestions))))