1.9 KiB
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'."
(org-agent:ask-neuro
(format nil "Explain why this failure occurred and propose a specific experiment to prove it: ~a" failure-log)
:system-prompt "You are a PSF Senior Debugging Scientist. Use formal logic and the scientific method."))
(defun scientist-run-experiment (hypothesis)
"Designs a minimal test case based on a hypothesis."
;; Delegates to TDD Runner to create and run the experiment.
(org-agent:spawn-task (format nil "Create a minimal failing test for: ~a" hypothesis)))
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))