Files
org-agent-contrib/org-skill-scribe-rca.org

2.6 KiB

SKILL: Scribe-RCA (Universal Literate Note)

Overview

The Scribe-RCA agent is responsible for Phase F: Memory. It captures "Permanent Learnings" after significant failures or task completions, ensuring the system's Institutional Memory grows with every cycle.

Phase A: Demand (PRD)

1. Purpose

Automate the extraction of root causes and architectural learnings into the Memex.

2. User Needs

  • Root Cause Analysis: Automatically draft an RCA note after a `skip-event` recovery.
  • Permanent Learning: Update `SOUL.org` or a dedicated `RCA.org` with new invariants.
  • Version Control Integration: Commit new RCA notes to Gitea autonomously.
  • Traceability: Link every learning back to the original failure stimulus.

Phase D: Build (Implementation)

Memory Extraction

(defun scribe-rca-draft (failure-context)
  "Drafts an RCA note based on a recent kernel failure."
  (let* ((payload (getf failure-context :payload))
         (error-msg (getf payload :text))
         (timestamp (local-time:format-timestring nil (local-time:now)))
         (gitea-url (opencortex::get-env "GITEA_URL")))
    (opencortex:ask-neuro 
     (format nil "Create a Root Cause Analysis (RCA) note for the following error: ~a" error-msg)
     :system-prompt "You are the PSF Scribe. Extract the deep architectural failure and propose a new invariant for SOUL.org.")))

(defun scribe-rca-commit (rca-note)
  "Commits the drafted RCA note to the Gitea repository."
  (let ((gitea-url (opencortex::get-env "GITEA_URL")))
    (kernel-log "SCRIBE - Committing learning to Gitea: ~a" gitea-url)
    ;; Logic to use 'git commit' via shell-actuator
    (opencortex:spawn-task (format nil "Commit this RCA note to Gitea: ~a" rca-note))))

Registration

(defskill :skill-scribe-rca
  :priority 90
  :trigger (lambda (context) (search "SYSTEM ERROR" (format nil "~a" (getf (getf context :payload) :text))))
  :probabilistic #'scribe-rca-draft
  :deterministic (lambda (action context) action))

Phase B: Blueprint (PROTOCOL)

1. Architectural IntentnEstablish core functional interfaces for this skill.\n\n** 2. Semantic Interfaces\n(defun trigger-skill-org-skill-scribe-rca (context))\n(defun neuro-skill-org-skill-scribe-rca (context))