2.3 KiB
2.3 KiB
SKILL: Scribe-RCA Agent (Universal Literate Note)
- Overview
- Phase A: Demand (PRD)
- Phase B: Blueprint (PROTOCOL)
- Phase D: Build (Implementation)
- Registration
Overview
The Scribe-RCA Agent is a specialized extension of the Scribe role. It closes the "Learning Loop" by extracting Root Cause Analysis (RCA) entries from failures and populating the Institutional Memory.
Phase A: Demand (PRD)
1. Purpose
Define automated behaviors for failure diagnosis and memory ledger updates.
2. User Needs
- Perception: Scan logs for fatal Lisp or System errors.
- Diagnosis: Identify underlying technical reasons for failures.
- Distillation: Generate high-signal entries (Symptom, Cause, Prevention).
- Prevention: Ensure recurrence is avoided via persistent heuristics.
3. Success Criteria
TODO Error Log Detection
TODO RCA Entry Formatting
TODO Institutional Memory Append Verification
Phase B: Blueprint (PROTOCOL)
1. Architectural Intent
Interfaces for analyzing system "pain" and recording learnings. Source of truth is the system log and `institutional-memory.org`.
2. Semantic Interfaces
(defun trigger-skill-scribe-rca (context)
"Triggers on fatal error events or log rejections.")
(defun scribe-rca-append (symptom cause prevention)
"Appends entry to institutional-memory.org.")
Phase D: Build (Implementation)
Memory Append
(defun scribe-rca-append (symptom cause prevention)
(let* ((notes-dir (or (uiop:getenv "MEMEX_NOTES") "notes/"))
(memory-file (format nil "~ainstitutional-memory.org" notes-dir))
(timestamp (local-time:format-timestring nil (local-time:now) :format '("[" :year "-" :month "-" :day " " :weekday "]"))))
(with-open-file (out memory-file :direction :output :if-exists :append)
(format out "~%** ~a ~a~%- **Symptom:** ~a~%- **Root Cause:** ~a~%- **Prevention:** ~a~%"
timestamp cause symptom cause prevention))
(format nil "SUCCESS - Updated Memory: ~a" cause)))
Registration
(defskill :skill-scribe-rca
:priority 90
:trigger #'trigger-skill-scribe-rca
:neuro #'neuro-skill-scribe-rca
:symbolic #'scribe-rca-append)