FEAT: Implement 5-Vector Bouncer Matrix and foundational refactor

This commit is contained in:
2026-04-11 16:36:06 -04:00
parent eca6610274
commit 9fcf45d918
13 changed files with 363 additions and 490 deletions

View File

@@ -26,34 +26,15 @@ graph TD
** Package Context
#+begin_src lisp :tangle ../src/core.lisp
(in-package :org-agent)
#+end_src
** System Logs
Rolling buffer of kernel diagnostics.
#+begin_src lisp :tangle ../src/core.lisp
(defvar *system-logs* nil)
(defvar *interrupt-flag* nil)
#+end_src
** Logs Lock
Thread-safety for logging operations.
#+begin_src lisp :tangle ../src/core.lisp
(defvar *logs-lock* (bt:make-lock "kernel-logs-lock"))
#+end_src
** Max Log History
The maximum number of diagnostic lines to retain in memory.
#+begin_src lisp :tangle ../src/core.lisp
(defvar *max-log-history* 100)
#+end_src
** Interrupt Flag
Atomic flag used to halt the reasoning loop.
#+begin_src lisp :tangle ../src/core.lisp
(defvar *interrupt-flag* nil)
;; MOVED TO package.lisp
#+end_src
** Interrupt Lock
@@ -67,14 +48,14 @@ Thread-safety for loop interruption.
Hash table tracking execution metrics per skill.
#+begin_src lisp :tangle ../src/core.lisp
(defvar *skill-telemetry* (make-hash-table :test 'equal))
;; MOVED TO package.lisp
#+end_src
** Telemetry Lock
Thread-safety for metric updates.
#+begin_src lisp :tangle ../src/core.lisp
(defvar *telemetry-lock* (bt:make-lock "kernel-telemetry-lock"))
;; MOVED TO package.lisp
#+end_src
** Physical Dispatch (dispatch-action)
@@ -240,9 +221,11 @@ The System 2 safety gate. Validates the candidate action against formal rules an
"System 2: Safety and validation."
(let ((candidate (getf signal :candidate)))
(if candidate
(let ((approved (decide candidate signal)))
(setf (getf signal :approved-action) approved)
(unless approved (kernel-log "GATE [Decide]: REJECTED by System 2")))
(let ((decision (decide candidate signal)))
;; If decision is different from candidate, it's an interception (EVENT or LOG)
(setf (getf signal :approved-action) decision)
(unless (equal decision candidate)
(kernel-log "GATE [Decide]: Intercepted/Rejected by System 2")))
(setf (getf signal :approved-action) nil))
(setf (getf signal :status) :decided)
signal))

View File

@@ -18,13 +18,21 @@ Hardcoding logic into a compiled binary creates a "Brittle Kernel."
The central hub for all loaded capabilities.
#+begin_src lisp :tangle ../src/skills.lisp
(defvar *skills-registry* (make-hash-table :test 'equal))
;; MOVED TO package.lisp
#+end_src
** Skill Definition (defstruct skill)
#+begin_src lisp :tangle ../src/skills.lisp
(defstruct skill name priority dependencies trigger-fn neuro-prompt symbolic-fn)
#+end_src
** Skill Catalog
A stateful tracking table for all skill files discovered in the environment.
#+begin_src lisp :tangle ../src/skills.lisp
(defvar *skill-catalog* (make-hash-table :test 'equal)
"A stateful tracking table for all skill files discovered in the environment.")
#+end_src
(defstruct skill-entry
filename
(status :discovered) ;; :discovered, :loading, :ready, :failed
@@ -36,17 +44,19 @@ The central hub for all loaded capabilities.
Tools are discrete actions that System 1 (Neuro) can request. This registry tracks tool definitions, their parameters, and their safety guards.
#+begin_src lisp :tangle ../src/skills.lisp
(defvar *cognitive-tools* (make-hash-table :test 'equal))
;; MOVED TO package.lisp
#+end_src
(defstruct cognitive-tool name description parameters guard body)
** Cognitive Tool Definition (defstruct cognitive-tool)
#+begin_src lisp :tangle ../src/skills.lisp
;; MOVED TO package.lisp
#+end_src
(defmacro def-cognitive-tool (name description &key parameters guard body)
`(setf (gethash (string-downcase (string ,name)) *cognitive-tools*)
(make-cognitive-tool :name (string-downcase (string ,name))
:description ,description
:parameters ',parameters
:guard ,guard
:body ,body)))
** Cognitive Tool Registration (def-cognitive-tool)
Allows skills to register hot-reloadable capabilities that System 1 can discover and invoke.
#+begin_src lisp :tangle ../src/skills.lisp
;; MOVED TO package.lisp
#+end_src
** Toolbelt Prompt Generation (generate-tool-belt-prompt)