docs: Rename cognitive architecture to Associative/Deliberate and Foreground/Background

This commit is contained in:
2026-04-12 14:09:47 -04:00
parent 04df131f63
commit c46c4d4fd7
11 changed files with 459 additions and 65 deletions

View File

@@ -26,30 +26,55 @@ Verify the system's stability and error-handling capabilities under stress.
- *Recovery Verification:* Ensure the kernel can recover from a "skip-event" restart.
* Phase D: Build (Implementation)
:PROPERTIES:
:STATUS: SIGNED
:END:
** Chaos Injection Logic
#+begin_src lisp :tangle ../src/chaos-logic.lisp
(in-package :org-agent)
(defun chaos-inject-error (sensor-type)
"Injects a synthetic error into a specific sensor pipeline."
(org-agent:kernel-log "CHAOS - Injecting synthetic error into ~a sensor..." sensor-type)
(org-agent:inject-stimulus
(unless *chaos-enabled-p*
(kernel-log "CHAOS ERROR - Injection blocked. Production gate is ACTIVE.")
(return-from chaos-inject-error nil))
(kernel-log "CHAOS - Injecting synthetic error into ~a sensor..." sensor-type)
(inject-stimulus
`(:type :EVENT :payload (:sensor ,sensor-type :error "SYNTHETIC_CHAOS_ERROR"))))
(defun chaos-stress-test (action context)
"Executes a randomized stress test by injecting failures into the system."
(declare (ignore context))
(unless *chaos-enabled-p*
(kernel-log "CHAOS ERROR - Stress test blocked. Production gate is ACTIVE.")
(return-from chaos-stress-test "FAILURE - Production gate active."))
(let* ((payload (getf action :payload))
(mode (or (getf payload :mode) :random))
(intensity (or (getf payload :intensity) 3)))
(org-agent:kernel-log "CHAOS - Commencing stress test (Mode: ~a, Intensity: ~a)" mode intensity)
(kernel-log "CHAOS - Commencing stress test (Mode: ~a, Intensity: ~a)" mode intensity)
(snapshot-object-store)
(case mode
(:random (dotimes (i intensity)
(let ((failure-type (nth (random 3) '(:test-failure :shell-timeout :llm-error))))
(org-agent:inject-stimulus
(inject-stimulus
`(:type :EVENT :payload (:sensor :chaos-injection :type ,failure-type))))))
(:shell (org-agent:inject-stimulus
(:shell (inject-stimulus
`(:type :EVENT :payload (:sensor :shell-response :cmd "git push" :exit-code 128 :stderr "fatal: network unreachable")))))
(snapshot-object-store)
(format nil "SUCCESS - Chaos stress test initiated.")))
(defun chaos-enable ()
"Disables the production gate and allows chaos injection."
(setf *chaos-enabled-p* t)
(kernel-log "CHAOS - Production gate DISABLED. Chaos injection is now ALLOWED.")
t)
(defun chaos-disable ()
"Enables the production gate and blocks chaos injection."
(setf *chaos-enabled-p* nil)
(kernel-log "CHAOS - Production gate ENABLED. Chaos injection is now BLOCKED.")
t)
#+end_src
@@ -58,23 +83,26 @@ Verify the system's stability and error-handling capabilities under stress.
:STATUS: SIGNED
:END:
* Phase B: Blueprint (PROTOCOL)
:PROPERTIES:
:STATUS: IN_PROGRESS
:END:
** 1. Architectural Intent
The *Chaos Gauntlet* skill is designed to be non-invasive, running primarily in a background mode. It should not interfere with normal system operation unless explicitly triggered. It is protected by a **Production Gate** (`*chaos-enabled-p*`) to prevent accidental disruptions during real work.
** 1. Architectural Intent
The *Chaos Gauntlet* skill is designed to be non-invasive, running primarily in a background mode. It should not interfere with normal system operation unless explicitly triggered. The skill aims to provide a controlled environment for inducing and observing failures. Key intents:
- *Controlled Chaos:* Failures must be injected in a precise and controllable manner.
- *Merkle Integrity:* Every stress test triggers a Merkle snapshot before and after to allow for full-system rollback.
- *Observability:* The system's response to failures must be easily observable through logging.
- *Controlled Chaos:* Failures must be injected in a precise and controllable manner (specific sensor, specific error type).
- *Observability:* The system's response to failures must be easily observable through logging and system state.
- *Minimal Impact:* The skill should avoid causing permanent damage or corruption to the system or its data.
- *Testability*: Easy to run, configure, and verify success/failure. Reports failures through the regular error reporting mechanisms. Logs activity with 'CHAOS' tag.
- *Recoverability*: Emphasis on testing kernel's recovery from errors, by deliberately triggering skip-event type restarts.
** 2. Semantic Interfaces
** 2. Semantic Interfaces
*** A. Gate Control
*** A. Triggering Chaos
#+begin_src lisp
(defun chaos-enable ()
"Disables the production gate and allows chaos injection.")
(defun chaos-disable ()
"Enables the production gate and blocks chaos injection.")
#+end_src
*** B. Triggering Chaos
*`chaos-trigger` Sensor:*
Events of type `:EVENT` with a `:payload` containing `(:sensor :chaos-trigger)` trigger the skill. The payload can contain a `:mode` key to specify the type of chaos to inject (e.g., `:random`, `:shell`), and an `:intensity` to control the number of failures injected.