ALIGN: Rename Object Store to Memory and enrich literate text

This commit is contained in:
2026-04-13 14:29:15 -04:00
parent 5f86bcd8dc
commit dcd3a31112
47 changed files with 215 additions and 213 deletions

View File

@@ -33,11 +33,11 @@
(test test-bouncer-approval-reaction
"Verify that the bouncer skill re-injects an action when a plan node is APPROVED."
(clrhash org-agent::*object-store*)
(clrhash org-agent::*memory*)
(let* ((action '(:type :REQUEST :target :telegram :payload (:text "hello")))
(node-id "plan-1"))
;; 1. Setup an APPROVED flight plan node
(setf (gethash node-id org-agent::*object-store*)
(setf (gethash node-id org-agent::*memory*)
(org-agent::make-org-object
:id node-id
:attributes `(:TITLE "Flight Plan" :TODO "APPROVED" :TAGS ("FLIGHT_PLAN") :ACTION ,(format nil "~s" action))))
@@ -46,7 +46,7 @@
(let ((result (org-agent::bouncer-process-approvals)))
(is (eq t result))
;; The node should now be DONE
(let ((obj (gethash node-id org-agent::*object-store*)))
(let ((obj (gethash node-id org-agent::*memory*)))
(is (equal "DONE" (getf (org-agent:org-object-attributes obj) :TODO)))))))
(test test-bouncer-secret-exposure

View File

@@ -42,8 +42,8 @@
"Verify that hash is stable even if properties are sent in different order."
(let* ((ast1 '(:type :HEADLINE :properties (:ID "collision" :A "1" :B "2") :contents nil))
(ast2 '(:type :HEADLINE :properties (:ID "collision" :B "2" :A "1") :contents nil)))
(clrhash org-agent::*object-store*)
(clrhash org-agent::*memory*)
(let ((h1 (org-object-hash (lookup-object (ingest-ast ast1)))))
(clrhash org-agent::*object-store*)
(clrhash org-agent::*memory*)
(let ((h2 (org-object-hash (lookup-object (ingest-ast ast2)))))
(is (equal h1 h2))))))

View File

@@ -16,7 +16,7 @@
(test test-async-repair-flow
"Verify that the pipeline correctly emits and reacts to syntax-error events."
(clrhash org-agent::*object-store*)
(clrhash org-agent::*memory*)
(let* ((broken-code "(:type :REQUEST :target :tool")
(error-msg "End of file")
;; 1. The Stimulus that caused the error

View File

@@ -1,21 +1,21 @@
(defpackage :org-agent-object-store-tests
(defpackage :org-agent-memory-tests
(:use :cl :fiveam :org-agent)
(:export #:object-store-suite))
(:export #:memory-suite))
(in-package :org-agent-object-store-tests)
(in-package :org-agent-memory-tests)
(def-suite object-store-suite
:description "Tests for the Merkle-Tree Object Store.")
(def-suite memory-suite
:description "Tests for the Merkle-Tree Memory.")
(in-suite object-store-suite)
(in-suite memory-suite)
(test merkle-hash-consistency
(let* ((ast1 '(:type :HEADLINE :properties (:ID "test-1" :TITLE "Node 1") :contents nil))
(ast2 '(:type :HEADLINE :properties (:ID "test-1" :TITLE "Node 1") :contents nil)))
(clrhash *object-store*)
(clrhash *memory*)
(let ((id1 (ingest-ast ast1)))
(let ((hash1 (org-object-hash (lookup-object id1))))
(clrhash *object-store*)
(clrhash *memory*)
(let ((id2 (ingest-ast ast2)))
(let ((hash2 (org-object-hash (lookup-object id2))))
(is (equal hash1 hash2))))))))
@@ -24,19 +24,19 @@
(let* ((ast-leaf '(:type :HEADLINE :properties (:ID "leaf" :TITLE "Leaf") :contents nil))
(ast-root-full '(:type :HEADLINE :properties (:ID "root" :TITLE "Root")
:contents ((:type :HEADLINE :properties (:ID "leaf" :TITLE "Leaf") :contents nil))))
(id-root (progn (clrhash *object-store*) (ingest-ast ast-root-full)))
(id-root (progn (clrhash *memory*) (ingest-ast ast-root-full)))
(initial-root-hash (org-object-hash (lookup-object id-root))))
;; Now ingest a modified version (title change)
(let* ((ast-root-modified '(:type :HEADLINE :properties (:ID "root" :TITLE "Root")
:contents ((:type :HEADLINE :properties (:ID "leaf" :TITLE "Leaf Modified") :contents nil))))
(id-root-mod (progn (clrhash *object-store*) (ingest-ast ast-root-modified)))
(id-root-mod (progn (clrhash *memory*) (ingest-ast ast-root-modified)))
(modified-root-hash (org-object-hash (lookup-object id-root-mod))))
(is (not (equal initial-root-hash modified-root-hash))))))
(test history-store-immutability
"Verify that *history-store* retains old versions even after *object-store* updates."
(clrhash *object-store*)
"Verify that *history-store* retains old versions even after *memory* updates."
(clrhash *memory*)
(clrhash *history-store*)
(let* ((ast-v1 '(:type :HEADLINE :properties (:ID "test-node" :TITLE "Version 1") :contents nil))
(id-v1 (ingest-ast ast-v1))
@@ -63,7 +63,7 @@
(test cow-snapshot-and-rollback
"Verify that lightweight snapshots can accurately restore previous pointer states."
(clrhash *object-store*)
(clrhash *memory*)
(clrhash *history-store*)
(setf *object-store-snapshots* nil)
@@ -72,7 +72,7 @@
(hash-v1 (org-object-hash (lookup-object id-v1))))
;; Take a snapshot at State A
(snapshot-object-store)
(snapshot-memory)
(let* ((ast-v2 '(:type :HEADLINE :properties (:ID "cow-node" :TITLE "State B") :contents nil))
(id-v2 (ingest-ast ast-v2))
@@ -82,7 +82,7 @@
(is (equal (org-object-hash (lookup-object "cow-node")) hash-v2))
;; Rollback to State A (index 0 because we only took 1 snapshot)
(rollback-object-store 0)
(rollback-memory 0)
;; Verify we are back in State A
(is (equal (org-object-hash (lookup-object "cow-node")) hash-v1))

View File

@@ -9,7 +9,7 @@
(test test-foveal-rendering
"Verify that the foveal target is rendered with content, while siblings are skeletal."
(clrhash org-agent::*object-store*)
(clrhash org-agent::*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)
@@ -25,7 +25,7 @@
(test test-awareness-budget
"Verify that context-assemble-global-awareness handles multiple projects."
(clrhash org-agent::*object-store*)
(clrhash org-agent::*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

@@ -8,8 +8,8 @@
(test test-local-roundtrip
"Ensure RAM -> Disk -> RAM preserves data integrity."
(let ((test-id "persist-test-1"))
(setf (gethash test-id *object-store*) (make-org-object :id test-id :content "Integrity Check"))
(setf (gethash test-id *memory*) (make-org-object :id test-id :content "Integrity Check"))
(org-agent:persistence-dump-local)
(clrhash *object-store*)
(clrhash *memory*)
(org-agent:persistence-load-local)
(is (equal "Integrity Check" (org-object-content (gethash test-id *object-store*))))))
(is (equal "Integrity Check" (org-object-content (gethash test-id *memory*))))))

View File

@@ -26,11 +26,11 @@
(test test-perceive-gate
"Perceive gate should update the object store and normalize signal."
(clrhash org-agent::*object-store*)
(clrhash org-agent::*memory*)
(let* ((signal (list :type :EVENT :payload (list :sensor :buffer-update :ast (list :type :HEADLINE :properties (list :ID "test-node" :TITLE "Test") :contents nil))))
(result (perceive-gate signal)))
(is (eq :perceived (getf result :status)))
(is (not (null (gethash "test-node" org-agent::*object-store*))))))
(is (not (null (gethash "test-node" org-agent::*memory*))))))
(test test-decide-gate-safety
"Decide gate should block unsafe LLM proposals."
@@ -46,7 +46,7 @@
(test test-pipeline-flow-flat
"Verify that process-signal correctly executes a signal through gates."
(setup-mock-skills)
(clrhash org-agent::*object-store*)
(clrhash org-agent::*memory*)
(let ((signal (list :type :EVENT :payload (list :sensor :buffer-update))))
(process-signal signal)
(pass "Pipeline completed execution.")))
@@ -90,15 +90,15 @@
(test test-global-awareness-assembly
"Verify that context-assemble-global-awareness reports active projects."
(clrhash org-agent::*object-store*)
(clrhash org-agent::*memory*)
(ingest-ast (list :type :HEADLINE :properties (list :ID "proj-1" :TITLE "Project Alpha" :TAGS "project") :contents nil))
(let ((awareness (context-assemble-global-awareness)))
(is (search "Project Alpha" awareness))
(is (search "proj-1" awareness))))
(test test-micro-rollback
"Verify that a pipeline crash triggers an automatic Object Store rollback."
(clrhash org-agent::*object-store*)
"Verify that a pipeline crash triggers an automatic Memory rollback."
(clrhash org-agent::*memory*)
(clrhash org-agent::*history-store*)
(setf org-agent::*object-store-snapshots* nil)
;; State A

View File

@@ -20,10 +20,10 @@
(test test-task-integrity-parent-child
"Verify that task-integrity-check rejects closing a parent with active children."
;; Mocking some objects in the store
(clrhash org-agent::*object-store*)
(setf (gethash "parent-1" org-agent::*object-store*)
(clrhash org-agent::*memory*)
(setf (gethash "parent-1" org-agent::*memory*)
(org-agent::make-org-object :id "parent-1" :attributes '(:TITLE "Parent Task" :TODO "TODO")))
(setf (gethash "child-1" org-agent::*object-store*)
(setf (gethash "child-1" org-agent::*memory*)
(org-agent::make-org-object :id "child-1" :attributes '(:TITLE "Child Task" :TODO "TODO" :PARENT "parent-1")))
(let* ((action '(:type :REQUEST :target :emacs :action :update-node :id "parent-1" :attributes (:TODO "DONE")))

View File

@@ -11,6 +11,6 @@
(test test-vault-persistence
"Verify that setting a secret triggers a snapshot (mock check)."
(let ((old-version (org-agent::org-object-version (gethash "root" *object-store*))))
(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" *object-store*)) old-version))))
(is (> (org-agent::org-object-version (gethash "root" *memory*)) old-version))))