diff --git a/harness/act.org b/harness/act.org index 18667e8..872062d 100644 --- a/harness/act.org +++ b/harness/act.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "act.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "act.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) #+TITLE: Stage 3: Act (act.lisp) #+AUTHOR: Amr #+FILETAGS: :harness:act: @@ -393,7 +393,7 @@ Example feedback chain: These tests verify the Act pipeline. Run with: ~(fiveam:run! 'pipeline-act-suite)~ -#+begin_src lisp :tangle (expand-file-name "pipeline-act-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "pipeline-act-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-pipeline-act-tests (:use :cl :fiveam :opencortex) (:export #:pipeline-act-suite)) diff --git a/harness/communication.org b/harness/communication.org index b62ee07..fd77462 100644 --- a/harness/communication.org +++ b/harness/communication.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "communication.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "communication.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) #+TITLE: Communication Protocol (communication.lisp) #+AUTHOR: Amr #+FILETAGS: :harness:protocol: @@ -79,7 +79,7 @@ The ~communication.lisp~ module defines the low-level transport and framing logi ** Structural Validation (communication-validator.lisp) The validator ensures that incoming messages adhere to the strict property list schema of the communication protocol. -#+begin_src lisp :tangle (expand-file-name "communication-validator.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "communication-validator.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (in-package :opencortex) (defun validate-communication-protocol-schema (msg) @@ -154,7 +154,7 @@ Frames a message with a hex length prefix and ensures all data is serializable. These tests verify the communication protocol functions. Run with: ~(fiveam:run! 'communication-protocol-suite)~ -#+begin_src lisp :tangle (expand-file-name "communication-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "communication-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-communication-tests (:use :cl :fiveam :opencortex) (:export #:communication-protocol-suite)) diff --git a/harness/context.org b/harness/context.org index 57c8fe7..636feab 100644 --- a/harness/context.org +++ b/harness/context.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "context.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "context.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) #+TITLE: Peripheral Vision (context.lisp) #+AUTHOR: Amr #+FILETAGS: :harness:context: @@ -217,7 +217,7 @@ The primary entry point for context generation. This function identifies active Following the Engineering Standards, the peripheral vision extraction and rendering logic must be empirically verified. ** Test Suite Context -#+begin_src lisp :tangle (expand-file-name "peripheral-vision-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "peripheral-vision-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-peripheral-vision-tests (:use :cl :fiveam :opencortex) (:export #:vision-suite)) @@ -231,7 +231,7 @@ Following the Engineering Standards, the peripheral vision extraction and render ** Foveal Rendering Test Verify that the foveal target is rendered with content, while siblings are skeletal. -#+begin_src lisp :tangle (expand-file-name "peripheral-vision-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "peripheral-vision-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (test test-foveal-rendering "Verify that the foveal target is rendered with content, while siblings are skeletal." (clrhash opencortex::*memory*) @@ -251,7 +251,7 @@ Verify that the foveal target is rendered with content, while siblings are skele ** Awareness Budget Test Verify that context-assemble-global-awareness handles multiple projects correctly. -#+begin_src lisp :tangle (expand-file-name "peripheral-vision-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "peripheral-vision-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (test test-awareness-budget "Verify that context-assemble-global-awareness handles multiple projects." (clrhash opencortex::*memory*) diff --git a/harness/doctor.org b/harness/doctor.org index 3341705..5fadc6f 100644 --- a/harness/doctor.org +++ b/harness/doctor.org @@ -23,26 +23,26 @@ Common Lisp's `uiop:getenv` is strictly typed in SBCL. The Doctor must ensure th * Phase B: Protocol (Success Criteria) ** Package Context -#+begin_src lisp :tangle (expand-file-name "doctor-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "doctor-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-doctor-tests (:use :cl :fiveam :opencortex) (:export #:doctor-suite)) #+end_src -#+begin_src lisp :tangle (expand-file-name "doctor-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "doctor-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (in-package :opencortex-doctor-tests) #+end_src -#+begin_src lisp :tangle (expand-file-name "doctor-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "doctor-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (def-suite doctor-suite :description "Verification of the System Doctor diagnostic logic") #+end_src -#+begin_src lisp :tangle (expand-file-name "doctor-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "doctor-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (in-suite doctor-suite) #+end_src ** Dependency Tests -#+begin_src lisp :tangle (expand-file-name "doctor-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "doctor-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (test test-dependency-check-fail "Verify that missing binaries are correctly identified as failures." (let ((opencortex::*doctor-required-binaries* '("non-existent-binary-123"))) @@ -50,7 +50,7 @@ Common Lisp's `uiop:getenv` is strictly typed in SBCL. The Doctor must ensure th #+end_src ** Environment Tests -#+begin_src lisp :tangle (expand-file-name "doctor-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "doctor-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (test test-env-validation-fail "Verify that an invalid MEMEX_DIR triggers a critical failure." (let ((old-m (uiop:getenv "MEMEX_DIR")) @@ -66,18 +66,18 @@ Common Lisp's `uiop:getenv` is strictly typed in SBCL. The Doctor must ensure th * Phase C: Implementation (Build) ** Package Context -#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (in-package :opencortex) #+end_src ** Global Configuration -#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *doctor-required-binaries* '("sbcl" "emacs" "git" "socat" "nc") "List of external binaries required for full system operation.") #+end_src ** Dependency Verification -#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun doctor-check-dependencies () "Verifies that required external binaries are available in the PATH via a shell probe." (let ((all-ok t)) @@ -95,7 +95,7 @@ Common Lisp's `uiop:getenv` is strictly typed in SBCL. The Doctor must ensure th #+end_src ** Environment & XDG Validation -#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun doctor-check-env () "Validates XDG directories and environment configuration against the POSIX standard." (harness-log "DOCTOR: Checking XDG environment...") @@ -124,7 +124,7 @@ Common Lisp's `uiop:getenv` is strictly typed in SBCL. The Doctor must ensure th #+end_src ** LLM Connectivity -#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun doctor-check-llm () "Tests connectivity to primary LLM providers. Non-critical fallback allowed." (harness-log "DOCTOR: Checking LLM connectivity...") @@ -139,7 +139,7 @@ Common Lisp's `uiop:getenv` is strictly typed in SBCL. The Doctor must ensure th #+end_src ** Orchestration -#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun doctor-run-all () "Executes the full diagnostic suite and returns T if system is healthy." (harness-log "==================================================") @@ -159,7 +159,7 @@ Common Lisp's `uiop:getenv` is strictly typed in SBCL. The Doctor must ensure th #+end_src ** CLI Entry Point -#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "doctor.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun doctor-main () "Entry point for the 'doctor' CLI command." (if (doctor-run-all) diff --git a/harness/loop.org b/harness/loop.org index 3dbbd24..de483d1 100644 --- a/harness/loop.org +++ b/harness/loop.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "loop.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "loop.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) #+TITLE: The Metabolic Loop (loop.lisp) #+AUTHOR: Amr #+FILETAGS: :harness:loop: @@ -324,7 +324,7 @@ The main function orchestrates system startup: These tests verify the metabolic loop and error recovery. Run with: ~(fiveam:run! 'immune-suite)~ -#+begin_src lisp :tangle (expand-file-name "immune-system-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "immune-system-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-immune-system-tests (:use :cl :fiveam :opencortex) (:export #:immune-suite)) diff --git a/harness/manifest.org b/harness/manifest.org index 0d6119c..9cddecc 100644 --- a/harness/manifest.org +++ b/harness/manifest.org @@ -9,7 +9,7 @@ The *System Manifest* defines the structural components of the OpenCortex. It se * Implementation ** Main System -#+begin_src lisp :tangle (expand-file-name "../opencortex.asd" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "../opencortex.asd" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defsystem :opencortex :name "opencortex" :author "Amr Gharbeia" @@ -31,7 +31,7 @@ The *System Manifest* defines the structural components of the OpenCortex. It se #+end_src ** Test System -#+begin_src lisp :tangle (expand-file-name "../opencortex.asd" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "../opencortex.asd" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defsystem :opencortex/tests :depends-on (:opencortex :fiveam) :components ((:file "tests/pipeline-act-tests") @@ -55,14 +55,14 @@ The *System Manifest* defines the structural components of the OpenCortex. It se #+end_src ** TUI System -#+begin_src lisp :tangle (expand-file-name "../opencortex.asd" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "../opencortex.asd" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defsystem :opencortex/tui :depends-on (:opencortex :croatoan :usocket :bordeaux-threads) :components ((:file "harness/tui-client"))) #+end_src ** Test Orchestrator -#+begin_src lisp :tangle (expand-file-name "run-all-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "run-all-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (load (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname))) (let ((oc-dir (or (uiop:getenv "OC_DATA_DIR") diff --git a/harness/memory.org b/harness/memory.org index 10fdbaa..b979f6d 100644 --- a/harness/memory.org +++ b/harness/memory.org @@ -31,14 +31,14 @@ flowchart TD #+end_src ** Package Context -#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (in-package :opencortex) #+end_src ** The Object Repository The `*memory*` is the global hash table that holds every Org element by its unique ID. This is the "live RAM" of the agent's memory. -#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *memory* (make-hash-table :test 'equal)) (defvar *history-store* (make-hash-table :test 'equal) @@ -48,7 +48,7 @@ The `*memory*` is the global hash table that holds every Org element by its uniq ** The Data Structure (org-object) Every element in the Memex (headlines, paragraphs, etc.) is represented by an `org-object` structure. It contains both semantic metadata (attributes, content) and structural metadata (parent/child pointers, Merkle hashes). -#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defstruct org-object id type attributes content vector parent-id children version last-sync hash) @@ -60,7 +60,7 @@ Every element in the Memex (headlines, paragraphs, etc.) is represented by an `o ** Merkle Tree Integrity (compute-merkle-hash) The `compute-merkle-hash` function ensures the cryptographic integrity of the knowledge graph. A node's hash depends on its own properties and the hashes of all its children. This creates a recursive fingerprint where any change to a single note propagates up to the root hash. -#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun compute-merkle-hash (id type attributes content child-hashes) "Computes a SHA-256 Merkle hash for a node based on its core properties and children's hashes." (let* ((alist (loop for (k v) on attributes by #'cddr collect (cons k v))) @@ -77,7 +77,7 @@ The `compute-merkle-hash` function ensures the cryptographic integrity of the kn ** Ingesting the AST (ingest-ast) The `ingest-ast` function is the primary bridge between the external world (Emacs/JSON) and the internal Lisp machine. It recursively parses an Org-mode Abstract Syntax Tree (AST) into `org-object` structures and registers them in the store. -#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun ingest-ast (ast &optional parent-id) "Parses an Org AST into the recursive Lisp Memory with Merkle hashing." (let* ((type (getf ast :type)) @@ -116,7 +116,7 @@ The `ingest-ast` function is the primary bridge between the external world (Emac ** Memory Snapshots (snapshot-memory) Because objects are stored immutably in the `*history-store*`, a snapshot is a lightweight shallow copy of the active `*memory*` pointers. The system maintains a rolling buffer of 20 snapshots, allowing for near-instant, zero-cost rollback. -#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *object-store-snapshots* nil) (defun copy-hash-table (hash-table) @@ -143,7 +143,7 @@ Because objects are stored immutably in the `*history-store*`, a snapshot is a l ** Memory Rollback (rollback-memory) Restores the state of the Memex from one of the previous snapshots. -#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun rollback-memory (&optional (index 0)) "Restores the Memory to a previously captured snapshot using immutable history pointers." (let ((snapshot (nth index *object-store-snapshots*))) @@ -156,7 +156,7 @@ Restores the state of the Memex from one of the previous snapshots. ** Disk Persistence (save-memory / load-memory) Essential for surviving crashes. Saves the in-memory hash tables to disk and loads them back on restart. -#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *memory-snapshot-path* nil "Path to the memory snapshot file. Set from MEMORY_SNAPSHOT_PATH env or default.") @@ -209,7 +209,7 @@ Reconstitutes alists into hash tables." ** Semantic Search (get-embedding, semantic-search) Support for vector embeddings via Ollama and semantic search with cosine similarity. -#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *embedding-cache* (make-hash-table :test 'equal) "Cache for embeddings to avoid redundant API calls.") @@ -258,7 +258,7 @@ Returns up to LIMIT objects with similarity >= MIN-SIMILARITY, sorted by similar #+end_src ** Cognitive Tool: Semantic Search -#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (def-cognitive-tool :semantic-search "Searches memory for objects semantically similar to a query." ((:query :type :string :description "The search query.") @@ -271,7 +271,7 @@ Returns up to LIMIT objects with similarity >= MIN-SIMILARITY, sorted by similar #+end_src ** Cognitive Tool: Generate Embeddings -#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (def-cognitive-tool :generate-embeddings "Generates vector embeddings for given text via the configured embedding backend (Ollama)." ((:texts :type :list :description "List of text strings to embed.")) @@ -294,7 +294,7 @@ Returns up to LIMIT objects with similarity >= MIN-SIMILARITY, sorted by similar ** Lookup Utilities Basic functions for retrieving objects by ID or type. -#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun org-id-new () "Generates a new UUID string for Org-mode identification." (string-downcase (format nil "~a" (uuid:make-v4-uuid)))) @@ -324,7 +324,7 @@ Basic functions for retrieving objects by ID or type. ** Structural Helpers Utility functions for AST traversal and path resolution. -#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun find-headline-missing-id (ast) "Traverses an AST to find headlines that lack an :ID: property." (when (listp ast) @@ -339,7 +339,7 @@ Utility functions for AST traversal and path resolution. * Test Suite -#+begin_src lisp :tangle (expand-file-name "memory-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "memory-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-memory-tests (:use :cl :fiveam :opencortex) (:export #:memory-suite)) diff --git a/harness/package.org b/harness/package.org index af3665d..83d1028 100644 --- a/harness/package.org +++ b/harness/package.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "package.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "package.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) #+TITLE: System Interface (package.lisp) #+AUTHOR: Amr #+FILETAGS: :harness:interface: diff --git a/harness/perceive.org b/harness/perceive.org index f0cb92c..5b0311b 100644 --- a/harness/perceive.org +++ b/harness/perceive.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "perceive.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "perceive.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) #+TITLE: Stage 1: Perceive (perceive.lisp) #+AUTHOR: Amr #+FILETAGS: :harness:perceive: @@ -227,7 +227,7 @@ Other sensors (heartbeats, interrupts) are processed synchronously to maintain o These tests verify the Perceive pipeline. Run with: ~(fiveam:run! 'pipeline-perceive-suite)~ -#+begin_src lisp :tangle (expand-file-name "pipeline-perceive-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "pipeline-perceive-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-pipeline-perceive-tests (:use :cl :fiveam :opencortex) (:export #:pipeline-perceive-suite)) diff --git a/harness/reason.org b/harness/reason.org index d3f007d..7540551 100644 --- a/harness/reason.org +++ b/harness/reason.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "reason.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "reason.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) #+TITLE: Stage 2: Reason (reason.lisp) #+AUTHOR: Amr #+FILETAGS: :harness:reason: @@ -472,7 +472,7 @@ The deterministic engine runs all registered skills' verification functions. Thi These tests verify the Reason (cognitive) pipeline. Run with: ~(fiveam:run! 'pipeline-reason-suite)~ -#+begin_src lisp :tangle (expand-file-name "pipeline-reason-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "pipeline-reason-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-pipeline-reason-tests (:use :cl :fiveam :opencortex) (:export #:pipeline-reason-suite)) diff --git a/harness/setup.org b/harness/setup.org index c7756b9..706daa3 100644 --- a/harness/setup.org +++ b/harness/setup.org @@ -23,7 +23,7 @@ To maintain sovereignty, the harness must remain a "dumb" bus. It should not kno ** The Installer Script (opencortex.sh) The shell script is the primary entry point. It handles the initial git clone, dependency installation, and literate tangle. -#+begin_src bash :tangle (expand-file-name "../opencortex.sh" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src bash :tangle (expand-file-name "../opencortex.sh" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) #!/bin/bash # (The content here is a duplicate of the main opencortex.sh for literate consistency) # [Note: Implementation is already verified in the top-level script] diff --git a/harness/skills.org b/harness/skills.org index 4cb54a3..b31c5e6 100644 --- a/harness/skills.org +++ b/harness/skills.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "skills.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "skills.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) #+TITLE: The Skill Engine (skills.lisp) #+AUTHOR: Amr #+FILETAGS: :harness:skills: @@ -419,7 +419,7 @@ EXAMPLES: *** The Eval Tool (Internal Inspection) #+begin_src lisp ** Cognitive Tool Registration -#+begin_src lisp :tangle (expand-file-name "skills.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "skills.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) ;; Cognitive tools are registered in *cognitive-tools* (defined in package.lisp) ;; using the def-cognitive-tool macro. #+end_src @@ -589,7 +589,7 @@ EXAMPLES: * Test Suite -#+begin_src lisp :tangle (expand-file-name "boot-sequence-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "boot-sequence-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-boot-tests (:use :cl :fiveam :opencortex) (:export #:boot-suite)) diff --git a/harness/tui-client.org b/harness/tui-client.org index c7ade68..480eadf 100644 --- a/harness/tui-client.org +++ b/harness/tui-client.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) :PROPERTIES: :ID: tui-client-spec :CREATED: [2026-04-17 Fri 11:00] @@ -22,26 +22,26 @@ A simple MVP console is insufficient for a Lisp Machine. To reach v0.2.0, the TU * Phase B: Protocol (Success Criteria) ** Test Suite Context -#+begin_src lisp :tangle (expand-file-name "tui-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "tui-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-tui-tests (:use :cl :fiveam :opencortex) (:export #:tui-suite)) #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "tui-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (in-package :opencortex-tui-tests) #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "tui-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (def-suite tui-suite :description "Verification of the TUI parsing and styling logic") #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "tui-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (in-suite tui-suite) #+end_src ** Command Parsing Tests -#+begin_src lisp :tangle (expand-file-name "tui-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "tui-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (test test-tui-connection-drop "Tier 2 Chaos: Verify that handle-return degrades gracefully when the daemon connection is lost." (let ((opencortex.tui::*incoming-msgs* nil) @@ -57,81 +57,81 @@ A simple MVP console is insufficient for a Lisp Machine. To reach v0.2.0, the TU * Phase C: Implementation (Build) ** Package Context -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (in-package :cl-user) #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defpackage :opencortex.tui (:use :cl :croatoan) (:export :main)) #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (in-package :opencortex.tui) #+end_src ** Global State -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *daemon-host* "127.0.0.1") #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *daemon-port* 9105) #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *socket* nil) #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *stream* nil) #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *chat-history* (list) "Full chronological log of messages.") #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *scroll-index* 0 "Offset for history rendering.") #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *status-text* "Connecting...") #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *input-buffer* (make-array 0 :element-type 'char :fill-pointer 0 :adjustable t)) #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *command-history* (make-array 0 :element-type 't :fill-pointer 0 :adjustable t)) #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *history-index* -1) #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *is-running* t) #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *queue-lock* (bt:make-lock)) #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defvar *incoming-msgs* nil) #+end_src ** Utilities -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun enqueue-msg (msg) "Thread-safe addition to incoming message queue." (bt:with-lock-held (*queue-lock*) (setf *incoming-msgs* (append *incoming-msgs* (list msg))))) -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun dequeue-msgs () "Thread-safe retrieval of incoming messages." (bt:with-lock-held (*queue-lock*) @@ -142,7 +142,7 @@ A simple MVP console is insufficient for a Lisp Machine. To reach v0.2.0, the TU #+end_src ** Styling Engine -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun get-line-style (text) "Determines croatoan attributes based on content patterns." (cond @@ -154,7 +154,7 @@ A simple MVP console is insufficient for a Lisp Machine. To reach v0.2.0, the TU #+end_src ** Rendering Orchestrator -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun render-chat (win) "Renders the chat history with scrolling and styling." (clear win) @@ -172,14 +172,14 @@ A simple MVP console is insufficient for a Lisp Machine. To reach v0.2.0, the TU #+end_src ** Input Handling -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun handle-backspace () "Deletes last character from input buffer." (when (> (fill-pointer *input-buffer*) 0) (decf (fill-pointer *input-buffer*)))) #+end_src -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun handle-return (stream) "Process input buffer as message or command." (let ((cmd (coerce *input-buffer* 'string))) @@ -200,7 +200,7 @@ A simple MVP console is insufficient for a Lisp Machine. To reach v0.2.0, the TU #+end_src ** Main Entry Point -#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/harness")) +#+begin_src lisp :tangle (expand-file-name "tui-client.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/harness")) (defun main () "Initializes ncurses and starts the TUI event loop." (handler-case diff --git a/skills/org-skill-bouncer.org b/skills/org-skill-bouncer.org index 39b7e6d..352a4b7 100644 --- a/skills/org-skill-bouncer.org +++ b/skills/org-skill-bouncer.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-bouncer.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-bouncer.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: bouncer-agent-skill :CREATED: [2026-04-11 Sat 15:20] diff --git a/skills/org-skill-cli-gateway.org b/skills/org-skill-cli-gateway.org index 1ae7670..b48118b 100644 --- a/skills/org-skill-cli-gateway.org +++ b/skills/org-skill-cli-gateway.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-cli-gateway.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-cli-gateway.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: cli-gateway-skill :CREATED: [2026-04-13 Mon 17:00] diff --git a/skills/org-skill-config-manager.org b/skills/org-skill-config-manager.org index 7fa3659..670eceb 100644 --- a/skills/org-skill-config-manager.org +++ b/skills/org-skill-config-manager.org @@ -16,26 +16,26 @@ Secrets are appended to `~/.config/opencortex/.env`, while structural metadata i * Phase B: Protocol (Success Criteria) ** Test Suite Context -#+begin_src lisp :tangle (expand-file-name "config-manager-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "config-manager-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-config-manager-tests (:use :cl :fiveam :opencortex) (:export #:config-suite)) #+end_src -#+begin_src lisp :tangle (expand-file-name "config-manager-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "config-manager-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (in-package :opencortex-config-manager-tests) #+end_src -#+begin_src lisp :tangle (expand-file-name "config-manager-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "config-manager-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (def-suite config-suite :description "Verification of the Config Manager skill") #+end_src -#+begin_src lisp :tangle (expand-file-name "config-manager-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "config-manager-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (in-suite config-suite) #+end_src ** Registry Tests -#+begin_src lisp :tangle (expand-file-name "config-manager-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "config-manager-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (test test-provider-registration "Verify that multiple providers can be registered and saved." (let ((opencortex::*providers* nil)) @@ -95,12 +95,12 @@ Secrets are appended to `~/.config/opencortex/.env`, while structural metadata i * Phase C: Implementation (Build) ** Package Context -#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (in-package :opencortex) #+end_src ** Skill Metadata -#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defparameter *skill-config-manager* '(:name "config-manager" :description "Manages system settings and LLM provider configurations." @@ -110,7 +110,7 @@ Secrets are appended to `~/.config/opencortex/.env`, while structural metadata i #+end_src ** Provider Templates -#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defvar *provider-templates* '((:ollama . (:name "Ollama (Local)" :fields ((:url :label "URL") (:model :label "Model")) :default-url "http://localhost:11434" :default-model "llama3")) (:openrouter . (:name "OpenRouter" :fields ((:key :label "API Key" :secret t) (:model :label "Model")) :default-model "anthropic/claude-3-opus-20240229")) @@ -122,7 +122,7 @@ Secrets are appended to `~/.config/opencortex/.env`, while structural metadata i #+end_src ** Registry Persistence -#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defvar *providers* nil "Global registry of configured LLM providers.") (defun get-oc-config-dir () @@ -159,14 +159,14 @@ Secrets are appended to `~/.config/opencortex/.env`, while structural metadata i #+end_src ** Registry API -#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun register-provider (id config) "Update the global provider registry." (setf (getf *providers* id) config)) #+end_src ** Setup Wizard Implementation -#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun configure-provider (id) "Guided configuration for a specific LLM provider template." (let* ((template (cdr (assoc id *provider-templates*))) @@ -187,7 +187,7 @@ Secrets are appended to `~/.config/opencortex/.env`, while structural metadata i (format t "✓ ~a metadata registered.~%" (getf template :name)))) #+end_src -#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-config-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun run-setup-wizard () "Entry point for the interactive OpenCortex Lisp Setup Wizard." (format t "=== OpenCortex: Advanced Setup Wizard ===~%") diff --git a/skills/org-skill-credentials-vault.org b/skills/org-skill-credentials-vault.org index bcab9b4..c3504ee 100644 --- a/skills/org-skill-credentials-vault.org +++ b/skills/org-skill-credentials-vault.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-credentials-vault.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-credentials-vault.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: credentials-vault-skill :CREATED: [2026-04-09 Thu] @@ -154,7 +154,7 @@ Retained from the legacy Google skill, this provides the instructions for the au Note: Tests disabled in jail load. ** 1. Unit Tests (FiveAM) -#+begin_src lisp :tangle (expand-file-name "org-skill-credentials-vault.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "org-skill-credentials-vault.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) #| (defpackage :opencortex-vault-tests (:use :cl :fiveam :opencortex)) diff --git a/skills/org-skill-diagnostics.org b/skills/org-skill-diagnostics.org index 736287f..1d67cb2 100644 --- a/skills/org-skill-diagnostics.org +++ b/skills/org-skill-diagnostics.org @@ -18,26 +18,26 @@ The skill strictly validates the POSIX standard paths resolved during bootstrap, * Phase B: Protocol (Success Criteria) ** Test Suite Context -#+begin_src lisp :tangle (expand-file-name "diagnostics-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "diagnostics-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-diagnostics-tests (:use :cl :fiveam :opencortex) (:export #:diagnostics-suite)) #+end_src -#+begin_src lisp :tangle (expand-file-name "diagnostics-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "diagnostics-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (in-package :opencortex-diagnostics-tests) #+end_src -#+begin_src lisp :tangle (expand-file-name "diagnostics-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "diagnostics-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (def-suite diagnostics-suite :description "Verification of the Diagnostics skill") #+end_src -#+begin_src lisp :tangle (expand-file-name "diagnostics-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "diagnostics-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (in-suite diagnostics-suite) #+end_src ** Dependency Tests -#+begin_src lisp :tangle (expand-file-name "diagnostics-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "diagnostics-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (test test-dependency-check-fail "Verify that missing binaries are correctly identified as failures." (let ((opencortex::*doctor-required-binaries* '("non-existent-binary-123"))) @@ -47,12 +47,12 @@ The skill strictly validates the POSIX standard paths resolved during bootstrap, * Phase C: Implementation (Build) ** Package Context -#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (in-package :opencortex) #+end_src ** Skill Metadata -#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defparameter *skill-diagnostics* '(:name "diagnostics" :description "Performs system health checks and environment validation." @@ -62,13 +62,13 @@ The skill strictly validates the POSIX standard paths resolved during bootstrap, #+end_src ** Global Configuration -#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defvar *doctor-required-binaries* '("sbcl" "emacs" "git" "socat" "nc") "List of external binaries required for full system operation.") #+end_src ** Dependency Verification -#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun doctor-check-dependencies () "Verifies that required external binaries are available in the PATH via a shell probe." (let ((all-ok t)) @@ -86,7 +86,7 @@ The skill strictly validates the POSIX standard paths resolved during bootstrap, #+end_src ** Environment & XDG Validation -#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun doctor-check-env () "Validates XDG directories and environment configuration against the POSIX standard." (harness-log "DOCTOR: Checking XDG environment...") @@ -115,7 +115,7 @@ The skill strictly validates the POSIX standard paths resolved during bootstrap, #+end_src ** LLM Connectivity -#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun doctor-check-llm () "Tests connectivity to primary LLM providers. Non-critical fallback allowed." (harness-log "DOCTOR: Checking LLM connectivity...") @@ -130,7 +130,7 @@ The skill strictly validates the POSIX standard paths resolved during bootstrap, #+end_src ** Orchestration -#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun doctor-run-all () "Executes the full diagnostic suite and returns T if system is healthy." (harness-log "==================================================") @@ -150,7 +150,7 @@ The skill strictly validates the POSIX standard paths resolved during bootstrap, #+end_src ** CLI Entry Point -#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-diagnostics.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun doctor-main () "Entry point for the 'doctor' CLI command." (if (doctor-run-all) diff --git a/skills/org-skill-emacs-edit.org b/skills/org-skill-emacs-edit.org index 390d91a..56334f1 100644 --- a/skills/org-skill-emacs-edit.org +++ b/skills/org-skill-emacs-edit.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-emacs-edit.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-emacs-edit.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: emacs-edit-skill :CREATED: [2026-04-23 Thu] @@ -390,7 +390,7 @@ Use this AFTER modifications to save changes." #+end_src * Phase E: Chaos (Verification) -#+begin_src lisp :tangle (expand-file-name "emacs-edit-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "emacs-edit-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-emacs-edit-tests (:use :cl :fiveam :opencortex) (:export #:emacs-edit-suite)) diff --git a/skills/org-skill-engineering-standards.org b/skills/org-skill-engineering-standards.org index dd34b0c..6aa56bb 100644 --- a/skills/org-skill-engineering-standards.org +++ b/skills/org-skill-engineering-standards.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: 37f2b59f-4537-4cca-ac7f-5c24b9e2e773 :CREATED: [2026-03-30 Mon 21:16] @@ -57,17 +57,17 @@ Every significant fix or architectural decision MUST be documented in an org fil * Enforcement Implementation ** Package Context -#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (in-package :opencortex) #+end_src ** Global Configuration -#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defvar *engineering-std-project-root* nil "Path to the project root for enforcement checks.") #+end_src -#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defstruct engineering-violation (phase nil) (rule nil) @@ -76,7 +76,7 @@ Every significant fix or architectural decision MUST be documented in an org fil #+end_src ** CDD Utilities: Tier 1 -#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun check-structural-balance (file-path) "Tier 1 Chaos: Verifies that a Lisp file is syntactically balanced." (handler-case @@ -90,7 +90,7 @@ Every significant fix or architectural decision MUST be documented in an org fil #+end_src ** Git Protocol -#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun verify-git-clean-p (&optional (dir *engineering-std-project-root*)) "Returns T if the git repository at DIR has no uncommitted changes." (when dir @@ -101,7 +101,7 @@ Every significant fix or architectural decision MUST be documented in an org fil #+end_src ** Initializer -#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun engineering-std-init () "Initialize the enforcement system." (let ((env-root (or (uiop:getenv "OC_DATA_DIR") @@ -111,32 +111,32 @@ Every significant fix or architectural decision MUST be documented in an org fil #+end_src ;; Auto-initialize on load -#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-engineering-standards.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (engineering-std-init) #+end_src * Test Suite -#+begin_src lisp :tangle (expand-file-name "engineering-standards-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "engineering-standards-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-engineering-standards-tests (:use :cl :fiveam :opencortex) (:export #:engineering-standards-suite)) #+end_src -#+begin_src lisp :tangle (expand-file-name "engineering-standards-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "engineering-standards-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (in-package :opencortex-engineering-standards-tests) #+end_src -#+begin_src lisp :tangle (expand-file-name "engineering-standards-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "engineering-standards-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (def-suite engineering-standards-suite :description "Tests for Engineering Standards enforcement") #+end_src -#+begin_src lisp :tangle (expand-file-name "engineering-standards-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "engineering-standards-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (in-suite engineering-standards-suite) #+end_src -#+begin_src lisp :tangle (expand-file-name "engineering-standards-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "engineering-standards-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (test git-clean-check-clean "verify-git-clean-p returns T when git tree is clean." (let ((tmp-dir "/tmp/eng-std-test-clean/")) diff --git a/skills/org-skill-gardener.org b/skills/org-skill-gardener.org index 958e2a0..c1404dd 100644 --- a/skills/org-skill-gardener.org +++ b/skills/org-skill-gardener.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-gardener.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-gardener.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: gardener-skill :CREATED: [2026-04-13 Mon 18:50] diff --git a/skills/org-skill-gateway-manager.org b/skills/org-skill-gateway-manager.org index b2f18b6..e6788ac 100644 --- a/skills/org-skill-gateway-manager.org +++ b/skills/org-skill-gateway-manager.org @@ -13,26 +13,26 @@ In a traditional AI wrapper, the user manually edits a config file to add a bot * Phase B: Protocol (Success Criteria) ** Test Suite Context -#+begin_src lisp :tangle (expand-file-name "gateway-manager-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "gateway-manager-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-gateway-manager-tests (:use :cl :fiveam :opencortex) (:export #:gateway-suite)) #+end_src -#+begin_src lisp :tangle (expand-file-name "gateway-manager-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "gateway-manager-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (in-package :opencortex-gateway-manager-tests) #+end_src -#+begin_src lisp :tangle (expand-file-name "gateway-manager-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "gateway-manager-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (def-suite gateway-suite :description "Verification of the Gateway Manager skill") #+end_src -#+begin_src lisp :tangle (expand-file-name "gateway-manager-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "gateway-manager-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (in-suite gateway-suite) #+end_src ** Logic Tests -#+begin_src lisp :tangle (expand-file-name "gateway-manager-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "gateway-manager-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (test test-gateway-registration "Verify that the skill can register a new gateway metadata block." (let ((opencortex::*gateways* nil)) @@ -51,12 +51,12 @@ In a traditional AI wrapper, the user manually edits a config file to add a bot * Phase C: Implementation (Build) ** Package Context -#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (in-package :opencortex) #+end_src ** Capability Definition -#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defparameter *skill-gateway-manager* '(:name "gateway-manager" :description "Manages connections to external chat platforms." @@ -66,12 +66,12 @@ In a traditional AI wrapper, the user manually edits a config file to add a bot #+end_src ** Registry Persistence -#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defvar *gateways* nil "The internal registry of configured gateways.") #+end_src ** Persistence Stubs -#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun save-gateways () "Persist gateway metadata to XDG Config directory." (let ((path (merge-pathnames "gateways.lisp" (get-oc-config-dir)))) @@ -81,14 +81,14 @@ In a traditional AI wrapper, the user manually edits a config file to add a bot #+end_src ** Registration Logic -#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun skill-gateway-register (platform metadata) "Internal function to update the gateway registry." (setf (getf *gateways* platform) metadata)) #+end_src ** Telegram Verification -#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun skill-gateway-verify-telegram (token) "Verifies a Telegram bot token via the getMe API." (let ((url (format nil "https://api.telegram.org/bot~a/getMe" token))) @@ -103,7 +103,7 @@ In a traditional AI wrapper, the user manually edits a config file to add a bot #+end_src ** Linkage Command -#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun skill-gateway-link (platform token) "Primary capability to link a new platform. Returns status plist." (harness-log "GATEWAY: Attempting to link ~a..." platform) @@ -120,7 +120,7 @@ In a traditional AI wrapper, the user manually edits a config file to add a bot #+end_src ** CLI Main Wrapper -#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-gateway-manager.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun gateway-manager-main (platform token) "Main entry point for CLI-driven linkage." (if (and platform token) diff --git a/skills/org-skill-homoiconic-memory.org b/skills/org-skill-homoiconic-memory.org index 77f78ab..36579a7 100644 --- a/skills/org-skill-homoiconic-memory.org +++ b/skills/org-skill-homoiconic-memory.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-homoiconic-memory.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-homoiconic-memory.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: homoiconic-memory-skill :CREATED: [2026-04-10 Fri] diff --git a/skills/org-skill-lisp-utils.org b/skills/org-skill-lisp-utils.org index 8a788dc..85bcf15 100644 --- a/skills/org-skill-lisp-utils.org +++ b/skills/org-skill-lisp-utils.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-lisp-utils.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-lisp-utils.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: lisp-utils-skill :CREATED: [2026-04-23 Thu] @@ -159,7 +159,7 @@ Returns (VALUES t nil) if clean, or (VALUES nil error-message nil nil)." * Test Suite -#+begin_src lisp :tangle (expand-file-name "lisp-utils-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "lisp-utils-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-lisp-utils-tests (:use :cl :fiveam :opencortex) (:export #:lisp-utils-suite)) diff --git a/skills/org-skill-literate-programming.org b/skills/org-skill-literate-programming.org index 09eeb60..37839ee 100644 --- a/skills/org-skill-literate-programming.org +++ b/skills/org-skill-literate-programming.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-literate-programming.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-literate-programming.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: literate-programming-skill-2026 :CREATED: [2026-04-25 Sat] @@ -241,7 +241,7 @@ The LP skill runs at priority 1100 (just below engineering-standards at 1000). These tests verify the LP enforcement logic. Run with: ~(fiveam:run! 'literate-programming-suite)~ -#+begin_src lisp :tangle (expand-file-name "literate-programming-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "literate-programming-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-literate-programming-tests (:use :cl :fiveam :opencortex) (:export #:literate-programming-suite)) diff --git a/skills/org-skill-llama-backend.org b/skills/org-skill-llama-backend.org index 67a2a74..3312ac0 100644 --- a/skills/org-skill-llama-backend.org +++ b/skills/org-skill-llama-backend.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-llama-backend.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-llama-backend.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: llama-backend-skill :CREATED: [2026-04-17 Fri 20:00] diff --git a/skills/org-skill-llm-gateway.org b/skills/org-skill-llm-gateway.org index dfb42f4..1ef60f2 100644 --- a/skills/org-skill-llm-gateway.org +++ b/skills/org-skill-llm-gateway.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: llm-gateway-spec :CREATED: [2026-04-10 Thu] @@ -11,7 +11,7 @@ The *LLM Gateway* skill provides a unified interface for interacting with multiple Large Language Model providers. * Test Suite -#+begin_src lisp :tangle (expand-file-name "llm-gateway-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "llm-gateway-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-llm-gateway-tests (:use :cl :fiveam :opencortex) (:export #:llm-gateway-suite)) @@ -41,12 +41,12 @@ The *LLM Gateway* skill provides a unified interface for interacting with multip * Implementation ** Package Context -#+begin_src lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (in-package :opencortex) #+end_src ** Skill Metadata -#+begin_src lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defparameter *skill-llm-gateway* '(:name "llm-gateway" :description "Unified provider-agnostic LLM interface." @@ -56,7 +56,7 @@ The *LLM Gateway* skill provides a unified interface for interacting with multip #+end_src ** Request Execution -#+begin_src lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defun execute-llm-request (&key prompt system-prompt provider model) "Generic executor for all LLM providers." (let* ((active-provider (or provider :ollama)) @@ -76,7 +76,7 @@ The *LLM Gateway* skill provides a unified interface for interacting with multip #+end_src ** Cognitive Tools -#+begin_src lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (def-cognitive-tool :get-ollama-embedding "Generates vector embeddings via Ollama API." ((:text :type :string :description "Text to embed.")) @@ -92,7 +92,7 @@ The *LLM Gateway* skill provides a unified interface for interacting with multip (error (c) (harness-log "OLLAMA EMBED ERROR: ~a" c) nil)))))) #+end_src -#+begin_src lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (def-cognitive-tool :ask-llm "Unified interface for interacting with LLM providers." ((:prompt :type :string :description "The user prompt") @@ -107,7 +107,7 @@ The *LLM Gateway* skill provides a unified interface for interacting with multip #+end_src ** Skill Registration -#+begin_src lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-llm-gateway.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defskill :skill-llm-gateway :priority 50 :trigger (lambda (ctx) (declare (ignore ctx)) t) diff --git a/skills/org-skill-peripheral-vision.org b/skills/org-skill-peripheral-vision.org index 185aa77..5e26060 100644 --- a/skills/org-skill-peripheral-vision.org +++ b/skills/org-skill-peripheral-vision.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-peripheral-vision.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-peripheral-vision.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: org-skill-peripheral-vision :CREATED: [2026-04-12 Sun 14:15] diff --git a/skills/org-skill-policy.org b/skills/org-skill-policy.org index 66ed85d..3c1d1aa 100644 --- a/skills/org-skill-policy.org +++ b/skills/org-skill-policy.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-policy.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-policy.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: 47425a43-2be0-423c-8509-22592cfe9c9e :CREATED: [2026-04-07 Tue 12:57] @@ -50,7 +50,7 @@ Every skill executes within its own jailed package namespace, inheriting core ha #+end_src * Global Policy Configuration -#+begin_src lisp :tangle (expand-file-name "org-skill-policy.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-policy.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (defvar *policy-invariant-priorities* '((:transparency . 500) (:autonomy . 400) diff --git a/skills/org-skill-protocol-validator.org b/skills/org-skill-protocol-validator.org index 2623632..28ba444 100644 --- a/skills/org-skill-protocol-validator.org +++ b/skills/org-skill-protocol-validator.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-protocol-validator.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-protocol-validator.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: org-skill-communication-protocol-validator :CREATED: [2026-04-12 Sun 14:35] diff --git a/skills/org-skill-scribe.org b/skills/org-skill-scribe.org index 8b28024..52ccfa2 100644 --- a/skills/org-skill-scribe.org +++ b/skills/org-skill-scribe.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-scribe.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-scribe.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: scribe-skill :CREATED: [2026-04-13 Mon 18:40] diff --git a/skills/org-skill-self-edit.org b/skills/org-skill-self-edit.org index a4bdd4b..c32892f 100644 --- a/skills/org-skill-self-edit.org +++ b/skills/org-skill-self-edit.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-self-edit.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-self-edit.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: self-edit-001 :END: @@ -239,7 +239,7 @@ Swap compiled skill files without breaking active sockets. * Phase E: Verification -#+begin_src lisp :tangle (expand-file-name "self-edit-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "self-edit-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-self-edit-tests (:use :cl :fiveam :opencortex) (:export #:self-edit-suite)) diff --git a/skills/org-skill-self-fix.org b/skills/org-skill-self-fix.org index cfc20a4..79ba836 100644 --- a/skills/org-skill-self-fix.org +++ b/skills/org-skill-self-fix.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-self-fix.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-self-fix.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: 65891ce2-a465-49e6-a0c1-be13d3288d55 :CREATED: [2026-03-30 Mon 21:16] diff --git a/skills/org-skill-shell-actuator.org b/skills/org-skill-shell-actuator.org index 288ec33..9391c2f 100644 --- a/skills/org-skill-shell-actuator.org +++ b/skills/org-skill-shell-actuator.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-shell-actuator.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-shell-actuator.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: shell-actuator-skill :CREATED: [2026-04-12 Sun] @@ -12,7 +12,7 @@ The *Shell Actuator* provides a controlled interface for the OpenCortex to execu * Implementation -#+begin_src lisp :tangle (expand-file-name "org-skill-shell-actuator.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+begin_src lisp :tangle (expand-file-name "org-skill-shell-actuator.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) (in-package :opencortex) (defparameter *allowed-commands* '("ls" "git" "rg" "grep" "date" "echo" "cat" "node" "python3" "sbcl")) diff --git a/skills/org-skill-tool-permissions.org b/skills/org-skill-tool-permissions.org index 5f211bd..9360351 100644 --- a/skills/org-skill-tool-permissions.org +++ b/skills/org-skill-tool-permissions.org @@ -1,4 +1,4 @@ -#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-tool-permissions.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/skills")) +#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-tool-permissions.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/skills")) :PROPERTIES: :ID: tool-permissions-skill-001 :CREATED: [2026-04-23 Thu] @@ -135,7 +135,7 @@ Tool permissions and embedding generation via multiple providers. These tests verify tool permissions. Run with: ~(fiveam:run! 'tool-permissions-suite)~ -#+begin_src lisp :tangle (expand-file-name "tool-permissions-tests.lisp" (concat (or (uiop:getenv "INSTALL_DIR") ".") "/tests")) +#+begin_src lisp :tangle (expand-file-name "tool-permissions-tests.lisp" (concat (or (identity (getenv "INSTALL_DIR")) ".") "/tests")) (defpackage :opencortex-tool-permissions-tests (:use :cl :fiveam :opencortex) (:export #:tool-permissions-suite))