ARCH: Finalize Microkernel Decoupling - Move behavioral skills to dynamic user-space

This commit is contained in:
2026-04-13 16:11:09 -04:00
parent 34f59a6e43
commit 19fb888434
74 changed files with 129 additions and 2744 deletions

View File

@@ -61,14 +61,13 @@ Tests in `tests/vault-tests.lisp` will verify:
* Phase D: Build (Implementation)
** Package Context
#+begin_src lisp :tangle ../src/credentials-vault.lisp
(in-package :org-agent)
#+begin_src lisp
#+end_src
** Vault State
We maintain an in-memory hash table for secrets, which is hydrated from and persisted to the Memory.
#+begin_src lisp :tangle ../src/credentials-vault.lisp
#+begin_src lisp
(defvar *vault-memory* (make-hash-table :test 'equal)
"In-memory cache of sensitive credentials.")
#+end_src
@@ -76,7 +75,7 @@ We maintain an in-memory hash table for secrets, which is hydrated from and pers
** Helper: Secret Masking
The `vault-mask-string` function ensures that diagnostic output never contains the full plaintext of a sensitive token.
#+begin_src lisp :tangle ../src/credentials-vault.lisp
#+begin_src lisp
(defun vault-mask-string (str)
"Returns a masked version of a sensitive string."
(if (and str (> (length str) 8))
@@ -87,7 +86,7 @@ The `vault-mask-string` function ensures that diagnostic output never contains t
** Retrieval (vault-get-secret)
This function is the secure getter for all system secrets. It prioritizes the Vault (Memory) and falls back to environment variables for legacy compatibility.
#+begin_src lisp :tangle ../src/credentials-vault.lisp
#+begin_src lisp
(defun vault-get-secret (provider &key (type :api-key))
"Retrieves a credential. Type can be :api-key or :session."
(let* ((key (format nil "~a-~a" provider type))
@@ -113,7 +112,7 @@ This function is the secure getter for all system secrets. It prioritizes the Va
** Persistence (vault-set-secret)
When a secret is updated, we immediately snapshot the Memory to ensure the credential change is versioned and durable.
#+begin_src lisp :tangle ../src/credentials-vault.lisp
#+begin_src lisp
(defun vault-set-secret (provider secret &key (type :api-key))
"Securely stores a secret and triggers a Merkle snapshot."
(let ((key (format nil "~a-~a" provider type)))
@@ -126,7 +125,7 @@ When a secret is updated, we immediately snapshot the Memory to ensure the crede
** Onboarding Logic
Retained from the legacy Google skill, this provides the instructions for the sovereign cookie handshake.
#+begin_src lisp :tangle ../src/credentials-vault.lisp
#+begin_src lisp
(defun vault-onboard-gemini-web ()
"Instructions for the Sovereign Cookie Handshake."
(harness-log "--- GEMINI WEB ONBOARDING ---")
@@ -138,7 +137,7 @@ Retained from the legacy Google skill, this provides the instructions for the so
#+end_src
** Registration
#+begin_src lisp :tangle ../src/credentials-vault.lisp
#+begin_src lisp
(progn
(defskill :skill-credentials-vault
:priority 200 ; High priority, foundational
@@ -152,7 +151,7 @@ Retained from the legacy Google skill, this provides the instructions for the so
* Phase E: Chaos (Verification)
** 1. Unit Tests (FiveAM)
#+begin_src lisp :tangle ../tests/vault-tests.lisp
#+begin_src lisp
(defpackage :org-agent-vault-tests
(:use :cl :fiveam :org-agent))
(in-package :org-agent-vault-tests)