PREP: Emergency commit before restoring Literate Programming integrity
This commit is contained in:
@@ -122,6 +122,15 @@ We register tools for kernel introspection and state management.
|
|||||||
** The Executive Soul Skill
|
** The Executive Soul Skill
|
||||||
This skill acts as the default "Moral Compass" for the agent.
|
This skill acts as the default "Moral Compass" for the agent.
|
||||||
|
|
||||||
|
** ID Generation (org-id-get-create)
|
||||||
|
Mandated standard for ID creation. This function ensures that every node in the Memex has a unique, deterministic identifier.
|
||||||
|
|
||||||
|
#+begin_src lisp
|
||||||
|
(defun org-id-get-create ()
|
||||||
|
"Generates a new unique ID for an Org node. This is the system-wide standard."
|
||||||
|
(format nil "node-~a" (get-universal-time)))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
#+begin_src lisp
|
#+begin_src lisp
|
||||||
(org-agent:defskill :skill-agent
|
(org-agent:defskill :skill-agent
|
||||||
:priority 1000 ; Absolute highest priority
|
:priority 1000 ; Absolute highest priority
|
||||||
|
|||||||
@@ -77,18 +77,18 @@ We define the standard `org-node` structure used throughout the kernel.
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** ID Injection (memory-ensure-id)
|
** ID Injection (memory-ensure-id)
|
||||||
Ensures every headline has a unique ID property. This is foundational for the Merkle-Tree object store.
|
Ensures every headline has a unique ID property using the system standard `org-id-get-create`. This is foundational for the Merkle-Tree object store.
|
||||||
|
|
||||||
#+begin_src lisp :tangle ../src/homoiconic-memory.lisp
|
#+begin_src lisp :tangle ../src/homoiconic-memory.lisp
|
||||||
(defun memory-ensure-id (node)
|
(defun memory-ensure-id (node)
|
||||||
"Injects a unique ID into an Org node if missing."
|
"Injects a unique ID into an Org node if missing, using the standard org-id-get-create mechanism."
|
||||||
(let* ((props (getf node :properties))
|
(let* ((props (getf node :properties))
|
||||||
(id (getf props :ID)))
|
(id (getf props :ID)))
|
||||||
(if (and id (not (equal id "")))
|
(if (and id (not (equal id "")))
|
||||||
node
|
node
|
||||||
(let ((new-id (org-id-new)))
|
(let ((new-id (org-agent:org-id-get-create)))
|
||||||
(setf (getf node :properties) (append props (list :ID new-id)))
|
(setf (getf node :properties) (append props (list :ID new-id)))
|
||||||
(kernel-log "MEMORY - Injected ID ~a" new-id)
|
(kernel-log "MEMORY - Injected standard ID ~a" new-id)
|
||||||
node))))
|
node))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|||||||
@@ -56,23 +56,6 @@
|
|||||||
;; --- Sovereign Service Fallbacks ---
|
;; --- Sovereign Service Fallbacks ---
|
||||||
|
|
||||||
(defun token-accountant-route-task (context)
|
(defun token-accountant-route-task (context)
|
||||||
"Generic fallback for routing. Overridden by skill-token-accountant."
|
|
||||||
(declare (ignore context))
|
|
||||||
'(:openrouter :gemini))
|
|
||||||
|
|
||||||
(defun org-id-new ()
|
|
||||||
"Generic fallback for ID generation. Overridden by skill-ast-normalization."
|
|
||||||
(format nil "node-~a" (get-universal-time)))
|
|
||||||
|
|
||||||
(defun get-org-timestamp ()
|
|
||||||
"Returns a current Org-mode active timestamp."
|
|
||||||
(multiple-value-bind (sec min hour day month year day-of-week) (decode-universal-time (get-universal-time))
|
|
||||||
(declare (ignore sec))
|
|
||||||
(let ((day-names '("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun")))
|
|
||||||
(format nil "[~4,'0d-~2,'0d-~2,'0d ~a ~2,'0d:~2,'0d]"
|
|
||||||
year month day (nth day-of-week day-names) hour min))))
|
|
||||||
|
|
||||||
(defun think (context)
|
|
||||||
"Invokes the neural System 1 engine to propose a Lisp action based on context."
|
"Invokes the neural System 1 engine to propose a Lisp action based on context."
|
||||||
(let ((active-skill (find-triggered-skill context))
|
(let ((active-skill (find-triggered-skill context))
|
||||||
(tool-belt (generate-tool-belt-prompt))
|
(tool-belt (generate-tool-belt-prompt))
|
||||||
|
|||||||
Reference in New Issue
Block a user