Files
passepartout/skills/org-skill-homoiconic-memory.org
Amr Gharbeia 80e327dd20 fix(v0.2.0): resolve macro conflicts, sync load order, and fix skill packaging
- Standardized def-cognitive-tool to 5-argument signature.
- Consolidated *cognitive-tools* as a hash table in package.lisp.
- Removed skills from opencortex.asd to enforce dynamic Skill Engine loading.
- Added missing (in-package :opencortex) to various skill files.
- Fixed let/let* sequential binding issues in emacs-edit and self-edit.
- Updated opencortex.sh to initialize skills before running doctor.
- Fixed uiop:user-homedir-pathname usage in config-manager.
2026-04-28 10:46:24 -04:00

47 lines
1.4 KiB
Org Mode

#+PROPERTY: header-args:lisp :tangle (expand-file-name "org-skill-homoiconic-memory.lisp" (concat (or (getenv "INSTALL_DIR") ".") "/skills"))
:PROPERTIES:
:ID: homoiconic-memory-skill
:CREATED: [2026-04-10 Fri]
:END:
#+TITLE: SKILL: Homoiconic Memory (Merkle-Org Management)
#+STARTUP: content
#+FILETAGS: :memory:org:merkle:infrastructure:autonomy:
* Overview
The *Homoiconic Memory* skill provides the core persistence layer for OpenCortex, treating Org-mode files as a versioned, Merkle-structured AST.
* Implementation
#+begin_src lisp
(in-package :opencortex)
(defun memory-org-to-json (source)
"Converts Org-mode source to JSON AST."
(declare (ignore source))
"")
(defun memory-json-to-org (ast)
"Converts JSON AST back to Org-mode text."
(declare (ignore ast))
"")
(defun memory-normalize-ast (ast)
"Recursively ensures ID uniqueness across the AST."
(declare (ignore ast))
nil)
(defun make-memory-node (headline &key content properties children)
"Constructor for a normalized Org node alist."
(declare (ignore headline))
(list :TYPE :HEADLINE
:PROPERTIES (or properties nil)
:CONTENT content
:CONTENTS children))
(defskill :skill-homoiconic-memory
:priority 100
:trigger (lambda (ctx) (declare (ignore ctx)) nil)
:probabilistic nil
:deterministic (lambda (action ctx) (declare (ignore ctx)) action))
#+end_src