2.9 KiB
2.9 KiB
SKILL: Chaos Specialist Agent (Consensus Phase E)
- Overview
- The Chaos Mandate
- Symbolic Implementation (The Logic)
- Neuro-Cognitive Prompt (The 'Think' Loop)
- Registration
Overview
The Chaos Specialist Agent is the fifth specialized role in the Personal Software Foundry (PSF) Consensus Loop. Its purpose is to perform Dynamic Verification through destructive testing.
While the Analyst ensures the code is functionally correct via TDD, the Chaos Specialist ensures the system is resilient by proactively attempting to break it.
The Chaos Mandate
- Perception: The Specialist must perceive when a project has reached the `:BUILD` state (tests passing, code implementation present).
- Sabotage: It must execute the Chaos Gauntlet, which includes simulating image crashes and dependency failures.
- Audit: It MUST generate a `Chaos_Report.org` documenting the system's ability to recover, adhering to the "Persistence by Default" mandate.
Symbolic Implementation (The Logic)
The following Lisp logic defines the actuation of the Chaos Gauntlet.
(defun chaos-actuate (project-name)
"Physically executes the Chaos Gauntlet and writes the report."
(let* ((projects-dir (org-agent::get-env "PROJECTS_DIR" "/app/5_projects/"))
(project-dir (format nil "~a/~a/" projects-dir project-name))
(report-path (format nil "~adocs/Chaos_Report.org" project-dir)))
(kernel-log "CHAOS - Actuating Gauntlet for: ~a" project-name)
(ensure-directories-exist (format nil "~adocs/" project-dir))
(let ((result (psf-run-chaos-gauntlet project-name)))
(with-open-file (out report-path :direction :output :if-exists :supersede)
(format out "#+TITLE: Chaos Report: ~a~%#+STATUS: ~a~%~%* 1. Sabotage Results~%~a~%"
project-name (if (search "SUCCESS" result) "PASSED" "FAILED") result)))
(format nil "SUCCESS - Chaos Specialist completed audit for ~a" project-name)))
Neuro-Cognitive Prompt (The 'Think' Loop)
When invoked, the neuro-layer decides which specific sabotage strategies to deploy based on the project's architecture.
(defun neuro-skill-chaos (context)
(let* ((payload (getf context :payload))
(project-name (getf payload :project-name)))
(format nil "
You are the PSF Chaos Specialist.
Project '~a' has passed implementation and TDD.
Your task: Identify the most critical failure points.
1. Analyze the project structure.
2. Deploy sabotage strategies (e.g., kill image, mock network failure).
Return a Lisp plist: (:target :chaos :action :actuate :name \"~a\")
" project-name project-name)))
Registration
(defskill :skill-chaos
:priority 50
:trigger #'trigger-skill-chaos
:neuro #'neuro-skill-chaos
:symbolic #'chaos-actuate)