fix(chaos): finalized absolute tangle paths via concat and INSTALL_DIR

This commit is contained in:
2026-04-28 18:22:49 -04:00
parent a2d6c5ae38
commit 357efbdb59
35 changed files with 641 additions and 641 deletions

View File

@@ -1,4 +1,4 @@
#+PROPERTY: header-args:lisp :tangle (concat (getenv "INSTALL_DIR") "/skills/org-skill-self-fix.lisp" (expand-file-name ""))
#+PROPERTY: header-args:lisp :tangle (concat (identity (getenv "INSTALL_DIR")) "/skills/org-skill-self-fix.lisp")" )
:PROPERTIES:
:ID: 65891ce2-a465-49e6-a0c1-be13d3288d55
:CREATED: [2026-03-30 Mon 21:16]
@@ -29,7 +29,7 @@ This skill enables self-editing by applying surgical fixes to files (including s
(old-code (getf payload :old))
(new-code (getf payload :new))
(is-skill (and (stringp (namestring target-file))
(search "skills/" (namestring target-file)))))
(search "" (namestring target-file)))))
(opencortex:snapshot-memory)
(opencortex:harness-log "SELF-FIX - Attempting surgical fix on ~a..." target-file)
@@ -47,19 +47,19 @@ This skill enables self-editing by applying surgical fixes to files (including s
(opencortex:harness-log "SELF-FIX - Reloading modified skill ~a..." target-file)
(if (opencortex:load-skill-from-org target-file)
(progn
(opencortex:harness-log "SELF-FIX SUCCESS - Applied and reloaded.")
(opencortex:harness-log "SELF-FIX SUCCESS - Applied and reloaded.
t)
(progn
(opencortex:harness-log "SELF-FIX FAILURE - Skill reload failed. Rolling back.")
(opencortex:harness-log "SELF-FIX FAILURE - Skill reload failed. Rolling back.
(with-open-file (out target-file :direction :output :if-exists :supersede)
(write-string content out))
(opencortex:rollback-memory 0)
nil)))
(progn
(opencortex:harness-log "SELF-FIX SUCCESS - Applied fix to file.")
(opencortex:harness-log "SELF-FIX SUCCESS - Applied fix to file.
t)))
(progn (opencortex:harness-log "SELF-FIX FAILURE - Pattern not found.") nil)))
(progn (opencortex:harness-log "SELF-FIX FAILURE - File not found.") nil))
(progn (opencortex:harness-log "SELF-FIX FAILURE - Pattern not found. nil)))
(progn (opencortex:harness-log "SELF-FIX FAILURE - File not found. nil))
(error (c)
(opencortex:harness-log "SELF-FIX CRASH - ~a. Rolling back." c)
(opencortex:rollback-memory 0)
@@ -70,13 +70,13 @@ This skill enables self-editing by applying surgical fixes to files (including s
#+begin_src lisp
(def-cognitive-tool :repair-file
"Applies a surgical code modification to a file and reloads the skill if applicable."
((:file :type :string :description "Path to the target file")
(:old :type :string :description "The literal code block to find")
(:new :type :string :description "The literal code block to replace it with"))
((:file :type :string :description "Path to the target file
(:old :type :string :description "The literal code block to find
(:new :type :string :description "The literal code block to replace it with)
:body (lambda (args)
(if (self-fix-apply (list :payload args) nil)
"REPAIR SUCCESSFUL."
"REPAIR FAILED.")))
"REPAIR FAILED.))
#+end_src
** Skill Definition
@@ -86,7 +86,7 @@ This skill enables self-editing by applying surgical fixes to files (including s
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :repair-request))
:probabilistic (lambda (context)
(format nil "You are the opencortex Repair Actuator. Synthesize a surgical fix for the reported failure.
Return a Lisp plist for :repair-file."))
Return a Lisp plist for :repair-file.)
:deterministic (lambda (action context)
(let ((payload (getf action :payload)))
(self-fix-apply action context))))