REFAC: Global rename of org-agent to opencortex
This commit is contained in:
@@ -12,7 +12,7 @@ The *Deterministic Engine Bouncer* is the authorization gate for high-risk actio
|
||||
|
||||
* Package Context
|
||||
#+begin_src lisp
|
||||
(in-package :org-agent)
|
||||
(in-package :opencortex)
|
||||
#+end_src
|
||||
|
||||
* Deep Packet Inspection (DPI)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#+FILETAGS: :chat:conversational:ui:autonomy:
|
||||
|
||||
* Overview
|
||||
The *Chat Agent* provides a dedicated conversational interface within Emacs (`*org-agent-chat*`). It enables fluid dialogue while maintaining strict persona alignment and contextual awareness.
|
||||
The *Chat Agent* provides a dedicated conversational interface within Emacs (`*opencortex-chat*`). It enables fluid dialogue while maintaining strict persona alignment and contextual awareness.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
@@ -101,11 +101,11 @@ Interfaces for conversational event handling and UI integration. Source of truth
|
||||
(chat-archive-message (getf payload :text) :role :agent :channel target :chat-id (or (getf payload :chat-id) (getf payload :room-id))))
|
||||
proposed-action)
|
||||
(let ((err-text (format nil "\n\n*System Error:* Chat agent returned invalid action: ~s" proposed-action)))
|
||||
`(:type :request :target :emacs :payload (:action :insert-at-end :buffer "*org-agent-chat*" :text ,err-text))))))
|
||||
`(:type :request :target :emacs :payload (:action :insert-at-end :buffer "*opencortex-chat*" :text ,err-text))))))
|
||||
#+end_src
|
||||
|
||||
** Neural Response Generation
|
||||
The Chat skill acts as the conversational UI. Because the ~org-agent~ kernel evaluates LLM output via ~read-from-string~ (expecting a valid s-expression) and the chat verifier strictly expects an Emacs ~:insert-at-end~ actuation, we must explicitly mandate that the LLM wraps its conversational output in a Common Lisp property list.
|
||||
The Chat skill acts as the conversational UI. Because the ~opencortex~ kernel evaluates LLM output via ~read-from-string~ (expecting a valid s-expression) and the chat verifier strictly expects an Emacs ~:insert-at-end~ actuation, we must explicitly mandate that the LLM wraps its conversational output in a Common Lisp property list.
|
||||
|
||||
#+begin_src lisp
|
||||
(defun probabilistic-skill-chat (context)
|
||||
@@ -125,9 +125,9 @@ The Chat skill acts as the conversational UI. Because the ~org-agent~ kernel eva
|
||||
(:signal (format nil "- To reply via Signal: (:type :REQUEST :target :signal :chat-id \"~a\" :text \"<Response>\")" chat-id))
|
||||
(:matrix (format nil "- To reply via Matrix: (:type :REQUEST :target :matrix :room-id \"~a\" :text \"<Response>\")" chat-id))
|
||||
(:cli (format nil "- To reply via CLI: (:type :REQUEST :target :cli :text \"<Response>\")"))
|
||||
(t "- To reply via Emacs: (:type :REQUEST :target :emacs :action :insert-at-end :buffer \"*org-agent-chat*\" :text \"* <Response>\")"))))
|
||||
(t "- To reply via Emacs: (:type :REQUEST :target :emacs :action :insert-at-end :buffer \"*opencortex-chat*\" :text \"* <Response>\")"))))
|
||||
(ask-probabilistic trimmed-text :system-prompt (concatenate 'string
|
||||
"ACTUATOR IDENTITY: You are the pure Lisp actuator for the org-agent kernel.
|
||||
"ACTUATOR IDENTITY: You are the pure Lisp actuator for the opencortex kernel.
|
||||
MANDATE: Output EXACTLY ONE Common Lisp property list starting with (:type :REQUEST).
|
||||
ZERO CONVERSATION: Do not explain. Do not use markdown.
|
||||
STRICT RULE: Never output the strings 'Unknown request' or 'System Error'.
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#+FILETAGS: :gateway:cli:io:autonomy:
|
||||
|
||||
* Overview
|
||||
The *CLI Gateway* is the primary interaction point for the Org-Agent MVP. It provides a lightweight TCP socket server that allows local terminal clients to communicate with the daemon. It ensures a frictionless "First Contact" experience immediately following installation.
|
||||
The *CLI Gateway* is the primary interaction point for the OpenCortex MVP. It provides a lightweight TCP socket server that allows local terminal clients to communicate with the daemon. It ensures a frictionless "First Contact" experience immediately following installation.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
@@ -15,7 +15,7 @@ The *CLI Gateway* is the primary interaction point for the Org-Agent MVP. It pro
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Provide a secure, local, and low-latency terminal interface for the Org-Agent.
|
||||
Provide a secure, local, and low-latency terminal interface for the OpenCortex.
|
||||
|
||||
** 2. Success Criteria
|
||||
- [X] *Ingress:* Accept plain-text messages over TCP port 9105.
|
||||
@@ -39,7 +39,7 @@ The gateway runs a multi-threaded TCP server. Each connection is handled in its
|
||||
|
||||
** Package Context
|
||||
#+begin_src lisp
|
||||
(in-package :org-agent)
|
||||
(in-package :opencortex)
|
||||
#+end_src
|
||||
|
||||
** State: Server Control
|
||||
@@ -110,9 +110,9 @@ Listens for new TCP connections on the configured port.
|
||||
(bt:make-thread (lambda ()
|
||||
(unwind-protect (handle-cli-client stream)
|
||||
(usocket:socket-close socket)))
|
||||
:name "org-agent-cli-client-handler")))
|
||||
:name "opencortex-cli-client-handler")))
|
||||
(usocket:socket-close *cli-server-socket*)))
|
||||
:name "org-agent-cli-gateway"))
|
||||
:name "opencortex-cli-gateway"))
|
||||
(harness-log "CLI: Gateway listening on port ~a" port))
|
||||
#+end_src
|
||||
|
||||
@@ -136,8 +136,8 @@ Listens for new TCP connections on the configured port.
|
||||
We tangle a lightweight client script that the user can run on their host machine.
|
||||
|
||||
** The Bash Client
|
||||
#+begin_src bash :tangle ../scripts/org-agent-chat.sh :shebang "#!/bin/bash"
|
||||
# org-agent-chat: The terminal mouthpiece for the Autonomous Brain.
|
||||
#+begin_src bash :tangle ../scripts/opencortex-chat.sh :shebang "#!/bin/bash"
|
||||
# opencortex-chat: The terminal mouthpiece for the Autonomous Brain.
|
||||
PORT=9105
|
||||
HOST=${1:-localhost}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#+DEPENDS_ON: skill-sub-agent-manager
|
||||
|
||||
* Overview
|
||||
The *Social Consensus Protocol* enables multi-agent negotiation. It provides a Lisp-native implementation of decentralized agreement, allowing federated `org-agent` instances to coordinate on shared resources and conflicting goals.
|
||||
The *Social Consensus Protocol* enables multi-agent negotiation. It provides a Lisp-native implementation of decentralized agreement, allowing federated `opencortex` instances to coordinate on shared resources and conflicting goals.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
@@ -30,10 +30,10 @@ Enable reliable, cross-instance coordination without a central master.
|
||||
#+begin_src lisp
|
||||
(defun consensus-propose-vote (proposal)
|
||||
"Broadcasts a proposal to the peer swarm and collects votes.
|
||||
Implements org-agent Social Consensus Protocol."
|
||||
Implements opencortex Social Consensus Protocol."
|
||||
(let* ((peers (get-swarm-peer-list))
|
||||
(votes (loop for peer in peers
|
||||
collect (org-agent:send-swarm-packet peer `(:type :REQUEST :action :vote :proposal ,proposal)))))
|
||||
collect (opencortex:send-swarm-packet peer `(:type :REQUEST :action :vote :proposal ,proposal)))))
|
||||
(if (> (count :YES votes) (/ (length peers) 2))
|
||||
t ; Consensus reached
|
||||
nil)))
|
||||
@@ -60,7 +60,7 @@ Enable reliable, cross-instance coordination without a central master.
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
The consensus protocol should be implemented as a swarm behavior modeled after Raft, but simplified for the constraints of the `org-agent` ecosystem (i.e. eventual consistency, potentially unreliable messaging). The architecture should allow for future extensions, such as dynamically adjusting the voting threshold based on swarm size or node reputation. We use gossip protocols for state sharing.
|
||||
The consensus protocol should be implemented as a swarm behavior modeled after Raft, but simplified for the constraints of the `opencortex` ecosystem (i.e. eventual consistency, potentially unreliable messaging). The architecture should allow for future extensions, such as dynamically adjusting the voting threshold based on swarm size or node reputation. We use gossip protocols for state sharing.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#+DEPENDS_ON: id:state-persistence-skill
|
||||
|
||||
* Overview
|
||||
The *Credentials Vault* is the high-security enclave for the Org-Agent. It centralizes the management of LLM API keys, OAuth sessions, and browser cookies. By consolidating these into a single vault, we ensure that sensitive tokens are handled with uniform masking, validation, and Merkle-integrated persistence.
|
||||
The *Credentials Vault* is the high-security enclave for the OpenCortex. It centralizes the management of LLM API keys, OAuth sessions, and browser cookies. By consolidating these into a single vault, we ensure that sensitive tokens are handled with uniform masking, validation, and Merkle-integrated persistence.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
@@ -16,7 +16,7 @@ The *Credentials Vault* is the high-security enclave for the Org-Agent. It centr
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Securely manage all authentication tokens required for the org-agent to operate.
|
||||
Securely manage all authentication tokens required for the opencortex to operate.
|
||||
|
||||
** 2. User Needs
|
||||
- *Unified Storage:* Single interface for API keys and Session Cookies.
|
||||
@@ -152,22 +152,22 @@ Retained from the legacy Google skill, this provides the instructions for the au
|
||||
|
||||
** 1. Unit Tests (FiveAM)
|
||||
#+begin_src lisp
|
||||
(defpackage :org-agent-vault-tests
|
||||
(:use :cl :fiveam :org-agent))
|
||||
(in-package :org-agent-vault-tests)
|
||||
(defpackage :opencortex-vault-tests
|
||||
(:use :cl :fiveam :opencortex))
|
||||
(in-package :opencortex-vault-tests)
|
||||
|
||||
(def-suite vault-suite :description "Tests for the Credentials Vault.")
|
||||
(in-suite vault-suite)
|
||||
|
||||
(test test-masking
|
||||
(is (equal "sk-t...-key" (org-agent::vault-mask-string "sk-test-key")))
|
||||
(is (equal "[REDACTED]" (org-agent::vault-mask-string "short"))))
|
||||
(is (equal "sk-t...-key" (opencortex::vault-mask-string "sk-test-key")))
|
||||
(is (equal "[REDACTED]" (opencortex::vault-mask-string "short"))))
|
||||
|
||||
(test test-vault-persistence
|
||||
"Verify that setting a secret triggers a snapshot (mock check)."
|
||||
(let ((old-version (org-agent::org-object-version (gethash "root" *memory*))))
|
||||
(org-agent:vault-set-secret :test "secret-val")
|
||||
(is (> (org-agent::org-object-version (gethash "root" *memory*)) old-version))))
|
||||
(let ((old-version (opencortex::org-object-version (gethash "root" *memory*))))
|
||||
(opencortex:vault-set-secret :test "secret-val")
|
||||
(is (> (opencortex::org-object-version (gethash "root" *memory*)) old-version))))
|
||||
#+end_src
|
||||
|
||||
** 2. Chaos Scenarios
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#+FILETAGS: :embedding:vector-search:semantic:autonomy:
|
||||
|
||||
* Overview
|
||||
The *Vector Embedding* skill provides semantic search and vectorization capabilities to the org-agent. It decouples the specific embedding algorithms and provider-specific API calls from the core kernel.
|
||||
The *Vector Embedding* skill provides semantic search and vectorization capabilities to the opencortex. It decouples the specific embedding algorithms and provider-specific API calls from the core kernel.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
|
||||
@@ -73,7 +73,7 @@ The Engineering Standards skill provides the deterministic enforcement of the wo
|
||||
|
||||
;; If the action involves modifying files, check git status
|
||||
(when (member act '(:modify-file :write-file :replace :rename-file :delete-file))
|
||||
(let ((proj-root (asdf:system-source-directory :org-agent)))
|
||||
(let ((proj-root (asdf:system-source-directory :opencortex)))
|
||||
(unless (verify-git-clean-p proj-root)
|
||||
(harness-log "DETERMINISTIC [Standards]: BLOCKING ACTION. Working tree is dirty. Commit changes before modification.")
|
||||
(return-from engineering-standards-gate
|
||||
@@ -84,4 +84,4 @@ The Engineering Standards skill provides the deterministic enforcement of the wo
|
||||
|
||||
* See Also
|
||||
- [[file:org-skill-system-invariants.org][System Policy]]
|
||||
- [[file:../README.org][org-agent README]]
|
||||
- [[file:../README.org][opencortex README]]
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#+DEPENDS_ON: id:state-persistence-skill
|
||||
|
||||
* Overview
|
||||
The *Event Orchestrator* is the central nervous system of the Org-Agent. It unifies three previously fragmented domains of system control:
|
||||
The *Event Orchestrator* is the central nervous system of the OpenCortex. It unifies three previously fragmented domains of system control:
|
||||
1. **Cron (Temporal Control):** Triggering tasks based on time and heartbeats.
|
||||
2. **Hooks (Lifecycle Control):** Enabling event-driven extensibility at specific code points.
|
||||
3. **Routing (Cognitive Control):** Classifying incoming stimuli into complexity tiers for optimal resource allocation.
|
||||
@@ -164,7 +164,7 @@ We register the orchestrator as a core skill and hot-patch the harness's routing
|
||||
#+begin_src lisp
|
||||
(progn
|
||||
;; Hook into kernel routing
|
||||
(setf org-agent::*model-selector-fn* #'orchestrator-classify-complexity)
|
||||
(setf opencortex::*model-selector-fn* #'orchestrator-classify-complexity)
|
||||
|
||||
(defskill :skill-event-orchestrator
|
||||
:priority 400 ; Foundational control layer
|
||||
@@ -179,22 +179,22 @@ We register the orchestrator as a core skill and hot-patch the harness's routing
|
||||
|
||||
** 1. Unit Tests (FiveAM)
|
||||
#+begin_src lisp
|
||||
(defpackage :org-agent-orchestrator-tests
|
||||
(:use :cl :fiveam :org-agent))
|
||||
(in-package :org-agent-orchestrator-tests)
|
||||
(defpackage :opencortex-orchestrator-tests
|
||||
(:use :cl :fiveam :opencortex))
|
||||
(in-package :opencortex-orchestrator-tests)
|
||||
|
||||
(def-suite orchestrator-suite :description "Tests for Event Orchestrator.")
|
||||
(in-suite orchestrator-suite)
|
||||
|
||||
(test test-hook-execution
|
||||
(let ((test-val 0))
|
||||
(org-agent:orchestrator-register-hook :test-hook (lambda () (setf test-val 1)))
|
||||
(org-agent:orchestrator-trigger-hook :test-hook)
|
||||
(opencortex:orchestrator-register-hook :test-hook (lambda () (setf test-val 1)))
|
||||
(opencortex:orchestrator-trigger-hook :test-hook)
|
||||
(is (= 1 test-val))))
|
||||
|
||||
(test test-routing-reflex
|
||||
(let ((ctx '(:payload (:sensor :heartbeat))))
|
||||
(is (eq :REFLEX (org-agent:orchestrator-classify-complexity ctx)))))
|
||||
(is (eq :REFLEX (opencortex:orchestrator-classify-complexity ctx)))))
|
||||
#+end_src
|
||||
|
||||
** 2. Chaos Scenarios
|
||||
|
||||
@@ -38,7 +38,7 @@ The Gardener runs on a low-priority heartbeat. It performs a "Deep Audit" of the
|
||||
|
||||
** Package Context
|
||||
#+begin_src lisp
|
||||
(in-package :org-agent)
|
||||
(in-package :opencortex)
|
||||
#+end_src
|
||||
|
||||
** State: Maintenance Cycle
|
||||
|
||||
@@ -16,7 +16,7 @@ The *Matrix Gateway* provides bi-directional communication via the Matrix Client
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Integrate the Org-Agent into the Matrix federation for secure, distributed chat.
|
||||
Integrate the OpenCortex into the Matrix federation for secure, distributed chat.
|
||||
|
||||
** 2. Success Criteria
|
||||
- [ ] *Inbound:* Messages from Matrix rooms are normalized and injected into the harness Bus.
|
||||
@@ -147,7 +147,7 @@ Initializes the Matrix background thread.
|
||||
(loop
|
||||
(matrix-process-sync)
|
||||
(sleep 2)))
|
||||
:name "org-agent-matrix-gateway"))
|
||||
:name "opencortex-matrix-gateway"))
|
||||
(harness-log "MATRIX: Gateway sync active.")))
|
||||
#+end_src
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#+DEPENDS_ON: id:credentials-vault-skill
|
||||
|
||||
* Overview
|
||||
The *Signal Gateway* provides bi-directional communication between the Autonomous and the Org-Agent via the `signal-cli` tool. It features a non-blocking polling sensor and a high-integrity actuator for outbound messaging.
|
||||
The *Signal Gateway* provides bi-directional communication between the Autonomous and the OpenCortex via the `signal-cli` tool. It features a non-blocking polling sensor and a high-integrity actuator for outbound messaging.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
@@ -16,7 +16,7 @@ The *Signal Gateway* provides bi-directional communication between the Autonomou
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Enable secure Signal communication for the Org-Agent.
|
||||
Enable secure Signal communication for the OpenCortex.
|
||||
|
||||
** 2. Success Criteria
|
||||
- [ ] *Inbound:* Messages received via `signal-cli receive` are injected into the harness Bus.
|
||||
@@ -117,7 +117,7 @@ Initializes the Signal background thread.
|
||||
(loop
|
||||
(signal-process-updates)
|
||||
(sleep 5)))
|
||||
:name "org-agent-signal-gateway"))
|
||||
:name "opencortex-signal-gateway"))
|
||||
(harness-log "SIGNAL: Gateway polling active.")))
|
||||
#+end_src
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#+DEPENDS_ON: id:credentials-vault-skill
|
||||
|
||||
* Overview
|
||||
The *Telegram Gateway* provides bi-directional communication between the Autonomous and the Org-Agent via the Telegram Bot API. It features a non-blocking polling sensor and a high-integrity actuator for outbound messaging.
|
||||
The *Telegram Gateway* provides bi-directional communication between the Autonomous and the OpenCortex via the Telegram Bot API. It features a non-blocking polling sensor and a high-integrity actuator for outbound messaging.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
@@ -16,7 +16,7 @@ The *Telegram Gateway* provides bi-directional communication between the Autonom
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Enable mobile/remote access to the Org-Agent via a secure Telegram bot.
|
||||
Enable mobile/remote access to the OpenCortex via a secure Telegram bot.
|
||||
|
||||
** 2. Success Criteria
|
||||
- [ ] *Inbound:* Messages from authorized Telegram IDs are injected into the harness Bus.
|
||||
@@ -133,7 +133,7 @@ Initializes the Telegram background thread.
|
||||
(loop
|
||||
(telegram-process-updates)
|
||||
(sleep 3)))
|
||||
:name "org-agent-telegram-gateway"))
|
||||
:name "opencortex-telegram-gateway"))
|
||||
(harness-log "TELEGRAM: Gateway polling active.")))
|
||||
#+end_src
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
#+DEPENDS_ON: id:47425a43-2be0-423c-8509-22592cfe9c9e
|
||||
|
||||
* Overview
|
||||
The *Harness Monitor* provides tools for inspecting the internal state and health of the Org-Agent Lisp Machine.
|
||||
The *Harness Monitor* provides tools for inspecting the internal state and health of the OpenCortex Lisp Machine.
|
||||
|
||||
* Implementation
|
||||
|
||||
#+begin_src lisp
|
||||
|
||||
(org-agent:def-cognitive-tool :harness-status \"Returns the current operational status of the Org-Agent harness, including loaded skills and telemetry.\"
|
||||
(opencortex:def-cognitive-tool :harness-status \"Returns the current operational status of the OpenCortex harness, including loaded skills and telemetry.\"
|
||||
nil
|
||||
:body (lambda (args)
|
||||
(declare (ignore args))
|
||||
@@ -23,12 +23,12 @@ The *Harness Monitor* provides tools for inspecting the internal state and healt
|
||||
- Uptime: ~a seconds
|
||||
- Memory Usage: ~a
|
||||
- Providers: ~a\"
|
||||
(hash-table-count org-agent:*skills-registry*)
|
||||
(hash-table-count opencortex:*skills-registry*)
|
||||
(get-universal-time)
|
||||
\"Not implemented\"
|
||||
org-agent:*provider-cascade*)))
|
||||
opencortex:*provider-cascade*)))
|
||||
|
||||
(org-agent:def-cognitive-tool :list-skills \"Lists all currently loaded skills and their metadata.\"
|
||||
(opencortex:def-cognitive-tool :list-skills \"Lists all currently loaded skills and their metadata.\"
|
||||
nil
|
||||
:body (lambda (args)
|
||||
(declare (ignore args))
|
||||
@@ -38,9 +38,9 @@ The *Harness Monitor* provides tools for inspecting the internal state and healt
|
||||
(setf output (concatenate 'string output
|
||||
(format nil \"- ~a (Priority: ~a, Deps: ~s)~%\"
|
||||
name
|
||||
(org-agent:skill-priority skill)
|
||||
(org-agent:skill-dependencies skill)))))
|
||||
org-agent:*skills-registry*)
|
||||
(opencortex:skill-priority skill)
|
||||
(opencortex:skill-dependencies skill)))))
|
||||
opencortex:*skills-registry*)
|
||||
output)))
|
||||
|
||||
(defskill :skill-harness-monitor
|
||||
|
||||
@@ -94,7 +94,7 @@ Ensures every headline has a unique ID property using the system standard `org-i
|
||||
(id (getf props :ID)))
|
||||
(if (and id (not (equal id "")))
|
||||
node
|
||||
(let ((new-id (org-agent:org-id-get-create)))
|
||||
(let ((new-id (opencortex:org-id-get-create)))
|
||||
(setf (getf node :properties) (append props (list :ID new-id)))
|
||||
(harness-log "MEMORY - Injected standard ID ~a" new-id)
|
||||
node))))
|
||||
@@ -159,16 +159,16 @@ Converts a structured AST back into Org-mode text.
|
||||
|
||||
** 1. Unit Tests (FiveAM)
|
||||
#+begin_src lisp
|
||||
(defpackage :org-agent-memory-tests
|
||||
(:use :cl :fiveam :org-agent))
|
||||
(in-package :org-agent-memory-tests)
|
||||
(defpackage :opencortex-memory-tests
|
||||
(:use :cl :fiveam :opencortex))
|
||||
(in-package :opencortex-memory-tests)
|
||||
|
||||
(def-suite memory-suite :description "Tests for Homoiconic Memory.")
|
||||
(in-suite memory-suite)
|
||||
|
||||
(test test-id-injection
|
||||
(let* ((node (list :type :HEADLINE :properties nil))
|
||||
(normalized (org-agent::memory-ensure-id node)))
|
||||
(normalized (opencortex::memory-ensure-id node)))
|
||||
(is (not (null (getf (getf normalized :properties) :ID))))))
|
||||
#+end_src
|
||||
|
||||
|
||||
@@ -52,28 +52,28 @@ Define a high-integrity, recursive security sandbox for Lisp execution.
|
||||
;; Strings
|
||||
format concatenate string-downcase string-upcase search
|
||||
;; Kernel specifics
|
||||
org-agent::harness-log
|
||||
org-agent::snapshot-memory
|
||||
org-agent::rollback-memory
|
||||
org-agent::lookup-object
|
||||
org-agent::list-objects-by-type
|
||||
org-agent::ingest-ast
|
||||
org-agent::find-headline-missing-id
|
||||
org-agent::context-query-store
|
||||
org-agent::context-get-active-projects
|
||||
org-agent::context-get-recent-completed-tasks
|
||||
org-agent::context-list-all-skills
|
||||
org-agent::context-get-system-logs
|
||||
org-agent::context-assemble-global-awareness
|
||||
org-agent::org-object-id
|
||||
org-agent::org-object-type
|
||||
org-agent::org-object-attributes
|
||||
org-agent::org-object-content
|
||||
org-agent::org-object-parent-id
|
||||
org-agent::org-object-children
|
||||
org-agent::org-object-version
|
||||
org-agent::org-object-last-sync
|
||||
org-agent::org-object-hash
|
||||
opencortex::harness-log
|
||||
opencortex::snapshot-memory
|
||||
opencortex::rollback-memory
|
||||
opencortex::lookup-object
|
||||
opencortex::list-objects-by-type
|
||||
opencortex::ingest-ast
|
||||
opencortex::find-headline-missing-id
|
||||
opencortex::context-query-store
|
||||
opencortex::context-get-active-projects
|
||||
opencortex::context-get-recent-completed-tasks
|
||||
opencortex::context-list-all-skills
|
||||
opencortex::context-get-system-logs
|
||||
opencortex::context-assemble-global-awareness
|
||||
opencortex::org-object-id
|
||||
opencortex::org-object-type
|
||||
opencortex::org-object-attributes
|
||||
opencortex::org-object-content
|
||||
opencortex::org-object-parent-id
|
||||
opencortex::org-object-children
|
||||
opencortex::org-object-version
|
||||
opencortex::org-object-last-sync
|
||||
opencortex::org-object-hash
|
||||
;; Essential macros
|
||||
declare ignore
|
||||
;; Let's also add simple data types
|
||||
@@ -125,7 +125,7 @@ We allow other skills to register safe symbols for the validator.
|
||||
|
||||
** Cognitive Tools
|
||||
#+begin_src lisp
|
||||
(org-agent:def-cognitive-tool :lisp-validator-status "Returns validator-related telemetry, including blocked actions and harness status."
|
||||
(opencortex:def-cognitive-tool :lisp-validator-status "Returns validator-related telemetry, including blocked actions and harness status."
|
||||
nil
|
||||
:body (lambda (args)
|
||||
(declare (ignore args))
|
||||
@@ -140,7 +140,7 @@ We allow other skills to register safe symbols for the validator.
|
||||
|
||||
** Skill Definition
|
||||
#+begin_src lisp
|
||||
(org-agent:defskill :skill-lisp-validator
|
||||
(opencortex:defskill :skill-lisp-validator
|
||||
:priority 900 ; High priority, before most skills
|
||||
:trigger (lambda (ctx)
|
||||
;; Check if any proposed action is an :eval or :shell call
|
||||
@@ -157,26 +157,26 @@ We allow other skills to register safe symbols for the validator.
|
||||
|
||||
* Phase E: Chaos (Verification)
|
||||
#+begin_src lisp
|
||||
(defpackage :org-agent-lisp-validator-tests
|
||||
(:use :cl :fiveam :org-agent)
|
||||
(defpackage :opencortex-lisp-validator-tests
|
||||
(:use :cl :fiveam :opencortex)
|
||||
(:export #:lisp-validator-suite))
|
||||
(in-package :org-agent-lisp-validator-tests)
|
||||
(in-package :opencortex-lisp-validator-tests)
|
||||
|
||||
(def-suite lisp-validator-suite :description "Tests for the Lisp Validator.")
|
||||
(in-suite lisp-validator-suite)
|
||||
|
||||
(test test-basic-math-safe
|
||||
(is (org-agent:lisp-validator-validate "(+ 1 2)")))
|
||||
(is (opencortex:lisp-validator-validate "(+ 1 2)")))
|
||||
|
||||
(test test-blocked-eval
|
||||
(is (not (org-agent:lisp-validator-validate "(eval '(+ 1 2))"))))
|
||||
(is (not (opencortex:lisp-validator-validate "(eval '(+ 1 2))"))))
|
||||
|
||||
(test test-blocked-shell
|
||||
(is (not (org-agent:lisp-validator-validate "(uiop:run-program \"ls\")"))))
|
||||
(is (not (opencortex:lisp-validator-validate "(uiop:run-program \"ls\")"))))
|
||||
|
||||
(test test-nested-unsafe
|
||||
(is (not (org-agent:lisp-validator-validate "(let ((x 1)) (delete-file \"test.txt\"))"))))
|
||||
(is (not (opencortex:lisp-validator-validate "(let ((x 1)) (delete-file \"test.txt\"))"))))
|
||||
|
||||
(test test-safe-kernel-api
|
||||
(is (org-agent:lisp-validator-validate "(org-agent::lookup-object \"node-1\")")))
|
||||
(is (opencortex:lisp-validator-validate "(opencortex::lookup-object \"node-1\")")))
|
||||
#+end_src
|
||||
|
||||
@@ -92,7 +92,7 @@ This is the primary actuator for neural reasoning. It handles the specific JSON
|
||||
|
||||
(case provider
|
||||
(:gemini-web
|
||||
(let ((res (uiop:symbol-call :org-agent.skills.org-skill-web-research :ask-gemini-web full-prompt)))
|
||||
(let ((res (uiop:symbol-call :opencortex.skills.org-skill-web-research :ask-gemini-web full-prompt)))
|
||||
(if res (list :status :success :content res) (list :status :error :message "Web Research Failure"))))
|
||||
|
||||
(:ollama
|
||||
@@ -118,7 +118,7 @@ This is the primary actuator for neural reasoning. It handles the specific JSON
|
||||
(:anthropic `(("Content-Type" . "application/json") ("x-api-key" . ,api-key) ("anthropic-version" . "2023-06-01")))
|
||||
(:gemini-api `(("Content-Type" . "application/json") ("x-goog-api-key" . ,api-key)))
|
||||
(:openrouter `(("Content-Type" . "application/json") ("Authorization" . ,(format nil "Bearer ~a" api-key))
|
||||
("HTTP-Referer" . "https://github.com/amr/org-agent") ("X-Title" . "org-agent Autonomous Kernel")))
|
||||
("HTTP-Referer" . "https://github.com/amr/opencortex") ("X-Title" . "opencortex Autonomous Kernel")))
|
||||
(t `(("Content-Type" . "application/json") ("Authorization" . ,(format nil "Bearer ~a" api-key))))))
|
||||
(body (case provider
|
||||
(:anthropic (cl-json:encode-json-to-string `((model . ,(or model "claude-3-5-sonnet-20240620")) (max_tokens . 4096) (system . ,system-prompt) (messages . (( (role . "user") (content . ,prompt) ))))))
|
||||
@@ -160,7 +160,7 @@ Register each supported provider with the harness's neural registry.
|
||||
|
||||
#+begin_src lisp
|
||||
(dolist (p '(:anthropic :gemini-api :gemini-web :groq :ollama :openai :openrouter))
|
||||
(org-agent:register-probabilistic-backend p (lambda (prompt system-prompt &key model)
|
||||
(opencortex:register-probabilistic-backend p (lambda (prompt system-prompt &key model)
|
||||
(execute-llm-request prompt system-prompt :provider p :model model))))
|
||||
#+end_src
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ The *Onboarding Skill* ensures that the Lisp Machine environment is correctly ca
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated behaviors for verifying and configuring the org-agent environment.
|
||||
Define automated behaviors for verifying and configuring the opencortex environment.
|
||||
|
||||
** 2. User Needs
|
||||
- *Environment Verification:* Confirm SBCL, Quicklisp, and core binaries are present.
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
The *Policy Enforcer* is the deterministic gate that ensures all probabilistic proposals adhere to the Core Invariants defined in the [[id:47425a43-2be0-423c-8509-22592cfe9c9e][System Policy]].
|
||||
|
||||
** Architectural Intent: The Implicit Bridge
|
||||
Unlike traditional software where a "Kernel" might have hardcoded rules, the Org-Agent harness is a "dumb" pipeline. This skill creates the bridge between human-readable rules and machine-enforced constraints through three mechanisms:
|
||||
Unlike traditional software where a "Kernel" might have hardcoded rules, the OpenCortex harness is a "dumb" pipeline. This skill creates the bridge between human-readable rules and machine-enforced constraints through three mechanisms:
|
||||
|
||||
1. **Topological Bootstrapping:** By declaring a #+DEPENDS_ON: dependency on the Policy file's ID, we ensure the System Policy is always registered in the Lisp image's skill catalog before this enforcer attempts to guard it.
|
||||
2. **Priority Preemption:** By setting :priority 1000, this skill registers itself as the very first check in the decide-gate. It effectively "pre-empts" all other skills, ensuring that no action (like a shell command or a file write) is even considered until it has cleared the alignment check.
|
||||
@@ -25,13 +25,13 @@ Unlike traditional software where a "Kernel" might have hardcoded rules, the Org
|
||||
:priority 1000 ; Absolute highest priority
|
||||
:trigger (lambda (context) t) ; Always active as a fallback
|
||||
:probabilistic (lambda (context)
|
||||
\"You are the Org-Agent Policy Enforcer. Your goal is to ensure all actions empower the user through the Lisp Machine and adhere to the System Policy.\")
|
||||
\"You are the OpenCortex Policy Enforcer. Your goal is to ensure all actions empower the user through the Lisp Machine and adhere to the System Policy.\")
|
||||
:deterministic (lambda (action context)
|
||||
;; Basic invariant check: Block actions that appear to violate autonomy
|
||||
(let ((payload (getf action :payload)))
|
||||
(if (and payload (search \"proprietary\" (format nil \"~s\" payload)))
|
||||
(progn
|
||||
(org-agent:harness-log \"DETERMINISTIC [Policy]: Autonomy violation suspected. Blocking action.\")
|
||||
(opencortex:harness-log \"DETERMINISTIC [Policy]: Autonomy violation suspected. Blocking action.\")
|
||||
nil)
|
||||
action))))
|
||||
#+end_src
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
#+FILETAGS: :platform:policy:alignment:autonomy:
|
||||
|
||||
* Overview
|
||||
The *org-agent* is a probabilistic-deterministic harness for a personal operating system. It uses Org-mode as its native memory and Common Lisp as its deterministic reasoning engine.
|
||||
The *opencortex* is a probabilistic-deterministic harness for a personal operating system. It uses Org-mode as its native memory and Common Lisp as its deterministic reasoning engine.
|
||||
|
||||
* Package Context
|
||||
Every skill executes within its own jailed package namespace, while inheriting core harness symbols.
|
||||
|
||||
#+begin_src lisp :tangle ../src/policy.lisp
|
||||
(in-package :org-agent)
|
||||
(in-package :opencortex)
|
||||
#+end_src
|
||||
|
||||
* The Core Invariants
|
||||
@@ -52,7 +52,7 @@ The main deterministic entry point for the policy skill. It orchestrates the var
|
||||
"The main policy gate. Sub-calls engineering standards if available."
|
||||
(let ((current-action (policy-check-autonomy action context)))
|
||||
(when current-action
|
||||
(let ((eng-pkg (find-package :org-agent.skills.org-skill-engineering-standards)))
|
||||
(let ((eng-pkg (find-package :opencortex.skills.org-skill-engineering-standards)))
|
||||
(when eng-pkg
|
||||
(let ((eng-gate (find-symbol "ENGINEERING-STANDARDS-GATE" eng-pkg)))
|
||||
(when (and eng-gate (fboundp eng-gate))
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#+FILETAGS: :protocol:communication-protocol:security:validation:autonomy:
|
||||
|
||||
* Overview
|
||||
The *Communication Protocol Schema Validator* skill provides deep structural validation for all messages entering the org-agent kernel. It ensures that every property list adheres to a strict schema, preventing malformed data from causing harness-level errors.
|
||||
The *Communication Protocol Schema Validator* skill provides deep structural validation for all messages entering the opencortex kernel. It ensures that every property list adheres to a strict schema, preventing malformed data from causing harness-level errors.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
@@ -15,7 +15,7 @@ The *Communication Protocol Schema Validator* skill provides deep structural val
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Enforce a formal grammar for the Org-Agent Control Protocol (communication protocol).
|
||||
Enforce a formal grammar for the OpenCortex Control Protocol (communication protocol).
|
||||
|
||||
** 2. User Needs
|
||||
- *Type Safety:* Ensure mandatory keys (e.g., `:type`, `:payload`) are present.
|
||||
@@ -46,7 +46,7 @@ Decouple protocol parsing (framing/unframing) from semantic validation.
|
||||
|
||||
** Schema Enforcement
|
||||
#+begin_src lisp :tangle ../src/communication-validator.lisp
|
||||
(in-package :org-agent)
|
||||
(in-package :opencortex)
|
||||
|
||||
(defun validate-communication-protocol-schema (msg)
|
||||
"Strict structural validation for incoming communication protocol messages."
|
||||
|
||||
@@ -42,7 +42,7 @@ The Scribe reacts to the `:heartbeat` sensor. It maintains a state file (`scribe
|
||||
|
||||
** Package Context
|
||||
#+begin_src lisp
|
||||
(in-package :org-agent)
|
||||
(in-package :opencortex)
|
||||
#+end_src
|
||||
|
||||
** State: Checkpoint Management
|
||||
@@ -54,14 +54,14 @@ We track the last processed universal time to avoid redundant distillation.
|
||||
|
||||
(defun scribe-load-state ()
|
||||
"Loads the scribe checkpoint from the state directory."
|
||||
(let ((state-file (uiop:merge-pathnames* "state/scribe-checkpoint.lisp" (asdf:system-source-directory :org-agent))))
|
||||
(let ((state-file (uiop:merge-pathnames* "state/scribe-checkpoint.lisp" (asdf:system-source-directory :opencortex))))
|
||||
(if (uiop:file-exists-p state-file)
|
||||
(setf *scribe-last-checkpoint* (read-from-string (uiop:read-file-string state-file)))
|
||||
(setf *scribe-last-checkpoint* 0))))
|
||||
|
||||
(defun scribe-save-state ()
|
||||
"Saves the current universal-time as the new checkpoint."
|
||||
(let ((state-file (uiop:merge-pathnames* "state/scribe-checkpoint.lisp" (asdf:system-source-directory :org-agent))))
|
||||
(let ((state-file (uiop:merge-pathnames* "state/scribe-checkpoint.lisp" (asdf:system-source-directory :opencortex))))
|
||||
(ensure-directories-exist state-file)
|
||||
(with-open-file (out state-file :direction :output :if-exists :supersede)
|
||||
(format out "~a" (get-universal-time)))))
|
||||
@@ -125,7 +125,7 @@ The deterministic gate receives the list of proposed notes and writes them to th
|
||||
#+begin_src lisp
|
||||
(defun scribe-commit-notes (proposals)
|
||||
"Writes proposed atomic notes to the notes/ directory. Appends if the note exists."
|
||||
(let ((notes-dir (uiop:merge-pathnames* "notes/" (asdf:system-source-directory :org-agent))))
|
||||
(let ((notes-dir (uiop:merge-pathnames* "notes/" (asdf:system-source-directory :opencortex))))
|
||||
(ensure-directories-exist notes-dir)
|
||||
(dolist (note proposals)
|
||||
(let* ((title (getf note :title))
|
||||
|
||||
@@ -27,8 +27,8 @@ The *Self-Fix Agent* is the system's "Repair Mechanism." It takes failure hypoth
|
||||
(is-skill (and (stringp (namestring target-file))
|
||||
(search "skills/" (namestring target-file)))))
|
||||
|
||||
(org-agent:snapshot-memory)
|
||||
(org-agent:harness-log "SELF-FIX - Attempting surgical fix on ~a..." target-file)
|
||||
(opencortex:snapshot-memory)
|
||||
(opencortex:harness-log "SELF-FIX - Attempting surgical fix on ~a..." target-file)
|
||||
|
||||
(handler-case
|
||||
(if (uiop:file-exists-p target-file)
|
||||
@@ -40,25 +40,25 @@ The *Self-Fix Agent* is the system's "Repair Mechanism." It takes failure hypoth
|
||||
|
||||
(if is-skill
|
||||
(progn
|
||||
(org-agent:harness-log "SELF-FIX - Reloading modified skill ~a..." target-file)
|
||||
(if (org-agent:load-skill-from-org target-file)
|
||||
(opencortex:harness-log "SELF-FIX - Reloading modified skill ~a..." target-file)
|
||||
(if (opencortex:load-skill-from-org target-file)
|
||||
(progn
|
||||
(org-agent:harness-log "SELF-FIX SUCCESS - Applied and reloaded.")
|
||||
(opencortex:harness-log "SELF-FIX SUCCESS - Applied and reloaded.")
|
||||
t)
|
||||
(progn
|
||||
(org-agent:harness-log "SELF-FIX FAILURE - Skill reload failed. Rolling back.")
|
||||
(opencortex:harness-log "SELF-FIX FAILURE - Skill reload failed. Rolling back.")
|
||||
(with-open-file (out target-file :direction :output :if-exists :supersede)
|
||||
(write-string content out))
|
||||
(org-agent:rollback-memory 0)
|
||||
(opencortex:rollback-memory 0)
|
||||
nil)))
|
||||
(progn
|
||||
(org-agent:harness-log "SELF-FIX SUCCESS - Applied fix to file.")
|
||||
(opencortex:harness-log "SELF-FIX SUCCESS - Applied fix to file.")
|
||||
t)))
|
||||
(progn (org-agent:harness-log "SELF-FIX FAILURE - Pattern not found.") nil)))
|
||||
(progn (org-agent:harness-log "SELF-FIX FAILURE - File not found.") nil))
|
||||
(progn (opencortex:harness-log "SELF-FIX FAILURE - Pattern not found.") nil)))
|
||||
(progn (opencortex:harness-log "SELF-FIX FAILURE - File not found.") nil))
|
||||
(error (c)
|
||||
(org-agent:harness-log "SELF-FIX CRASH - ~a. Rolling back." c)
|
||||
(org-agent:rollback-memory 0)
|
||||
(opencortex:harness-log "SELF-FIX CRASH - ~a. Rolling back." c)
|
||||
(opencortex:rollback-memory 0)
|
||||
nil))))
|
||||
#+end_src
|
||||
|
||||
@@ -77,11 +77,11 @@ The *Self-Fix Agent* is the system's "Repair Mechanism." It takes failure hypoth
|
||||
|
||||
** Skill Definition
|
||||
#+begin_src lisp
|
||||
(org-agent:defskill :skill-self-fix
|
||||
(opencortex:defskill :skill-self-fix
|
||||
:priority 95
|
||||
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :repair-request))
|
||||
:probabilistic (lambda (context)
|
||||
(format nil "You are the org-agent Repair Actuator. Synthesize a surgical fix for the reported failure.
|
||||
(format nil "You are the opencortex Repair Actuator. Synthesize a surgical fix for the reported failure.
|
||||
Return a Lisp plist for :repair-file."))
|
||||
:deterministic (lambda (action context)
|
||||
(let ((payload (getf action :payload)))
|
||||
|
||||
@@ -110,13 +110,13 @@ The primary secure actuator for host system calls.
|
||||
(cond
|
||||
;; 1. Metacharacter check (Injection prevention)
|
||||
((not (shell-command-safe-p cmd-string))
|
||||
(org-agent:inject-stimulus
|
||||
(opencortex:inject-stimulus
|
||||
`(:type :EVENT :payload (:sensor :shell-response :cmd ,cmd-string :stdout "" :stderr "ERROR - Security Violation: Dangerous metacharacters detected." :exit-code 1))
|
||||
:stream (getf context :reply-stream)))
|
||||
|
||||
;; 2. Whitelist check
|
||||
((not (member executable *allowed-commands* :test #'string=))
|
||||
(org-agent:inject-stimulus
|
||||
(opencortex:inject-stimulus
|
||||
`(:type :EVENT :payload (:sensor :shell-response :cmd ,cmd-string :stdout "" :stderr "ERROR - Command not in security whitelist." :exit-code 1))
|
||||
:stream (getf context :reply-stream)))
|
||||
|
||||
@@ -124,7 +124,7 @@ The primary secure actuator for host system calls.
|
||||
(t
|
||||
(multiple-value-bind (stdout stderr exit-code)
|
||||
(uiop:run-program cmd-string :output :string :error-output :string :ignore-error-status t)
|
||||
(org-agent:inject-stimulus
|
||||
(opencortex:inject-stimulus
|
||||
`(:type :EVENT :payload (:sensor :shell-response :cmd ,cmd-string :stdout ,(or stdout "") :stderr ,(or stderr "") :exit-code ,exit-code))
|
||||
:stream (getf context :reply-stream)))))))
|
||||
#+end_src
|
||||
@@ -139,7 +139,7 @@ Executes a synthesized script (Python/Lisp/JS) in a controlled directory.
|
||||
(let* ((payload (getf action :payload))
|
||||
(language (getf payload :language))
|
||||
(content (getf payload :content))
|
||||
(sandbox-dir "/tmp/org-agent-sandbox/")
|
||||
(sandbox-dir "/tmp/opencortex-sandbox/")
|
||||
(filename (format nil "synth-~a.~a" (get-universal-time) (case language (:python "py") (:lisp "lisp") (:js "js") (t "txt"))))
|
||||
(full-path (format nil "~a~a" sandbox-dir filename)))
|
||||
|
||||
@@ -153,7 +153,7 @@ Executes a synthesized script (Python/Lisp/JS) in a controlled directory.
|
||||
(:js (format nil "node ~a" full-path)))))
|
||||
(multiple-value-bind (stdout stderr exit-code)
|
||||
(uiop:run-program cmd :output :string :error-output :string :ignore-error-status t)
|
||||
(org-agent:inject-stimulus
|
||||
(opencortex:inject-stimulus
|
||||
`(:type :EVENT :payload (:sensor :shell-response :cmd ,cmd :stdout ,(or stdout "") :stderr ,(or stderr "") :exit-code ,exit-code :synthesis-p t))
|
||||
:stream (getf context :reply-stream))))))
|
||||
#+end_src
|
||||
@@ -213,7 +213,7 @@ Hardware-Level Isolation for future security evolution.
|
||||
~a
|
||||
#+end_example"
|
||||
cmd exit-code stdout stderr)))
|
||||
`(:type :request :target :emacs :payload (:action :insert-at-end :buffer "*org-agent-chat*" :text ,result-text))))))
|
||||
`(:type :request :target :emacs :payload (:action :insert-at-end :buffer "*opencortex-chat*" :text ,result-text))))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
@@ -222,7 +222,7 @@ Hardware-Level Isolation for future security evolution.
|
||||
Register the shell channel as a physical actuator.
|
||||
|
||||
#+begin_src lisp
|
||||
(org-agent:register-actuator :shell #'execute-shell-safely)
|
||||
(opencortex:register-actuator :shell #'execute-shell-safely)
|
||||
#+end_src
|
||||
|
||||
** Registration: Skill
|
||||
|
||||
@@ -239,9 +239,9 @@ Expose persistence capabilities to the neural Probabilistic Engine.
|
||||
|
||||
** 1. Unit Tests (FiveAM)
|
||||
#+begin_src lisp
|
||||
(defpackage :org-agent-persistence-tests
|
||||
(:use :cl :fiveam :org-agent))
|
||||
(in-package :org-agent-persistence-tests)
|
||||
(defpackage :opencortex-persistence-tests
|
||||
(:use :cl :fiveam :opencortex))
|
||||
(in-package :opencortex-persistence-tests)
|
||||
|
||||
(def-suite persistence-suite :description "Tests for State Persistence Layer.")
|
||||
(in-suite persistence-suite)
|
||||
@@ -253,10 +253,10 @@ Expose persistence capabilities to the neural Probabilistic Engine.
|
||||
(let ((obj (make-org-object :id test-id :content "Integrity Check" :hash test-hash)))
|
||||
(setf (gethash test-hash *history-store*) obj)
|
||||
(setf (gethash test-id *memory*) obj))
|
||||
(org-agent:persistence-dump-local)
|
||||
(opencortex:persistence-dump-local)
|
||||
(clrhash *memory*)
|
||||
(clrhash *history-store*)
|
||||
(org-agent:persistence-load-local)
|
||||
(opencortex:persistence-load-local)
|
||||
(is (not (null (gethash test-id *memory*))))
|
||||
(is (equal "Integrity Check" (org-object-content (gethash test-id *memory*))))))
|
||||
#+end_src
|
||||
|
||||
Reference in New Issue
Block a user