Files
memex/notes/org-skill-scientist.org

1.9 KiB

SKILL: The Scientist Agent (Universal Literate Note)

Overview

The Scientist Agent provides a formal, hypothesis-driven approach to debugging. Instead of "trial and error," it formulates symbolic theories about why a failure occurred, designs experiments (test cases), and updates the system's Institutional Memory upon discovery.

Phase A: Demand (PRD)

1. Purpose

Eliminate speculative debugging through rigorous scientific methodology.

2. User Needs

  • Hypothesis Formulation: Neural generation of potential failure causes.
  • Experimental Design: Autonomous creation of minimal failing test cases.
  • Theory Verification: Execution of tests via the TDD Runner.
  • Knowledge Update: Permanent update to `RCA.org` to prevent regression.

Phase D: Build (Implementation)

Scientific Loop

(defun scientist-formulate-hypothesis (failure-log)
  "Analyzes an error and proposes a 'Theory of Failure'. 
   Then triggers the Self-Fix agent."
  (let ((hypothesis (org-agent:ask-neuro 
                     (format nil "Explain why this failure occurred and propose a surgical fix: ~a" failure-log)
                     :system-prompt "You are a PSF Senior Debugging Scientist. Use formal logic and propose a fix in Lisp.")))
    (kernel-log "SCIENTIST - Hypothesis formulated. Triggering SELF-FIX...")
    (org-agent:inject-stimulus 
     `(:type :EVENT :payload (:sensor :repair-request :hypothesis ,hypothesis :failure-log ,failure-log)))))

Registration

(defskill :skill-scientist
  :priority 90
  :trigger (lambda (context) (search "ERROR" (getf (getf context :payload) :text)))
  :neuro #'scientist-formulate-hypothesis
  :symbolic (lambda (action context) action))