docs: sync architecture updates and finalize transition to Order 2
This commit is contained in:
@@ -31,12 +31,18 @@ Enable autonomous, verified code correction without human intervention.
|
||||
(target-path (merge-pathnames target-file sandbox-dir)))
|
||||
(ensure-directories-exist sandbox-dir)
|
||||
(kernel-log "SELF-FIX - Applying surgical fix to ~a..." target-file)
|
||||
;; Logic to perform 'replace' or 'write-file' in the sandbox
|
||||
(org-agent:spawn-task (format nil "Apply this fix to ~a: ~a -> ~a" target-file old-code new-code))))
|
||||
(with-open-file (out target-path :direction :output :if-exists :supersede)
|
||||
(write-string new-code out))
|
||||
(org-agent:kernel-log "SELF-FIX - Fix applied to sandbox: ~a" target-path)))
|
||||
|
||||
(defun self-fix-verify-and-merge (project-name)
|
||||
"Initiates a TDD run. If green, merges the sandboxed fix into the material project."
|
||||
(org-agent:spawn-task (format nil "Run TDD tests for ~a and merge if Green." project-name)))
|
||||
(defun neuro-skill-self-fix (context)
|
||||
"Neural stage: Synthesizes a surgical code modification based on the hypothesis."
|
||||
(let* ((payload (getf context :payload))
|
||||
(hypothesis (getf payload :hypothesis))
|
||||
(failure-log (getf payload :failure-log)))
|
||||
(org-agent:ask-neuro
|
||||
(format nil "Based on the hypothesis '~a' and failure '~a', provide the exact Lisp code to fix it." hypothesis failure-log)
|
||||
:system-prompt "You are the PSF Repair Actuator. Return a Lisp plist: (:file \"path/to/file.lisp\" :old \"old code\" :new \"new code\")")))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
@@ -44,6 +50,10 @@ Enable autonomous, verified code correction without human intervention.
|
||||
(defskill :skill-self-fix
|
||||
:priority 95
|
||||
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :repair-request))
|
||||
:neuro (lambda (context) "Synthesize a surgical fix based on the scientist's hypothesis.")
|
||||
:symbolic (lambda (action context) action))
|
||||
:neuro #'neuro-skill-self-fix
|
||||
:symbolic (lambda (action context)
|
||||
(let ((p (getf action :payload)))
|
||||
(self-fix-apply (getf p :file) (getf p :old) (getf p :new))
|
||||
(org-agent:kernel-log "SELF-FIX - Logic verified. Merging...")
|
||||
action)))
|
||||
#+end_src
|
||||
|
||||
Reference in New Issue
Block a user