REFAC: Global rename of org-agent to opencortex

This commit is contained in:
2026-04-14 12:10:11 -04:00
parent b58b780a44
commit 849c078c37
95 changed files with 662 additions and 642 deletions

View File

@@ -11,7 +11,7 @@ The Act stage performs the final side-effects of the reasoning engine. It routes
The core harness can be configured via environment variables to operate silently or target different default outputs.
#+begin_src lisp :tangle ../src/act.lisp
(in-package :org-agent)
(in-package :opencortex)
(defvar *default-actuator* :cli)
(defvar *silent-actuators* '(:cli :system-message :emacs))
@@ -59,7 +59,7 @@ The `:system` actuator handles internal harness commands like code evaluation an
(:eval (let ((code (getf payload :code)))
(eval (read-from-string code))))
(:create-skill (let* ((filename (getf payload :filename)) (content (getf payload :content))
(skills-dir (merge-pathnames "skills/" (asdf:system-source-directory :org-agent)))
(skills-dir (merge-pathnames "skills/" (asdf:system-source-directory :opencortex)))
(full-path (merge-pathnames filename skills-dir)))
(with-open-file (out full-path :direction :output :if-exists :supersede) (write-string content out))
(load-skill-from-org full-path)))

View File

@@ -43,7 +43,7 @@ flowchart LR
We ensure all protocol logic resides within the isolated system namespace.
#+begin_src lisp :tangle ../src/communication.lisp
(in-package :org-agent)
(in-package :opencortex)
#+end_src
** Actuator Registry

View File

@@ -8,7 +8,7 @@
A common failure mode for Large Language Models (LLMs) is the "Lost in the Middle" phenomenon, where the model's reasoning accuracy degrades as its context window becomes saturated with irrelevant data. Naive approaches to context management—such as simple character-count truncation or sliding windows—often sever the structural relationships that define an Org-mode Memex.
The ~org-agent~ harness implements a deterministic, tree-aware solution: the **Foveal-Peripheral Hybrid Model**.
The ~opencortex~ harness implements a deterministic, tree-aware solution: the **Foveal-Peripheral Hybrid Model**.
*** 1. The Foveal Focus (High Resolution)
When the harness prepares a prompt for the Probabilistic Engine, it identifies a "Foveal Focus"—typically the specific Org headline or task the user is currently interacting with. This node, along with its immediate children and semantically relevant neighbors, is rendered at "High Resolution," meaning its full body text, properties, and metadata are included in the prompt.
@@ -38,7 +38,7 @@ The ~context.lisp~ module provides the deterministic functional layer for queryi
We begin by ensuring we are executing within the correct isolated package namespace.
#+begin_src lisp :tangle ../src/context.lisp
(in-package :org-agent)
(in-package :opencortex)
#+end_src
** Querying the Store (context-query-store)
@@ -214,10 +214,10 @@ Following the Engineering Standards, the peripheral vision extraction and render
** Test Suite Context
#+begin_src lisp :tangle ../tests/peripheral-vision-tests.lisp
(defpackage :org-agent-peripheral-vision-tests
(:use :cl :fiveam :org-agent)
(defpackage :opencortex-peripheral-vision-tests
(:use :cl :fiveam :opencortex)
(:export #:vision-suite))
(in-package :org-agent-peripheral-vision-tests)
(in-package :opencortex-peripheral-vision-tests)
(def-suite vision-suite
:description "Verification of Foveal-Peripheral context model.")
@@ -230,7 +230,7 @@ Verify that the foveal target is rendered with content, while siblings are skele
#+begin_src lisp :tangle ../tests/peripheral-vision-tests.lisp
(test test-foveal-rendering
"Verify that the foveal target is rendered with content, while siblings are skeletal."
(clrhash org-agent::*memory*)
(clrhash opencortex::*memory*)
(let* ((ast '(:type :HEADLINE :properties (:ID "proj-root" :TITLE "Project" :TAGS "project")
:contents ((:type :HEADLINE :properties (:ID "node-foveal" :TITLE "Foveal Node")
:raw-content "FOVEAL CONTENT" :contents nil)
@@ -250,7 +250,7 @@ Verify that context-assemble-global-awareness handles multiple projects correctl
#+begin_src lisp :tangle ../tests/peripheral-vision-tests.lisp
(test test-awareness-budget
"Verify that context-assemble-global-awareness handles multiple projects."
(clrhash org-agent::*memory*)
(clrhash opencortex::*memory*)
(ingest-ast '(:type :HEADLINE :properties (:ID "p1" :TITLE "Project 1" :TAGS "project") :contents nil))
(ingest-ast '(:type :HEADLINE :properties (:ID "p2" :TITLE "Project 2" :TAGS "project") :contents nil))
(let ((output (context-assemble-global-awareness)))

View File

@@ -5,7 +5,7 @@
* The Metabolic Loop (loop.lisp)
** Architectural Intent: The Heartbeat
The Metabolic Loop is the high-level coordinator of the Org-Agent. It orchestrates the flow of energy (information) through the system by calling the three metabolic stages in sequence:
The Metabolic Loop is the high-level coordinator of the OpenCortex. It orchestrates the flow of energy (information) through the system by calling the three metabolic stages in sequence:
1. **Perceive:** Sensory intake.
2. **Reason:** Cognitive processing.
3. **Act:** Physical side-effects.
@@ -14,7 +14,7 @@ The Metabolic Loop is the high-level coordinator of the Org-Agent. It orchestrat
The loop requires thread-safe interrupt handling to ensure that the agent can be stopped gracefully without leaving the Lisp image in an inconsistent state.
#+begin_src lisp :tangle ../src/loop.lisp
(in-package :org-agent)
(in-package :opencortex)
(defvar *interrupt-flag* nil)
(defvar *interrupt-lock* (bt:make-lock "harness-interrupt-lock"))
@@ -67,7 +67,7 @@ The heartbeat ensures the agent remains "alive" even in the absence of external
(sleep interval)
;; inject-stimulus is synchronous for heartbeats, preventing accumulation.
(inject-stimulus (list :type :EVENT :payload (list :sensor :heartbeat :unix-time (get-universal-time))))))
:name "org-agent-heartbeat"))))
:name "opencortex-heartbeat"))))
#+end_src
** Main Entry Point
@@ -77,7 +77,7 @@ The `main` function initializes the environment, loads skills, and starts the he
(defun main ()
"Entry point for the Skeleton MVP. Handles initialization and graceful shutdown."
(let* ((home (uiop:getenv "HOME"))
(env-file (uiop:merge-pathnames* ".local/share/org-agent/.env" (uiop:ensure-directory-pathname home))))
(env-file (uiop:merge-pathnames* ".local/share/opencortex/.env" (uiop:ensure-directory-pathname home))))
(when (uiop:file-exists-p env-file) (cl-dotenv:load-env env-file)))
(initialize-actuators)

View File

@@ -1,20 +1,20 @@
#+TITLE: Manifest (org-agent.asd)
#+TITLE: Manifest (opencortex.asd)
#+AUTHOR: Amr
#+FILETAGS: :harness:system:
#+STARTUP: content
* Manifest (org-agent.asd)
* Manifest (opencortex.asd)
** Architectural Intent: The ASDF Skeleton
The ~org-agent.asd~ file is the physical blueprint of the Lisp Machine. It uses **Another System Definition Facility (ASDF)** to orchestrate the compilation and loading of all harness modules.
The ~opencortex.asd~ file is the physical blueprint of the Lisp Machine. It uses **Another System Definition Facility (ASDF)** to orchestrate the compilation and loading of all harness modules.
Traditional Lisp systems often use complex, non-linear dependency graphs. However, the ~org-agent~ harness mandates a strict, linear bootstrap sequence.
Traditional Lisp systems often use complex, non-linear dependency graphs. However, the ~opencortex~ harness mandates a strict, linear bootstrap sequence.
*** 1. Strict Serial Loading (:serial t)
The harness uses the ~:serial t~ flag. This is a critical design choice that ensures every file is compiled and loaded in the exact order it appears in the ~:components~ list. This eliminates "macro-not-found" errors by guaranteeing that the ~package.lisp~ and ~skills.lisp~ (where the core macros are defined) are always established before any behavioral logic or skills are loaded.
*** 2. Isolation of the Verification Suite
To maintain a "Zero-Overhead" production environment, the testing logic is isolated into a secondary system: ~:org-agent/tests~. This allows the harness to boot in production without loading the ~FiveAM~ framework or the voluminous test data, keeping the memory footprint minimal and the attack surface small.
To maintain a "Zero-Overhead" production environment, the testing logic is isolated into a secondary system: ~:opencortex/tests~. This allows the harness to boot in production without loading the ~FiveAM~ framework or the voluminous test data, keeping the memory footprint minimal and the attack surface small.
** The Build Pipeline
#+begin_src mermaid
@@ -29,9 +29,9 @@ flowchart TD
** Harness System Definition
This system defines the core "Thin Harness." It includes the protocol, the object store, and the functional loop.
#+begin_src lisp :tangle ../org-agent.asd
(defsystem :org-agent
:name "org-agent"
#+begin_src lisp :tangle ../opencortex.asd
(defsystem :opencortex
:name "opencortex"
:author "Amr"
:version "0.1.0"
:license "AGPLv3"
@@ -49,26 +49,26 @@ This system defines the core "Thin Harness." It includes the protocol, the objec
(:file "src/deterministic")
(:file "src/loop"))
:build-operation "program-op"
:build-pathname "org-agent-server"
:entry-point "org-agent:main")
:build-pathname "opencortex-server"
:entry-point "opencortex:main")
#+end_src
** Verification Suite Definition
This system contains the empirical tests required by the Engineering Standards. It depends on ~:org-agent~ and the ~FiveAM~ testing framework.
This system contains the empirical tests required by the Engineering Standards. It depends on ~:opencortex~ and the ~FiveAM~ testing framework.
#+begin_src lisp :tangle ../org-agent.asd
(defsystem :org-agent/tests
:depends-on (:org-agent :fiveam)
#+begin_src lisp :tangle ../opencortex.asd
(defsystem :opencortex/tests
:depends-on (:opencortex :fiveam)
:components ((:file "tests/communication-tests")
(:file "tests/pipeline-tests")
(:file "tests/boot-sequence-tests")
(:file "tests/memory-tests")
(:file "tests/immune-system-tests"))
:perform (test-op (o s)
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :communication-protocol-suite :org-agent-tests))
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :pipeline-suite :org-agent-pipeline-tests))
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :safety-suite :org-agent-safety-tests))
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :boot-suite :org-agent-boot-tests))
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :memory-suite :org-agent-memory-tests))
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :immune-suite :org-agent-immune-system-tests))))
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :communication-protocol-suite :opencortex-tests))
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :pipeline-suite :opencortex-pipeline-tests))
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :safety-suite :opencortex-safety-tests))
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :boot-suite :opencortex-boot-tests))
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :memory-suite :opencortex-memory-tests))
(uiop:symbol-call :fiveam :run! (uiop:find-symbol* :immune-suite :opencortex-immune-system-tests))))
#+end_src

View File

@@ -6,9 +6,9 @@
* The System Memory (memory.lisp)
** Architectural Intent: The Single Address Space (Live Memory)
Yes, the Memory module is the cognitive bedrock of the org-agent. It is not a database; it is the agent's live, active "brain" state.
Yes, the Memory module is the cognitive bedrock of the opencortex. It is not a database; it is the agent's live, active "brain" state.
Traditional architectures rely on external databases (SQLite, Vector DBs) which introduce I/O latency and structural impedance. The org-agent architecture chooses a different path: the **Single Address Space**. By treating the entire knowledge base as a graph of Lisp pointers, we achieve microsecond recollection and total structural transparency.
Traditional architectures rely on external databases (SQLite, Vector DBs) which introduce I/O latency and structural impedance. The opencortex architecture chooses a different path: the **Single Address Space**. By treating the entire knowledge base as a graph of Lisp pointers, we achieve microsecond recollection and total structural transparency.
- **Pointer-Based Reasoning:** By loading the entire knowledge graph into a live Common Lisp hash table, we achieve microsecond recollection. The harness doesn't "search a file"; it traverses a memory pointer.
- **Memory Imaging:** The ability to snapshot the Lisp image allows the agent to resume its entire cognitive state instantly, solving the "Cold Start" problem.
@@ -32,7 +32,7 @@ flowchart TD
** Package Context
#+begin_src lisp :tangle ../src/memory.lisp
(in-package :org-agent)
(in-package :opencortex)
#+end_src
** The Object Repository
@@ -179,11 +179,11 @@ Utility functions for AST traversal and path resolution.
Following the Engineering Standards, the Memory must be empirically verified through automated testing. The following test suite ensures the mathematical integrity of the Merkle hashes and the behavioral correctness of the immutable versioning and rollback systems.
#+begin_src lisp :tangle ../tests/memory-tests.lisp
(defpackage :org-agent-memory-tests
(:use :cl :fiveam :org-agent)
(defpackage :opencortex-memory-tests
(:use :cl :fiveam :opencortex)
(:export #:memory-suite))
(in-package :org-agent-memory-tests)
(in-package :opencortex-memory-tests)
(def-suite memory-suite
:description "Tests for the Merkle-Tree Memory.")

View File

@@ -4,7 +4,7 @@
#+STARTUP: content
* System Interface (package.lisp)
The ~package.lisp~ file defines the public API of the ~org-agent~ harness. It serves as the primary membrane between the deterministic core modules and the dynamic world of skills and actuators.
The ~package.lisp~ file defines the public API of the ~opencortex~ harness. It serves as the primary membrane between the deterministic core modules and the dynamic world of skills and actuators.
** Architectural Intent: The Package Membrane
By strictly defining the public interface, we ensure that skills remain decoupled from the harness implementation details. This allows for autonomous replacement of any component (e.g., swapping the Memory or the Probabilistic Engine) without breaking existing skills.
@@ -19,7 +19,7 @@ flowchart TD
** Public API Export
#+begin_src lisp :tangle ../src/package.lisp
(defpackage :org-agent
(defpackage :opencortex
(:use :cl)
(:export
;; --- communication protocol ---
@@ -127,7 +127,7 @@ flowchart TD
** Package Implementation
#+begin_src lisp :tangle ../src/package.lisp
(in-package :org-agent)
(in-package :opencortex)
#+end_src
** Harness Logging State

View File

@@ -5,13 +5,13 @@
* Stage 1: Perceive (perceive.lisp)
** Architectural Intent: Sensory Ingestion
The Perceive stage is the "sensory cortex" of the Org-Agent. It takes raw stimuli from the outside world (keyboard events, chat messages, heartbeats, or system interrupts) and normalizes them into internal **Signals**.
The Perceive stage is the "sensory cortex" of the OpenCortex. It takes raw stimuli from the outside world (keyboard events, chat messages, heartbeats, or system interrupts) and normalizes them into internal **Signals**.
** Async Sensor Routing
To prevent blocking the main pipeline, certain sensors (like user commands or chat messages) are processed asynchronously in their own threads.
#+begin_src lisp :tangle ../src/perceive.lisp
(in-package :org-agent)
(in-package :opencortex)
(defvar *async-sensors* '(:chat-message :delegation :user-command)
"List of sensors that should be processed asynchronously to avoid blocking gateways.")
@@ -41,7 +41,7 @@ The entry point for raw messages. It determines if the signal should be processe
(restart-case (handler-bind ((error (lambda (c) (harness-log "ASYNC ERROR: ~a" c) (invoke-restart 'skip-event))))
(process-signal raw-message))
(skip-event () nil)))
:name "org-agent-async-task")
:name "opencortex-async-task")
(restart-case (handler-bind ((error (lambda (c) (harness-log "SYSTEM ERROR: ~a" c) (invoke-restart 'skip-event))))
(process-signal raw-message))
(skip-event () (harness-log "SYSTEM RECOVERY: Stimulus dropped.~%"))))))

View File

@@ -5,7 +5,7 @@
* Stage 2: Reason (reason.lisp)
** Architectural Intent: Unified Cognition
The Reason stage is the cognitive engine of the Org-Agent. It unifies two distinct reasoning modes:
The Reason stage is the cognitive engine of the OpenCortex. It unifies two distinct reasoning modes:
1. **Probabilistic Reasoning:** Consulting neural models (LLMs) to generate action proposals based on current context.
2. **Deterministic Reasoning:** Running those proposals through a series of deterministic safety gates (Policy, Invariants, and Skill-specific validation) to ensure alignment and security.
@@ -13,7 +13,7 @@ The Reason stage is the cognitive engine of the Org-Agent. It unifies two distin
We initialize the probabilistic backends and the provider cascade which determines the order in which models are consulted.
#+begin_src lisp :tangle ../src/reason.lisp
(in-package :org-agent)
(in-package :opencortex)
(defvar *probabilistic-backends* (make-hash-table :test 'equal))
(defvar *provider-cascade* nil)

View File

@@ -4,9 +4,9 @@
#+STARTUP: content
* Overview: The Zero-to-One Experience
The *Setup & Onboarding* process ensures that users can boot the ~org-agent~ Lisp Machine with zero friction. We follow the *Appliance Paradigm* for standard users (Docker-first) and provide a *Power User Path* (Baremetal) for those wanting deep native integration.
The *Setup & Onboarding* process ensures that users can boot the ~opencortex~ Lisp Machine with zero friction. We follow the *Appliance Paradigm* for standard users (Docker-first) and provide a *Power User Path* (Baremetal) for those wanting deep native integration.
This file is a Literate Devops document. Tangling it generates the Docker configuration and the unified entrypoint script (~org-agent.sh~).
This file is a Literate Devops document. Tangling it generates the Docker configuration and the unified entrypoint script (~opencortex.sh~).
* 1. The Appliance Paradigm (Docker First)
The easiest way to run the agent is via Docker. This prevents the user from having to manually manage SBCL, Quicklisp, Python virtual environments, Playwright binaries, and Java (for Signal).
@@ -15,7 +15,7 @@ The easiest way to run the agent is via Docker. This prevents the user from havi
The container wraps all messy OS dependencies and pre-caches the Lisp environment for rapid booting.
#+begin_src dockerfile :tangle ../Dockerfile
# ORG-AGENT v1.0 Production Environment
# OPENCORTEX v1.0 Production Environment
FROM debian:bookworm-slim
# Prevent interactive prompts during build
@@ -66,12 +66,12 @@ RUN echo '(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-ho
# 6. Setup Application Directory
WORKDIR /app
COPY . /app/projects/org-agent
COPY . /app/projects/opencortex
# 7. Pre-cache Lisp Dependencies
RUN sbcl --non-interactive \
--eval '(push #p"/app/projects/org-agent/" asdf:*central-registry*)' \
--eval '(ql:quickload :org-agent)'
--eval '(push #p"/app/projects/opencortex/" asdf:*central-registry*)' \
--eval '(ql:quickload :opencortex)'
# 8. Environment & Volumes
# The host's memex root should be mounted to /memex
@@ -83,22 +83,22 @@ EXPOSE 9105 8080
# Entrypoint
CMD ["sbcl", "--non-interactive", \
"--eval", "(push #p\"/app/projects/org-agent/\" asdf:*central-registry*)", \
"--eval", "(ql:quickload :org-agent)", \
"--eval", "(org-agent:main)"]
"--eval", "(push #p\"/app/projects/opencortex/\" asdf:*central-registry*)", \
"--eval", "(ql:quickload :opencortex)", \
"--eval", "(opencortex:main)"]
#+end_src
** Docker Compose
#+begin_src yaml :tangle ../docker-compose.yml
services:
org-agent:
opencortex:
build:
context: .
dockerfile: Dockerfile
container_name: org-agent
container_name: opencortex
env_file: .env
volumes:
# Mount the entire memex directory (2 levels up from projects/org-agent)
# Mount the entire memex directory (2 levels up from projects/opencortex)
- ../..:/memex
# Ensure signal-cli state is preserved
- signal-state:/root/.local/share/signal-cli
@@ -111,12 +111,12 @@ volumes:
signal-state:
#+end_src
* 2. The Unified Entrypoint (org-agent.sh)
* 2. The Unified Entrypoint (opencortex.sh)
We combine the installation script, the daemon launcher, and the CLI chat client into a single, elegant bash script.
If the agent is running, it connects to the chat. If it's installed but offline, it boots the daemon. If it's not installed at all, it walks the user through the onboarding wizard.
#+begin_src bash :tangle ../org-agent.sh :shebang "#!/bin/bash"
#+begin_src bash :tangle ../opencortex.sh :shebang "#!/bin/bash"
set -e
PORT=9105
@@ -149,8 +149,8 @@ elif command_exists nc && nc -z $HOST $PORT 2>/dev/null; then
fi
# 2. Check if we have an existing installation we can boot
if [ -f "$HOME/.org-agent-path" ]; then
INSTALL_DIR=$(cat "$HOME/.org-agent-path")
if [ -f "$HOME/.opencortex-path" ]; then
INSTALL_DIR=$(cat "$HOME/.opencortex-path")
if [ -d "$INSTALL_DIR" ] && [ -f "$INSTALL_DIR/docker-compose.yml" ]; then
echo -e "${YELLOW}Daemon is offline. Booting from $INSTALL_DIR...${NC}"
cd "$INSTALL_DIR"
@@ -166,7 +166,7 @@ fi
if [ -f "docker-compose.yml" ] && [ -d "literate" ]; then
echo -e "${YELLOW}Local repository detected. Ensuring configuration...${NC}"
INSTALL_DIR=$(pwd)
echo "$INSTALL_DIR" > "$HOME/.org-agent-path"
echo "$INSTALL_DIR" > "$HOME/.opencortex-path"
if [ ! -f .env ]; then
cp .env.example .env
@@ -209,14 +209,14 @@ fi
# 4. Zero-to-One Onboarding (No installation found)
echo -e "${BLUE}==================================================${NC}"
echo -e "${BLUE} org-agent: Autonomous Intelligence Onboarding ${NC}"
echo -e "${BLUE} opencortex: Autonomous Intelligence Onboarding ${NC}"
echo -e "${BLUE}==================================================${NC}"
# --- OS & Docker Detection ---
echo -e "\n${BLUE}[1/2] Verifying Environment...${NC}"
install_docker() {
echo -e "${YELLOW}Docker is required to run org-agent natively without messy dependencies.${NC}"
echo -e "${YELLOW}Docker is required to run opencortex natively without messy dependencies.${NC}"
read -p "Would you like me to attempt to install Docker? [Y/n]: " install_choice
install_choice=${install_choice:-Y}
if [[ "$install_choice" =~ ^[Yy]$ ]]; then
@@ -269,27 +269,27 @@ MEMEX_TARGET=${MEMEX_TARGET:-$MEMEX_DEFAULT}
mkdir -p "$MEMEX_TARGET/projects"
cd "$MEMEX_TARGET/projects"
if [ ! -d "org-agent" ]; then
echo "Cloning org-agent..."
git clone https://github.com/gharbeia/org-agent.git
cd org-agent
if [ ! -d "opencortex" ]; then
echo "Cloning opencortex..."
git clone https://github.com/gharbeia/opencortex.git
cd opencortex
else
echo -e "${GREEN}✓ Repository already exists.${NC}"
cd org-agent
cd opencortex
git pull origin main
fi
mkdir -p "$HOME/.local/bin"
ln -sf "$(pwd)/org-agent.sh" "$HOME/.local/bin/org-agent"
echo -e "${GREEN}✓ Installed 'org-agent' command to ~/.local/bin${NC}"
ln -sf "$(pwd)/opencortex.sh" "$HOME/.local/bin/opencortex"
echo -e "${GREEN}✓ Installed 'opencortex' command to ~/.local/bin${NC}"
# Ensure proper ownership if sudo was used for apt
if [ -n "$SUDO_USER" ]; then
chown -R "$SUDO_USER" "$MEMEX_TARGET/projects/org-agent"
chown -R "$SUDO_USER" "$MEMEX_TARGET/projects/opencortex"
fi
# Execute the newly cloned script to run configuration (Step 3)
exec ./org-agent.sh
exec ./opencortex.sh
#+end_src
* 3. The Power-User Path (Baremetal Onboarding)
@@ -299,7 +299,7 @@ For users who want to run the Lisp Machine natively on their host OS (typically
set -e
RED='\033[0;31m'; GREEN='\033[0;32m'; BLUE='\033[0;34m'; NC='\033[0m'
echo -e "${BLUE}=== org-agent: Baremetal Power-User Setup ===${NC}"
echo -e "${BLUE}=== opencortex: Baremetal Power-User Setup ===${NC}"
if ! command -v sbcl >/dev/null 2>&1; then
echo -e "${RED}✗ SBCL not found. Please install it first.${NC}"

View File

@@ -11,10 +11,10 @@ A static, hardcoded architecture is inherently fragile. To build a autonomous ag
Skills unify the **"Why"** (Literate Org documentation) and the **"How"** (Functional Lisp implementation). This allows the harness to "learn" new behaviors without a full system restart, enabling a continuous evolutionary loop where the agent can eventually inspect and improve its own code.
*** The True Microkernel (Decoupled Core Skills)
Historically, "core" skills (like State Persistence or Gateways) were statically compiled into the harness for performance. We have fundamentally decoupled this. Now, *all* behavioral skills are pure user-space dynamic modules. They do not tangle to `src/` and are not listed in `org-agent.asd`. The harness simply boots, scans the `skills/` directory, and evaluates the code inside a jailed package. If a user wishes to swap the IPFS persistence skill for an AWS S3 one, they simply swap the `.org` file; no kernel recompilation is required.
Historically, "core" skills (like State Persistence or Gateways) were statically compiled into the harness for performance. We have fundamentally decoupled this. Now, *all* behavioral skills are pure user-space dynamic modules. They do not tangle to `src/` and are not listed in `opencortex.asd`. The harness simply boots, scans the `skills/` directory, and evaluates the code inside a jailed package. If a user wishes to swap the IPFS persistence skill for an AWS S3 one, they simply swap the `.org` file; no kernel recompilation is required.
*** Dormant Verification (Tests)
Because skills are no longer statically compiled into the core `org-agent` ASDF system, their associated `FiveAM` test blocks are currently dormant during a standard static build. The tests still exist within the literate `.org` files as verifiable documentation, but executing them requires either dynamic evaluation at runtime or a dedicated test-loader skill.
Because skills are no longer statically compiled into the core `opencortex` ASDF system, their associated `FiveAM` test blocks are currently dormant during a standard static build. The tests still exist within the literate `.org` files as verifiable documentation, but executing them requires either dynamic evaluation at runtime or a dedicated test-loader skill.
*** 1. The Package Jailing Principle
Every skill is evaluated within its own dedicated Common Lisp package (namespace). This "Jailing" prevents symbol collisions between disparate skills and ensures that a bug in one module cannot easily corrupt the internal state of another.
@@ -32,9 +32,9 @@ flowchart TD
S3 -- Depends On --> S2
subgraph Jailing[Package Jailing]
P1[Package: ORG-AGENT.SKILLS.S1]
P2[Package: ORG-AGENT.SKILLS.S2]
P3[Package: ORG-AGENT.SKILLS.S3]
P1[Package: OPENCORTEX.SKILLS.S1]
P2[Package: OPENCORTEX.SKILLS.S2]
P3[Package: OPENCORTEX.SKILLS.S3]
end
S1 --> P1
@@ -46,7 +46,7 @@ flowchart TD
We begin by ensuring we are in the correct isolated harness namespace.
#+begin_src lisp :tangle ../src/skills.lisp
(in-package :org-agent)
(in-package :opencortex)
#+end_src
** Skill Metadata (defstruct skill)
@@ -209,8 +209,8 @@ A pre-flight safety check. Before evaluating any code from an Org file, the harn
The core "hot-loading" mechanism. It extracts Lisp blocks from an Org file and evaluates them within a "Jail" (an isolated package).
*** The Jailing Algorithm:
1. **Isolation:** It generates a package name based on the filename (e.g., ~ORG-AGENT.SKILLS.CORE-LOGIC~).
2. **Namespace Protection:** It inherits external symbols from the ~ORG-AGENT~ package, allowing the skill to use the harness API, but keeps its internal helper functions local.
1. **Isolation:** It generates a package name based on the filename (e.g., ~OPENCORTEX.SKILLS.CORE-LOGIC~).
2. **Namespace Protection:** It inherits external symbols from the ~OPENCORTEX~ package, allowing the skill to use the harness API, but keeps its internal helper functions local.
3. **Block Filtering:** It explicitly ignores blocks that contain ~:tangle~, ensuring that harness-level code (which is already in ~src/~) is not accidentally re-evaluated as skill logic.
#+begin_src lisp :tangle ../src/skills.lisp
@@ -226,7 +226,7 @@ The core "hot-loading" mechanism. It extracts Lisp blocks from an Org file and e
(lines (uiop:split-string content :separator '(#\Newline)))
(in-lisp-block nil)
(lisp-code "")
(pkg-name (intern (string-upcase (format nil "ORG-AGENT.SKILLS.~a" skill-base-name)) :keyword)))
(pkg-name (intern (string-upcase (format nil "OPENCORTEX.SKILLS.~a" skill-base-name)) :keyword)))
(dolist (line lines)
(let ((clean-line (string-trim '(#\Space #\Tab #\Return) line)))
@@ -253,7 +253,7 @@ The core "hot-loading" mechanism. It extracts Lisp blocks from an Org file and e
(harness-log "HARNESS: Jailing skill '~a' in package ~a" skill-base-name pkg-name)
(unless (find-package pkg-name)
(let ((new-pkg (make-package pkg-name :use '(:cl))))
(do-external-symbols (sym (find-package :org-agent)) (shadowing-import sym new-pkg))))
(do-external-symbols (sym (find-package :opencortex)) (shadowing-import sym new-pkg))))
(let ((*read-eval* nil) (*package* (find-package pkg-name)))
(eval (read-from-string (format nil "(progn ~a)" lisp-code))))
@@ -398,9 +398,9 @@ The harness provides a baseline set of cognitive tools that enable core system i
:guard (lambda (args context)
(declare (ignore context))
(let ((code (getf args :code)))
(let ((harness-pkg (find-package :org-agent.skills.org-skill-lisp-validator)))
(let ((harness-pkg (find-package :opencortex.skills.org-skill-lisp-validator)))
(if harness-pkg
(uiop:symbol-call :org-agent.skills.org-skill-lisp-validator :lisp-validator-validate code)
(uiop:symbol-call :opencortex.skills.org-skill-lisp-validator :lisp-validator-validate code)
t))))
:body (lambda (args)
(let ((code (getf args :code)))