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

@@ -14,7 +14,7 @@ The ~org-agent~ harness implements a deterministic, tree-aware solution: the **F
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.
*** 2. The Peripheral Vision (Low Resolution)
To maintain global awareness without bloating the context window, the rest of the Memex is rendered at "Low Resolution." The harness recursively walks the Object Store and generates a skeletal outline consisting only of titles and IDs. This gives the LLM a "mental map" of the entire system, allowing it to reference other projects or skills without needing to see their full content until they are explicitly brought into focus.
To maintain global awareness without bloating the context window, the rest of the Memex is rendered at "Low Resolution." The harness recursively walks the Memory and generates a skeletal outline consisting only of titles and IDs. This gives the LLM a "mental map" of the entire system, allowing it to reference other projects or skills without needing to see their full content until they are explicitly brought into focus.
*** 3. Deterministic Tree-Walking
By leveraging Common Lisp's strengths in recursive tree manipulation, the harness can surgically prune the AST before it ever reaches the LLM. This ensures that the structural hierarchy of the Memex is preserved perfectly, even when the content is compressed.
@@ -22,7 +22,7 @@ By leveraging Common Lisp's strengths in recursive tree manipulation, the harnes
** The Context Pipeline
#+begin_src mermaid
flowchart TD
Store[(Object Store)] --> Filter[Context Query Filter]
Store[(Memory)] --> Filter[Context Query Filter]
Filter --> Identification{Identify Foveal ID}
Identification --> Foveal[Render Focus: Full Content]
Identification --> Peripheral[Render Outline: Titles Only]
@@ -32,7 +32,7 @@ flowchart TD
#+end_src
* Context Assembly (context.lisp)
The ~context.lisp~ module provides the deterministic functional layer for querying the Object Store and transforming its internal pointers into the precise context strings required for neural reasoning.
The ~context.lisp~ module provides the deterministic functional layer for querying the Memory and transforming its internal pointers into the precise context strings required for neural reasoning.
** Package Context
We begin by ensuring we are executing within the correct isolated package namespace.
@@ -42,11 +42,11 @@ We begin by ensuring we are executing within the correct isolated package namesp
#+end_src
** Querying the Store (context-query-store)
A generalized filter for the Object Store. This function allows skills to perform high-level semantic sweeps of the Memex based on tags, TODO states, or Org element types. It returns a list of ~org-object~ structures.
A generalized filter for the Memory. This function allows skills to perform high-level semantic sweeps of the Memex based on tags, TODO states, or Org element types. It returns a list of ~org-object~ structures.
#+begin_src lisp :tangle ../src/context.lisp
(defun context-query-store (&key tag todo-state type)
"Filters the Object Store based on tags, todo states, or types."
"Filters the Memory based on tags, todo states, or types."
(let ((results nil))
(maphash (lambda (id obj)
(declare (ignore id))
@@ -55,7 +55,7 @@ A generalized filter for the Object Store. This function allows skills to perfor
(when tag (unless (search tag (format nil "~a" (getf attrs :TAGS)) :test #'string-equal) (setf match nil)))
(when (and todo-state (not (equal state todo-state))) (setf match nil))
(when match (push obj results))))
*object-store*)
*memory*)
results))
#+end_src
@@ -198,7 +198,7 @@ The primary entry point for context generation. This function identifies active
#+begin_src lisp :tangle ../src/context.lisp
(defun context-assemble-global-awareness (&optional signal)
"Produces a high-level skeletal outline of the current Object Store for the LLM."
"Produces a high-level skeletal outline of the current Memory for the LLM."
(let* ((payload (when signal (getf signal :payload)))
(foveal-id (when payload (getf payload :target-id)))
(projects (context-get-active-projects))
@@ -227,7 +227,7 @@ Following the Engineering Standards, the peripheral vision extraction and render
(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)
@@ -243,7 +243,7 @@ Following the Engineering Standards, the peripheral vision extraction and render
(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)))