:PROPERTIES: :ID: 95029300-1d11-444c-a90a-a9f2c5474ca9 :CREATED: [2026-04-04 Sat 20:27] :EDITED: [2026-04-07 Tue 13:42] :END: #+TITLE: SKILL: Enriched Inbox Processor Agent (Universal Literate Note) #+STARTUP: content #+FILETAGS: :inbox:processor:workflow:psf: * Overview The *Enriched Inbox Processor Agent* is responsible for the daily migration of captured nodes from ~inbox.org~ to the ~daily/~ archive. It enforces a strict privacy wall for ~@personal~ content while providing deep semantic enrichment for public research. * Phase A: Demand (PRD) :PROPERTIES: :STATUS: FROZEN :END: ** 1. Purpose Automate the sorting and enrichment of inbox captures. ** 2. User Needs - *Privacy Wall:* Headlines tagged ~@personal~ are moved **symbolically only**. No LLM processing allowed. - *Semantic Enrichment:* For public items (non-@personal), generate: 1. A **Summary** sub-heading (1 sentence). 2. A **Significance** paragraph explaining the PSF use-case. 3. A **Full Text** extraction for items tagged ~!archive~. - *Archive-First:* ALL originals are moved to ~daily/YYYY-MM-DD.org~ based on the ~:CREATED:~ property. * Phase B: Blueprint (PROTOCOL) :PROPERTIES: :STATUS: SIGNED :END: ** 1. Architectural Intent Iterate through the inbox. Use System 2 (Symbolic) to identify the tag. If ~@personal~, perform a direct move. If not, trigger System 1 (Neuro) for enrichment. * Phase D: Build (Implementation) ** Helper: Privacy & Archive Checks #+begin_src lisp :tangle ../projects/org-skill-inbox-processor/src/processor-logic.lisp (defun inbox-is-private-p (tags) (member "@personal" tags :test #'string-equal)) (defun inbox-is-archive-p (tags) (member "!archive" tags :test #'string-equal)) #+end_src ** Neural Stage (Enrichment) #+begin_src lisp :tangle ../projects/org-skill-inbox-processor/src/processor-logic.lisp (defun neuro-skill-inbox-processor (context) (let* ((payload (getf context :payload)) (content (getf payload :content)) (tags (getf payload :tags)) (is-archive (inbox-is-archive-p tags))) (ask-neuro content :system-prompt (format nil "You are the PSF Librarian. Your goal is to ENRICH this Org-mode capture. RULES: 1. Create a '** Summary' sub-heading with a 1-sentence summary. 2. Create a '** Significance' sub-heading with a paragraph explaining why this matters to a Sovereign Lisp Machine and how it can be used. 3. ~:[~;~* ARCHIVE MODE: Extract the full text of the item into a '** Full Text' sub-heading, preserving Org-mode structure.~] 4. Return ONLY a Lisp plist with :summary :significance :full-text. 5. NO conversational filler." is-archive)))) #+end_src ** Symbolic Stage (The Physical Move) #+begin_src lisp :tangle ../projects/org-skill-inbox-processor/src/processor-logic.lisp (defun inbox-process-logic (action context) (declare (ignore action)) (let* ((payload (getf context :payload)) (sensor (getf payload :sensor))) (when (eq sensor :heartbeat) (let* ((base-dir (or (uiop:getenv "MEMEX_DIR") "/home/user/memex/")) (inbox-path (merge-pathnames "inbox.org" base-dir))) (org-agent:kernel-log "INBOX - Scanning ~a for migration..." (uiop:native-namestring inbox-path)) ;; Physical move logic would go here using Org AST parsing '(:target :system :payload (:action :message :text "Inbox processing complete (Simulation).")))))) #+end_src * Registration #+begin_src lisp (defskill :skill-inbox-processor :priority 100 :trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :heartbeat)) :neuro #'neuro-skill-inbox-processor :symbolic #'inbox-process-logic) #+end_src