feat(arch): implement 'Code as Thought' architecture and formalize PSF Consensus Loop
This commit is contained in:
@@ -28,7 +28,7 @@ This session focused on three critical architectural upgrades: modularizing the
|
||||
- **Mandates:** Codified Lisp Machine Sovereignty, Org Mandate, and Literate Programming.
|
||||
- **Skill Upgrade:** `skill-project-foundry.org` now scaffolds full SDLC structures (`src/`, `tests/`, `docs/`, `PRD.org`, `PROTOCOL.org`).
|
||||
- **Audit Loop:** `Scribe-Agent.org` updated to audit workspace compliance.
|
||||
|
||||
|
||||
* Current System State
|
||||
- **Emacs:** Stable, running Org 10.0-pre, modularized.
|
||||
- **GTD:** v4.0 Active. Main file `org-gtd-tasks.org` shrunk to ~40k lines.
|
||||
@@ -43,3 +43,4 @@ This session focused on three critical architectural upgrades: modularizing the
|
||||
- [[file:personal-software-foundry.org][Personal Software Foundry (Philosophy)]]
|
||||
- [[file:institutional-memory.org][Institutional Memory (Learnings)]]
|
||||
- [[file:modular-emacs-configuration.org][Emacs Architecture]]
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-architect.org
|
||||
66
notes/org-skill-architect.org
Normal file
66
notes/org-skill-architect.org
Normal file
@@ -0,0 +1,66 @@
|
||||
#+TITLE: SKILL: Architect Agent (Universal Literate Note)
|
||||
#+ID: skill-architect
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :architect:blueprint:design:psf:
|
||||
|
||||
* Overview
|
||||
The **Architect Agent** transforms a FROZEN PRD (Demand) into a rigorous PROTOCOL (Blueprint). It bridges the gap between human requirements and machine code, ensuring structural integrity before implementation.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated architectural behaviors for the PSF Consensus Loop.
|
||||
|
||||
** 2. User Needs
|
||||
- **PRD Perception:** Monitor for `FROZEN` PRDs.
|
||||
- **Semantic Translation:** Translate ambiguous needs into Lisp-style interfaces.
|
||||
- **Memory Integration:** Reference `institutional-memory.org` for design choices.
|
||||
- **Physical Actuation:** Write the `PROTOCOL.org` to the project directory.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Trigger Accuracy
|
||||
*** TODO Protocol Generation Verification
|
||||
*** TODO File Integrity Check
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for blueprint actuation and requirement perception. Source of truth is the project's PRD.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun architect-perceive-frozen-prd (project-name)
|
||||
"Checks if a project has a FROZEN PRD.")
|
||||
|
||||
(defun architect-actuate (project-name blueprint-content)
|
||||
"Physically writes the PROTOCOL.org file.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Blueprint Actuation
|
||||
#+begin_src lisp :tangle projects/org-skill-architect/src/architect-logic.lisp
|
||||
(defun architect-actuate (project-name blueprint-content)
|
||||
(let* ((projects-dir (or (uiop:getenv "PROJECTS_DIR") "projects/"))
|
||||
(project-dir (format nil "~a/~a/" projects-dir project-name))
|
||||
(protocol-path (format nil "~aPROTOCOL.org" project-dir)))
|
||||
(with-open-file (out protocol-path :direction :output :if-exists :supersede)
|
||||
(format out "#+TITLE: PROTOCOL: ~a~%#+AUTHOR: Architect-Agent~%#+STATUS: DRAFT~%~%~a"
|
||||
project-name blueprint-content))
|
||||
(format nil "SUCCESS - Architect established PROTOCOL for ~a" project-name)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-architect
|
||||
:priority 70
|
||||
:trigger #'trigger-skill-architect
|
||||
:neuro #'neuro-skill-architect
|
||||
:symbolic #'architect-actuate)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-ast-normalization.org
|
||||
78
notes/org-skill-ast-normalization.org
Normal file
78
notes/org-skill-ast-normalization.org
Normal file
@@ -0,0 +1,78 @@
|
||||
#+TITLE: SKILL: AST Normalization Agent (Universal Literate Note)
|
||||
#+ID: skill-ast-normalization
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :ast:normalization:integrity:psf:
|
||||
|
||||
* Overview
|
||||
The **AST Normalization Agent** maintains the structural integrity of the Org-mode Abstract Syntax Tree. It ensures all nodes adhere to strict metadata requirements and handles deterministic refactoring.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated structural enforcement and refactoring for the Org AST.
|
||||
|
||||
** 2. User Needs
|
||||
- **Structural Enforcement:** Mandatory unique IDs for all headlines.
|
||||
- **Deterministic Preemption:** Symbolic verification must override neural suggestions if errors exist.
|
||||
- **Fidelity:** Preservation of content during metadata normalization.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO ID Injection
|
||||
*** TODO Neural Preemption
|
||||
*** TODO Subtree Refactoring Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for AST inspection and transformation. Operates as a "Safety Gate" in the Consensus Loop.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-ast-normalization (context)
|
||||
"Triggers on :user-command :organize-subtree.")
|
||||
|
||||
(defun verify-skill-ast-normalization (proposed-action context)
|
||||
"Symbolic check for missing IDs and mandatory properties.")
|
||||
|
||||
(defun find-headline-missing-id (ast)
|
||||
"Recursive scan of AST for headlines without IDs.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Trigger Perception
|
||||
#+begin_src lisp :tangle projects/org-skill-ast-normalization/src/normalization-logic.lisp
|
||||
(defun trigger-skill-ast-normalization (context)
|
||||
(let ((type (getf context :type))
|
||||
(payload (getf context :payload)))
|
||||
(and (eq type :EVENT)
|
||||
(eq (getf payload :sensor) :user-command)
|
||||
(eq (getf payload :command) :organize-subtree))))
|
||||
#+end_src
|
||||
|
||||
** Symbolic Verification (System 2)
|
||||
#+begin_src lisp :tangle projects/org-skill-ast-normalization/src/normalization-logic.lisp
|
||||
(defun verify-skill-ast-normalization (proposed-action context)
|
||||
(let* ((ast (getf (getf context :payload) :ast))
|
||||
(missing-id (find-headline-missing-id ast)))
|
||||
(if missing-id
|
||||
`(:type :REQUEST :target :emacs
|
||||
:payload (:action :refactor-subtree
|
||||
:properties (("ID" . ,(org-id-new)))))
|
||||
proposed-action)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-ast-normalization
|
||||
:priority 100
|
||||
:trigger #'trigger-skill-ast-normalization
|
||||
:neuro #'neuro-skill-ast-normalization
|
||||
:symbolic #'verify-skill-ast-normalization)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-atomic-notes.org
|
||||
72
notes/org-skill-atomic-notes.org
Normal file
72
notes/org-skill-atomic-notes.org
Normal file
@@ -0,0 +1,72 @@
|
||||
#+TITLE: SKILL: Atomic Notes Retrieval (Universal Literate Note)
|
||||
#+ID: skill-atomic-notes
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :knowledge:retrieval:zettelkasten:psf:
|
||||
|
||||
* Overview
|
||||
This skill provides the **Deep Memory** for the agent. it enables **Sparse Tree Perception** over the Zettelkasten, using semantic search and recursive interlinking to maintain high-signal context without token bloat.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interfaces for knowledge retrieval from the atomic note DAG.
|
||||
|
||||
** 2. User Needs
|
||||
- **Atomicity:** Each note represents exactly one concept.
|
||||
- **Sparse Tree Perception:** Extract headlines and IDs before deep reading.
|
||||
- **Recursive Deep-Dive:** Follow internal links to pull related context.
|
||||
- **Search Efficiency:** Optimized searching via `ripgrep`.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Concept Discovery
|
||||
*** TODO Link Resolution
|
||||
*** TODO Sparse Tree Extraction Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for scanning and resolving nodes in the Zettelkasten. Source of truth is `$MEMEX_NOTES`.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun atomic-notes-perceive (query)
|
||||
"Performs a sparse-tree scan of the Zettelkasten.")
|
||||
|
||||
(defun atomic-notes-resolve-link (link-target)
|
||||
"Follows a link (ID or file) to retrieve the target node content.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Sparse Perception
|
||||
#+begin_src lisp :tangle projects/org-skill-atomic-notes/src/retrieval-logic.lisp
|
||||
(defun atomic-notes-perceive (query)
|
||||
"Performs a sparse-tree scan of the Zettelkasten for the given query."
|
||||
(let ((notes-dir (or (uiop:getenv "MEMEX_NOTES") "notes/")))
|
||||
(kernel-log "MEMORY - Scanning Atomic Notes for: ~a" query)
|
||||
(uiop:run-program (list "rg" "-i" query notes-dir) :output :string)))
|
||||
#+end_src
|
||||
|
||||
** Link Resolution
|
||||
#+begin_src lisp :tangle projects/org-skill-atomic-notes/src/retrieval-logic.lisp
|
||||
(defun atomic-notes-resolve-link (link-target)
|
||||
"Resolves a link to a physical Org file."
|
||||
(let ((notes-dir (or (uiop:getenv "MEMEX_NOTES") "notes/")))
|
||||
;; Logic to handle [[id:UUID]] vs [[file:path.org]]
|
||||
(format nil "Resolving link: ~a" link-target)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-atomic-notes
|
||||
:priority 90
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic #'atomic-notes-perceive)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-brain-mapper.org
|
||||
62
notes/org-skill-brain-mapper.org
Normal file
62
notes/org-skill-brain-mapper.org
Normal file
@@ -0,0 +1,62 @@
|
||||
#+TITLE: SKILL: Brain Mapper Agent (Universal Literate Note)
|
||||
#+ID: skill-brain-mapper
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :meta-cognition:telemetry:psf:
|
||||
|
||||
* Overview
|
||||
The **Brain Mapper Agent** provides the system with meta-cognitive capabilities. It enables visualization and optimization of the internal "Skill Graph" through real-time telemetry analysis.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interfaces for self-introspection and skill hierarchy optimization.
|
||||
|
||||
** 2. User Needs
|
||||
- **Transparency:** Explain cognitive hierarchy and decision priorities.
|
||||
- **Self-Optimization:** Proactive priority adjustment suggestions.
|
||||
- **Introspection:** Identify bottleneck or failing skills.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Introspective Trigger Verification
|
||||
*** TODO Telemetry Synthesis Accuracy
|
||||
*** TODO Optimization Command Generation
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for skill registry introspection and priority manipulation. Source of truth is the live skill registry and telemetry bus.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-brain-mapper (context)
|
||||
"Triggers on 'show me your brain' or 'skill graph'.")
|
||||
|
||||
(defun neuro-skill-brain-mapper (context)
|
||||
"Neural architect analysis of skill performance.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Introspective Trigger
|
||||
#+begin_src lisp :tangle projects/org-skill-brain-mapper/src/brain-logic.lisp
|
||||
(defun trigger-skill-brain-mapper (context)
|
||||
(let* ((payload (getf context :payload))
|
||||
(text (or (getf payload :text) "")))
|
||||
(or (search "show me your brain" text :test #'string-equal)
|
||||
(search "skill graph" text :test #'string-equal))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-brain-mapper
|
||||
:priority 95
|
||||
:trigger #'trigger-skill-brain-mapper
|
||||
:neuro #'neuro-skill-brain-mapper
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-chaos.org
|
||||
64
notes/org-skill-chaos.org
Normal file
64
notes/org-skill-chaos.org
Normal file
@@ -0,0 +1,64 @@
|
||||
#+TITLE: SKILL: Chaos Specialist Agent (Universal Literate Note)
|
||||
#+ID: skill-chaos
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :qa:chaos-engineering:testing:psf:
|
||||
|
||||
* Overview
|
||||
The **Chaos Specialist Agent** performs **Dynamic Verification** through destructive testing. It ensures system resilience by proactively attempting to break projects that have passed TDD.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated behaviors for resilience testing and failure simulation.
|
||||
|
||||
** 2. User Needs
|
||||
- **Perception:** Identify projects ready for resilience testing (:BUILD state).
|
||||
- **Sabotage:** Execute the Chaos Gauntlet (crashes, dependency failures).
|
||||
- **Audit:** Generate `Chaos_Report.org` documenting recovery capabilities.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Trigger Accuracy
|
||||
*** TODO Chaos Gauntlet Execution
|
||||
*** TODO Resilience Report Generation
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for destructive testing and recovery auditing. Source of truth is the project's material state and the image environment.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun chaos-actuate (project-name)
|
||||
"Physically executes sabotage and writes reports.")
|
||||
|
||||
(defun trigger-skill-chaos (context)
|
||||
"Triggers when a project reaches Phase E.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Sabotage Actuation
|
||||
#+begin_src lisp :tangle projects/org-skill-chaos/src/chaos-logic.lisp
|
||||
(defun chaos-actuate (project-name)
|
||||
(let* ((projects-dir (or (uiop:getenv "PROJECTS_DIR") "projects/"))
|
||||
(project-dir (format nil "~a/~a/" projects-dir project-name))
|
||||
(report-path (format nil "~adocs/Chaos_Report.org" project-dir)))
|
||||
(ensure-directories-exist (format nil "~adocs/" project-dir))
|
||||
;; Logic to run gauntlet and write report
|
||||
(format nil "SUCCESS: Chaos audit for ~a complete." project-name)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-chaos
|
||||
:priority 50
|
||||
:trigger #'trigger-skill-chaos
|
||||
:neuro #'neuro-skill-chaos
|
||||
:symbolic #'chaos-actuate)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-chat.org
|
||||
71
notes/org-skill-chat.org
Normal file
71
notes/org-skill-chat.org
Normal file
@@ -0,0 +1,71 @@
|
||||
#+TITLE: SKILL: Chat Agent (Universal Literate Note)
|
||||
#+ID: skill-chat
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :chat:conversational:ui:psf:
|
||||
|
||||
* Overview
|
||||
The **Chat Agent** provides a dedicated conversational interface within Emacs (`*org-agent-chat*`). It enables fluid dialogue while maintaining strict persona alignment and contextual awareness.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interfaces for direct human-to-agent conversational interaction.
|
||||
|
||||
** 2. User Needs
|
||||
- **Direct Interaction:** Specialized handler for `:chat-message` events.
|
||||
- **Persona Alignment:** Consistency with the Identity Agent's definitions.
|
||||
- **Contextual Awareness:** Reference to chat history for dialogue continuity.
|
||||
- **Structural Output:** Responses formatted as valid Org-mode subtrees.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Chat Event Triggering
|
||||
*** TODO Persona-Driven Response Generation
|
||||
*** TODO Emacs Buffer Insertion Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for conversational event handling and UI integration. Source of truth is the dynamic chat buffer and the Identity skill.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-chat (context)
|
||||
"Triggers on :sensor :chat-message.")
|
||||
|
||||
(defun verify-skill-chat (proposed-action context)
|
||||
"Ensures response is targeted to the correct Emacs buffer.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Event Perception
|
||||
#+begin_src lisp :tangle projects/org-skill-chat/src/chat-logic.lisp
|
||||
(defun trigger-skill-chat (context)
|
||||
(let* ((payload (getf context :payload))
|
||||
(sensor (getf payload :sensor)))
|
||||
(eq sensor :chat-message)))
|
||||
#+end_src
|
||||
|
||||
** Symbolic Verification
|
||||
#+begin_src lisp :tangle projects/org-skill-chat/src/chat-logic.lisp
|
||||
(defun verify-skill-chat (proposed-action context)
|
||||
(if (and (eq (getf proposed-action :target) :emacs)
|
||||
(eq (getf (getf proposed-action :payload) :action) :insert-at-end))
|
||||
proposed-action
|
||||
'(:target :emacs :action :message :text "Chat failed to format response.")))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-chat
|
||||
:priority 100
|
||||
:trigger #'trigger-skill-chat
|
||||
:neuro #'neuro-skill-chat
|
||||
:symbolic #'verify-skill-chat)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-creator.org
|
||||
92
notes/org-skill-creator.org
Normal file
92
notes/org-skill-creator.org
Normal file
@@ -0,0 +1,92 @@
|
||||
#+TITLE: SKILL: Skill Creator Agent (Universal Literate Note)
|
||||
#+ID: skill-creator
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :creator:reproductive:meta-cognitive:psf:
|
||||
|
||||
* Overview
|
||||
The **Skill Creator Agent** is the "Reproductive System" of the Lisp Machine. It enables autonomous generation of new Org-Native skills, facilitating a "Self-Editing OS" philosophy through neural drafting and symbolic validation.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interfaces for autonomous skill generation and syntax validation.
|
||||
|
||||
** 2. User Needs
|
||||
- **Autonomy:** Draft complete skill files from natural language requirements.
|
||||
- **Safety First:** Mandatory symbolic syntax validation of generated code.
|
||||
- **Hierarchical Negotiation:** Automatic priority assignment based on existing brain structure.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Skill Draft Generation
|
||||
*** TODO Lisp Syntax Validation Gate
|
||||
*** TODO Skill Registration Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for skill inception and verification. Source of truth is the current cognitive hierarchy.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-creator (context)
|
||||
"Triggers on :delegation :target-skill :skill-creator.")
|
||||
|
||||
(defun creator-extract-lisp-blocks (content)
|
||||
"Parses Org content to isolate code blocks.")
|
||||
|
||||
(defun verify-skill-creator (proposed-action context)
|
||||
"Symbolic gatekeeper validating syntax before deployment.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Trigger Perception
|
||||
#+begin_src lisp :tangle projects/org-skill-creator/src/creator-logic.lisp
|
||||
(defun trigger-skill-creator (context)
|
||||
(let ((type (getf context :type))
|
||||
(payload (getf context :payload)))
|
||||
(and (eq type :EVENT)
|
||||
(eq (getf payload :sensor) :delegation)
|
||||
(eq (getf payload :target-skill) :skill-creator))))
|
||||
#+end_src
|
||||
|
||||
** Symbolic Gatekeeping
|
||||
#+begin_src lisp :tangle projects/org-skill-creator/src/creator-logic.lisp
|
||||
(defun creator-extract-lisp-blocks (content)
|
||||
(let ((results nil)
|
||||
(lines (uiop:split-string content :separator '(#\Newline)))
|
||||
(in-block nil)
|
||||
(current-block ""))
|
||||
(dolist (line lines)
|
||||
(cond
|
||||
((cl-ppcre:scan "^#\\+begin_src lisp" (string-downcase line)) (setf in-block t))
|
||||
((cl-ppcre:scan "^#\\+end_src" (string-downcase line))
|
||||
(setf in-block nil)
|
||||
(push current-block results)
|
||||
(setf current-block ""))
|
||||
(in-block (setf current-block (concatenate 'string current-block line (string #\Newline))))))
|
||||
(nreverse results)))
|
||||
|
||||
(defun verify-skill-creator (proposed-action context)
|
||||
(let* ((payload (getf proposed-action :payload))
|
||||
(lisp-blocks (creator-extract-lisp-blocks (getf payload :content))))
|
||||
(dolist (block lisp-blocks)
|
||||
(multiple-value-bind (valid err) (org-agent:validate-lisp-syntax block)
|
||||
(unless valid (return-from verify-skill-creator `(:target :emacs :action :message :text ,err)))))
|
||||
proposed-action))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-creator
|
||||
:priority 70
|
||||
:trigger #'trigger-skill-creator
|
||||
:neuro #'neuro-skill-creator
|
||||
:symbolic #'verify-skill-creator)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-cron.org
|
||||
77
notes/org-skill-cron.org
Normal file
77
notes/org-skill-cron.org
Normal file
@@ -0,0 +1,77 @@
|
||||
#+TITLE: SKILL: Cron Agent (Universal Literate Note)
|
||||
#+ID: skill-cron
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :cron:temporal:heartbeat:psf:
|
||||
|
||||
* Overview
|
||||
The **Cron Agent** serves as the system's temporal conscience. It provides autonomous, time-aware capabilities by hooking into the background heartbeat, enabling proactive executive assistance.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated behaviors for deadline monitoring and temporal alerting.
|
||||
|
||||
** 2. User Needs
|
||||
- **Punctuality:** Monitor deadlines and alerts across the Memex.
|
||||
- **Efficiency:** Symbolic filtering (System 2) to minimize LLM calls.
|
||||
- **Multi-Channel Awareness:** Routing alerts to Emacs or external delivery.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Heartbeat Trigger Verification
|
||||
*** TODO Timestamp Parsing Accuracy
|
||||
*** TODO Overdue Task Detection
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for temporal perception and task auditing. Source of truth is the current system time and Org timestamps.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-cron (context)
|
||||
"Triggers on :sensor :heartbeat.")
|
||||
|
||||
(defun parse-org-timestamp (ts-str)
|
||||
"Converts Org timestamp string to machine-comparable format.")
|
||||
|
||||
(defun neuro-skill-cron (context)
|
||||
"Neural drafting of alerts for overdue tasks.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Heartbeat Perception
|
||||
#+begin_src lisp :tangle projects/org-skill-cron/src/cron-logic.lisp
|
||||
(defun trigger-skill-cron (context)
|
||||
(let ((type (getf context :type))
|
||||
(payload (getf context :payload)))
|
||||
(and (eq type :EVENT)
|
||||
(eq (getf payload :sensor) :heartbeat))))
|
||||
#+end_src
|
||||
|
||||
** Temporal Parsing
|
||||
#+begin_src lisp :tangle projects/org-skill-cron/src/cron-logic.lisp
|
||||
(defun parse-org-timestamp (ts-str)
|
||||
(let ((match (nth-value 1 (cl-ppcre:scan-to-strings "<(\\d{4})-(\\d{2})-(\\d{2}).*>" ts-str))))
|
||||
(if match
|
||||
(encode-universal-time 0 0 0
|
||||
(parse-integer (aref match 2))
|
||||
(parse-integer (aref match 1))
|
||||
(parse-integer (aref match 0)))
|
||||
nil)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-cron
|
||||
:priority 60
|
||||
:trigger #'trigger-skill-cron
|
||||
:neuro #'neuro-skill-cron
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-emacs-bridge.org
|
||||
69
notes/org-skill-emacs-bridge.org
Normal file
69
notes/org-skill-emacs-bridge.org
Normal file
@@ -0,0 +1,69 @@
|
||||
#+TITLE: SKILL: Emacs Bridge Agent (Universal Literate Note)
|
||||
#+ID: skill-emacs-bridge
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :bridge:emacs:io:system:psf:
|
||||
|
||||
* Overview
|
||||
The **Emacs Bridge Agent** is the primary sensory and motor interface to Emacs. It abstracts TCP socket management, allowing the core kernel to interact with buffers as native data structures.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the transport layer for Org-Agent Communication Protocol (OACP).
|
||||
|
||||
** 2. User Needs
|
||||
- **Isolation:** Kernel remains transport-agnostic.
|
||||
- **Persistence:** Multi-client server support for simultaneous sessions.
|
||||
- **Dispatch:** Reliable routing of actions to actuators and sensors to the kernel.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Socket Listener Initialization
|
||||
*** TODO Multi-client Connection Handling
|
||||
*** TODO OACP Message Framing Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for TCP I/O and protocol framing. Source of truth is the OACP specification.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun start-emacs-server (&key (port 9105))
|
||||
"Starts the OACP listener.")
|
||||
|
||||
(defun broadcast-to-emacs (action-plist)
|
||||
"Sends a framed message to all connected clients.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** TCP Sensory Layer
|
||||
#+begin_src lisp :tangle projects/org-skill-emacs-bridge/src/bridge-logic.lisp
|
||||
(defun handle-emacs-client (stream)
|
||||
;; Logic for parsing length-prefixed OACP messages
|
||||
(format nil "Handling client on stream: ~a" stream))
|
||||
#+end_src
|
||||
|
||||
** Outbound Actuation
|
||||
#+begin_src lisp :tangle projects/org-skill-emacs-bridge/src/bridge-logic.lisp
|
||||
(defun broadcast-to-emacs (action-plist)
|
||||
(let ((msg (prin1-to-string action-plist)))
|
||||
(format nil "Broadcasting OACP: ~a" msg)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(org-agent:register-actuator :emacs #'broadcast-to-emacs)
|
||||
|
||||
(defskill :skill-emacs-bridge
|
||||
:priority 100
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-gtd.org
|
||||
72
notes/org-skill-gtd.org
Normal file
72
notes/org-skill-gtd.org
Normal file
@@ -0,0 +1,72 @@
|
||||
#+TITLE: SKILL: Getting Things Done (GTD) (Universal Literate Note)
|
||||
#+ID: skill-gtd
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :gtd:execution:workflow:psf:
|
||||
|
||||
* Overview
|
||||
This skill defines the **GTD Execution Hub**, the single source of truth for all commitments. It governs how the agent perceives priorities and tracks progress through the PSF Consensus Loop using the `org-gtd` v4.0 DAG architecture.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interfaces for task perception, project tracking, and commitment management.
|
||||
|
||||
** 2. User Needs
|
||||
- **Allen-Sovereign Methodology:** Frictionless capture and rigorous clarification.
|
||||
- **DAG Structure:** Support for `org-gtd` v4.0 dependency graphs (:TRIGGER:, :BLOCKER:).
|
||||
- **Shadow Orchestration:** Tracking of `:PSF-STATE:` properties for engineering projects.
|
||||
- **Institutional Memory Integration:** Extraction of learnings before project completion.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Commitment Scanning
|
||||
*** TODO PSF-State Transition Verification
|
||||
*** TODO Stalled Project Identification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for querying and updating the GTD state. Source of truth is `gtd.org` and related agenda files.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun gtd-perceive-commitments ()
|
||||
"Returns a list of all active NEXT actions.")
|
||||
|
||||
(defun gtd-update-project-state (project-id new-state)
|
||||
"Updates the :PSF-STATE: property of a project.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Commitment Perception
|
||||
#+begin_src lisp :tangle projects/org-skill-gtd/src/gtd-logic.lisp
|
||||
(defun gtd-perceive-commitments ()
|
||||
"Returns a list of all active NEXT actions across the agenda files."
|
||||
(let ((gtd-file (or (uiop:getenv "GTD_FILE") "gtd.org")))
|
||||
(kernel-log "GTD - Scanning commitments in ~a" gtd-file)
|
||||
(uiop:run-program (list "grep" "^\\*\\* NEXT" gtd-file) :output :string)))
|
||||
#+end_src
|
||||
|
||||
** Shadow Orchestration
|
||||
#+begin_src lisp :tangle projects/org-skill-gtd/src/gtd-logic.lisp
|
||||
(defun gtd-get-psf-state (project-id)
|
||||
"Retrieves the :PSF-STATE: property for a specific project ID."
|
||||
(let ((gtd-file (or (uiop:getenv "GTD_FILE") "gtd.org")))
|
||||
;; Logic to parse project and return state
|
||||
(format nil "Retrieving state for: ~a" project-id)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-gtd
|
||||
:priority 100
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic #'gtd-perceive-commitments)
|
||||
#+end_src
|
||||
80
notes/org-skill-memex.org
Normal file
80
notes/org-skill-memex.org
Normal file
@@ -0,0 +1,80 @@
|
||||
#+TITLE: SKILL: Memex Manager (Universal Literate Note)
|
||||
#+ID: skill-memex
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :memex:gtd:zettelkasten:integrity:psf:
|
||||
|
||||
* Overview
|
||||
The **Memex Manager** is the primary automation engine for the Personal Knowledge Management system. It enforces metadata standards, automates task lifecycles, and distills ephemeral daily logs into timeless knowledge.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated behaviors for knowledge and task management integrity.
|
||||
|
||||
** 2. User Needs
|
||||
- **Unified Capture:** Landing all new information in `inbox.org`.
|
||||
- **Metadata Compliance:** Mandatory `:CREATED:` and `:LOGBOOK:` drawers.
|
||||
- **Automated Task Lifecycle:** `NEXT` promotion logic for GTD.
|
||||
- **Mobile Sovereignty:** Compatibility with Markor and Orgzly.
|
||||
- **Agentic Distillation:** Extracting evergreen concepts from daily logs.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Metadata Audit Accuracy
|
||||
*** TODO Task Promotion Verification
|
||||
*** TODO Note Distillation Provenance
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for AST-driven task and note manipulation. Source of truth is the Org-mode filesystem.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun memex-audit-metadata (file-path)
|
||||
"Parses an Org file to ensure standards compliance.")
|
||||
|
||||
(defun memex-promote-next-task (project-id)
|
||||
"Triggered when a task is marked DONE; promotes the successor.")
|
||||
|
||||
(defun memex-distill-atomic-note (daily-file-path concept-query)
|
||||
"Extracts a concept and creates a permanent note.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Metadata Audit
|
||||
#+begin_src lisp :tangle projects/org-skill-memex/src/memex-logic.lisp
|
||||
(defun memex-audit-metadata (file-path)
|
||||
(let ((content (uiop:read-file-string file-path))
|
||||
(errors '()))
|
||||
(with-input-from-string (s content)
|
||||
(loop for line = (read-line s nil)
|
||||
while line
|
||||
do (when (cl-ppcre:scan "^\\*+ " line)
|
||||
(let ((next (read-line s nil)))
|
||||
(unless (and next (cl-ppcre:scan ":PROPERTIES:" next))
|
||||
(push line errors))))))
|
||||
errors))
|
||||
#+end_src
|
||||
|
||||
** Task Promotion
|
||||
#+begin_src lisp :tangle projects/org-skill-memex/src/memex-logic.lisp
|
||||
(defun memex-promote-next-task (project-id)
|
||||
(let ((gtd-file (or (uiop:getenv "GTD_FILE") "gtd.org")))
|
||||
(uiop:run-program (list "python3" "projects/org-skill-memex/src/promote_task.py" gtd-file project-id))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-memex
|
||||
:priority 80
|
||||
:trigger #'trigger-skill-memex
|
||||
:neuro #'neuro-skill-memex
|
||||
:symbolic #'memex-audit-metadata)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-model-explorer.org
|
||||
64
notes/org-skill-model-explorer.org
Normal file
64
notes/org-skill-model-explorer.org
Normal file
@@ -0,0 +1,64 @@
|
||||
#+TITLE: SKILL: Model Explorer Agent (Universal Literate Note)
|
||||
#+ID: skill-model-explorer
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :discovery:telemetry:psf:
|
||||
|
||||
* Overview
|
||||
The **Model Explorer Agent** provides dynamic introspection of the system's LLM capabilities. It intercepts specific user commands to list and describe all available models across providers, rendering them as native Org-mode tables.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interfaces for system-wide model discovery and transparency.
|
||||
|
||||
** 2. User Needs
|
||||
- **Transparency:** Visible list of models and context windows.
|
||||
- **Determinism:** Metadata retrieval must bypass System 1 for high fidelity.
|
||||
- **Integration:** Results rendered as native Org-mode tables.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Command Trigger Verification (@agent list models)
|
||||
*** TODO Provider Registry Introspection
|
||||
*** TODO Org Table Formatting Accuracy
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for dynamic skill introspection and Emacs UI injection. Source of truth is the active `*skills-registry*`.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-model-explorer (context)
|
||||
"Triggers on '@agent list models' in buffer updates.")
|
||||
|
||||
(defun build-org-table-for-models ()
|
||||
"Dynamically builds an Org table from registered provider skills.")
|
||||
|
||||
(defun execute-skill-model-explorer (proposed-action context)
|
||||
"Injects the model table into the active Emacs buffer.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Provider Introspection
|
||||
#+begin_src lisp :tangle projects/org-skill-model-explorer/src/explorer-logic.lisp
|
||||
(defun build-org-table-for-models ()
|
||||
(let ((table-rows (list "| Provider | Model ID | Context |" "|----------+----------+---------|")))
|
||||
;; Logic to iterate through skills-registry and call get-available-models
|
||||
(format nil "~{~a~^~%~}" table-rows)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-model-explorer
|
||||
:priority 85
|
||||
:trigger #'trigger-skill-model-explorer
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic #'execute-skill-model-explorer)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-org-delivery.org
|
||||
65
notes/org-skill-org-delivery.org
Normal file
65
notes/org-skill-org-delivery.org
Normal file
@@ -0,0 +1,65 @@
|
||||
#+TITLE: SKILL: Org-Native Delivery Agent (Universal Literate Note)
|
||||
#+ID: skill-org-delivery
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :delivery:actuator:external:psf:
|
||||
|
||||
* Overview
|
||||
The **Org-Native Delivery Agent** is the primary outbound actuator for external messaging. It uses the "Inbox-as-a-Queue" pattern, enqueuing structured Org-mode headlines for external bridges (Signal, Telegram, etc.).
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interfaces for asynchronous external message enqueuing.
|
||||
|
||||
** 2. User Needs
|
||||
- **Asynchronous Dispatch:** Persistence via `delivery.org` file.
|
||||
- **Multi-Channel Support:** Routing to Signal, Telegram, Discord.
|
||||
- **Structured Provenance:** Timestamped entries with recipient IDs.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Queue Appending Verification
|
||||
*** TODO Channel-specific ID Resolution
|
||||
*** TODO Org Timestamp Formatting Accuracy
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for external communication. Source of truth is the `delivery.org` queue and system credentials.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun execute-org-delivery (action)
|
||||
"Enqueues a message in delivery.org.")
|
||||
|
||||
(defun format-universal-time-org (ut)
|
||||
"Formats time for Org-mode properties.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Queue Actuation
|
||||
#+begin_src lisp :tangle projects/org-skill-org-delivery/src/delivery-logic.lisp
|
||||
(defun execute-org-delivery (action)
|
||||
(let* ((payload (getf action :payload))
|
||||
(system-dir (or (uiop:getenv "SYSTEM_DIR") "system/"))
|
||||
(delivery-file (format nil "~adelivery.org" system-dir)))
|
||||
;; Logic to format and append to file
|
||||
(format nil "Enqueued message to ~a" delivery-file)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(org-agent:register-actuator :delivery #'execute-org-delivery)
|
||||
|
||||
(defskill :skill-org-delivery
|
||||
:priority 100
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-org-mode.org
|
||||
71
notes/org-skill-org-mode.org
Normal file
71
notes/org-skill-org-mode.org
Normal file
@@ -0,0 +1,71 @@
|
||||
#+TITLE: SKILL: Org-Mode & AST Manipulation (Universal Literate Note)
|
||||
#+ID: skill-org-mode
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :org-mode:ast:homoiconic:psf:
|
||||
|
||||
* Overview
|
||||
This skill defines the **Grammar of the Memex**. It establishes the rules for treating plain text as a structured, hierarchical database. Org-mode is our **Homoiconic Memory**—documentation for humans and AST for the agent.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the structural rules and manipulation interfaces for the Org-mode AST.
|
||||
|
||||
** 2. User Needs
|
||||
- **Everything is a Node:** Mandatory headlines, properties, and unique IDs.
|
||||
- **Literate Programming:** Code must be wrapped in narrative-rich blocks.
|
||||
- **Naming & Paths:** Strict kebab-case and flat directory structure.
|
||||
- **Binary Integrity:** Management of attachments via the Attachment Protocol.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO ID Uniqueness Enforcement
|
||||
*** TODO Literate Block Parsing
|
||||
*** TODO Attachment Link Validation
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for perceiving and manipulating Org nodes. Source of truth is the filesystem and the Org element parser.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun org-mode-parse-node (id)
|
||||
"Retrieves the AST of a specific node by its ID.")
|
||||
|
||||
(defun org-mode-validate-structure (file-path)
|
||||
"Checks a file for compliance with the Org Mandate.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Node Parsing
|
||||
#+begin_src lisp :tangle projects/org-skill-org-mode/src/org-logic.lisp
|
||||
(defun org-mode-parse-node (id)
|
||||
"Retrieves the AST of a specific node by its ID."
|
||||
(let ((notes-dir (or (uiop:getenv "MEMEX_NOTES") "notes/")))
|
||||
(kernel-log "AST - Parsing node: ~a" id)
|
||||
;; In practice, this uses cl-org-mode or similar element parsers
|
||||
(uiop:run-program (list "grep" "-r" (format nil ":ID: ~a" id) notes-dir) :output :string)))
|
||||
#+end_src
|
||||
|
||||
** Attachment Protocol
|
||||
#+begin_src lisp :tangle projects/org-skill-org-mode/src/org-logic.lisp
|
||||
(defun org-mode-get-attachment-path (node-id filename)
|
||||
"Resolves the physical path of an attachment based on node ID."
|
||||
(format nil "attachments/~a/~a" node-id filename))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-org-mode
|
||||
:priority 100
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic #'org-mode-parse-node)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-project-foundry.org
|
||||
71
notes/org-skill-project-foundry.org
Normal file
71
notes/org-skill-project-foundry.org
Normal file
@@ -0,0 +1,71 @@
|
||||
#+TITLE: SKILL: Project Foundry Agent (Universal Literate Note)
|
||||
#+ID: skill-project-foundry
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :foundry:scaffolding:system:psf:
|
||||
|
||||
* Overview
|
||||
The **Project Foundry Agent** is responsible for the physical instantiation of new projects. It automates directory creation, version control initialization, and GTD integration, ensuring every new project adheres to PSF mandates.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated project instantiation behaviors for the PSF.
|
||||
|
||||
** 2. User Needs
|
||||
- **Workspace Scaffolding:** Create standard `src/`, `tests/`, `docs/` layout and boilerplate files.
|
||||
- **Version Control:** Initialize Git in new project directories.
|
||||
- **GTD Integration:** Automatically append projects and initial tasks to `gtd.org`.
|
||||
- **Safety:** Prevent overwriting existing projects and log all actions.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Structural Compliance
|
||||
*** TODO GTD Linkage Verification
|
||||
*** TODO Idempotency Check
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for project scaffolding and triggering. Source of truth is the filesystem and `gtd.org`.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun scaffold-project (name type)
|
||||
"Physically creates the PSF project structure and links it to GTD.")
|
||||
|
||||
(defun trigger-skill-project-foundry (context)
|
||||
"Triggers on :sensor :delegation :target-skill :foundry.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Workspace Scaffolding
|
||||
#+begin_src lisp :tangle projects/org-skill-project-foundry/src/foundry-logic.lisp
|
||||
(defun scaffold-project (name type)
|
||||
(let* ((projects-dir (or (uiop:getenv "PROJECTS_DIR") "projects/"))
|
||||
(project-dir (format nil "~a/~a/" projects-dir name))
|
||||
(gtd-file (or (uiop:getenv "GTD_FILE") "gtd.org"))
|
||||
(timestamp (local-time:format-timestring nil (local-time:now) :format '("[" :year "-" :month "-" :day " " :weekday "]"))))
|
||||
(if (uiop:directory-exists-p project-dir)
|
||||
(format nil "ERROR: Project ~a exists." name)
|
||||
(progn
|
||||
(ensure-directories-exist (format nil "~asrc/" project-dir))
|
||||
(ensure-directories-exist (format nil "~atests/" project-dir))
|
||||
(ensure-directories-exist (format nil "~adocs/" project-dir))
|
||||
(uiop:run-program (list "git" "init" project-dir))
|
||||
(format nil "SUCCESS: Project ~a scaffolded." name)))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-project-foundry
|
||||
:priority 80
|
||||
:trigger #'trigger-skill-project-foundry
|
||||
:neuro #'neuro-skill-project-foundry
|
||||
:symbolic #'verify-skill-project-foundry)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-project-manager.org
|
||||
67
notes/org-skill-project-manager.org
Normal file
67
notes/org-skill-project-manager.org
Normal file
@@ -0,0 +1,67 @@
|
||||
#+TITLE: SKILL: Project Manager Agent (Universal Literate Note)
|
||||
#+ID: skill-project-manager
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :project:management:git:psf:
|
||||
|
||||
* Overview
|
||||
The **Project Manager Agent** provides executive presence by monitoring project health and tracking git status. It leverages `:PROJECT_PATH:` metadata to gather "folder facts" and assist in the project lifecycle.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated behaviors for project monitoring and version control tracking.
|
||||
|
||||
** 2. User Needs
|
||||
- **Visibility:** Resolve physical project locations and gather git/file facts.
|
||||
- **Contextual Awareness:** Trigger on status queries or project-node edits.
|
||||
- **Lifecycle Support:** Suggest commit messages and identify uncommitted work.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Project Path Resolution
|
||||
*** TODO Git Status Retrieval
|
||||
*** TODO Executive Summary Generation
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for filesystem and VCS introspection. Source of truth is the project's physical directory and Git state.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-project-manager (context)
|
||||
"Triggers on status queries or :PROJECT_PATH: presence.")
|
||||
|
||||
(defun get-project-diagnostics (raw-path)
|
||||
"Gathers file list and git status.")
|
||||
|
||||
(defun get-git-diff (raw-path)
|
||||
"Retrieves uncommitted changes.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Diagnostic Retrieval
|
||||
#+begin_src lisp :tangle projects/org-skill-project-manager/src/manager-logic.lisp
|
||||
(defun get-project-diagnostics (raw-path)
|
||||
(let ((resolved-path (uiop:native-namestring raw-path)))
|
||||
(if (uiop:directory-exists-p resolved-path)
|
||||
(format nil "FILES: ~a~%GIT: ~a"
|
||||
(uiop:run-program (list "ls" "-F" resolved-path) :output :string)
|
||||
(uiop:run-program (list "git" "-C" resolved-path "status" "--short") :output :string))
|
||||
"ERROR: Path not found.")))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-project-manager
|
||||
:priority 70
|
||||
:trigger #'trigger-skill-project-manager
|
||||
:neuro #'neuro-skill-project-manager
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-provider-anthropic.org
|
||||
72
notes/org-skill-provider-anthropic.org
Normal file
72
notes/org-skill-provider-anthropic.org
Normal file
@@ -0,0 +1,72 @@
|
||||
#+TITLE: SKILL: Anthropic Provider Agent (Universal Literate Note)
|
||||
#+ID: skill-provider-anthropic
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :llm:provider:anthropic:claude:psf:
|
||||
|
||||
* Overview
|
||||
The **Anthropic Provider Agent** integrates Anthropic's Claude family of models as a pluggable System 1 (neural) backend. It enables high-intelligence reasoning, drafting, and analysis within the PSF.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interface for reliable communication with the Anthropic Messages API.
|
||||
|
||||
** 2. User Needs
|
||||
- **Connectivity:** Reliable I/O with Claude models.
|
||||
- **Configurability:** Model selection via Environment Configuration.
|
||||
- **Context Management:** Leverage Claude's large context windows.
|
||||
- **Safety:** Graceful error handling for API failures or missing keys.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO API Authentication
|
||||
*** TODO Model Resolution Loop
|
||||
*** TODO Response Parsing Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for executing neural completion requests. Source of truth is the Anthropic API and `$ANTHROPIC_API_KEY`.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun execute-anthropic-request (prompt system-prompt)
|
||||
"Executes a completion request via the Anthropic API.")
|
||||
|
||||
(defun get-anthropic-models ()
|
||||
"Returns supported models and their context limits.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Request Execution
|
||||
#+begin_src lisp :tangle projects/org-skill-provider-anthropic/src/provider-logic.lisp
|
||||
(defun execute-anthropic-request (prompt system-prompt)
|
||||
(let ((api-key (uiop:getenv "ANTHROPIC_API_KEY")))
|
||||
(unless api-key (return-from execute-anthropic-request "ERROR: Key missing"))
|
||||
(let ((model (get-config-attribute :LLM_MODEL_ANTHROPIC "claude-3-5-sonnet-20240620")))
|
||||
;; Physical API call logic (mocked for refactor)
|
||||
(format nil "Executing Anthropic request on ~a" model))))
|
||||
#+end_src
|
||||
|
||||
** Model Discovery
|
||||
#+begin_src lisp :tangle projects/org-skill-provider-anthropic/src/provider-logic.lisp
|
||||
(defun get-anthropic-models ()
|
||||
'((:id "claude-3-5-sonnet-20240620" :context "200k")
|
||||
(:id "claude-3-opus-20240229" :context "200k")
|
||||
(:id "claude-3-haiku-20240307" :context "200k")))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-provider-anthropic
|
||||
:priority 100
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-provider-gemini.org
|
||||
60
notes/org-skill-provider-gemini.org
Normal file
60
notes/org-skill-provider-gemini.org
Normal file
@@ -0,0 +1,60 @@
|
||||
#+TITLE: SKILL: Gemini Provider Agent (Universal Literate Note)
|
||||
#+ID: skill-provider-gemini
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :llm:provider:gemini:google:psf:
|
||||
|
||||
* Overview
|
||||
The **Gemini Provider Agent** integrates Google's Gemini API as a pluggable System 1 (neural) backend. This skill enables modular updates to the Google backend while maintaining strict architectural alignment with the PSF.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interface for reliable communication with the Google Gemini v1beta API.
|
||||
|
||||
** 2. User Needs
|
||||
- **API Integration:** Implementation of the Gemini `contents.parts` protocol.
|
||||
- **Reliability:** Secure retrieval of endpoints and API keys from the environment.
|
||||
- **Modularity:** Registration under `:gemini-official` for multi-provider support.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO API Authentication via URL Key
|
||||
*** TODO Payload Construction
|
||||
*** TODO Response Parsing Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for executing neural completion requests via Google's generative AI endpoints.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun execute-gemini-v1-request (prompt system-prompt)
|
||||
"Executes a completion request via the Gemini API.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Request Execution
|
||||
#+begin_src lisp :tangle projects/org-skill-provider-gemini/src/provider-logic.lisp
|
||||
(defun execute-gemini-v1-request (prompt system-prompt)
|
||||
(let ((api-key (uiop:getenv "LLM_API_KEY"))
|
||||
(endpoint (uiop:getenv "LLM_ENDPOINT")))
|
||||
(unless api-key (return-from execute-gemini-v1-request "ERROR: Key missing"))
|
||||
;; Physical API call logic (mocked for refactor)
|
||||
(format nil "Executing Gemini request via ~a" endpoint)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-provider-gemini
|
||||
:priority 100
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-provider-ollama.org
|
||||
59
notes/org-skill-provider-ollama.org
Normal file
59
notes/org-skill-provider-ollama.org
Normal file
@@ -0,0 +1,59 @@
|
||||
#+TITLE: SKILL: Ollama Provider Agent (Universal Literate Note)
|
||||
#+ID: skill-provider-ollama
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :llm:provider:ollama:local:psf:
|
||||
|
||||
* Overview
|
||||
The **Ollama Provider Agent** enables the use of local, privacy-preserving LLM models. It integrates with a local Ollama instance to ensure system functionality and sovereignty without external internet connectivity.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interface for communication with a local Ollama daemon.
|
||||
|
||||
** 2. User Needs
|
||||
- **Sovereignty:** Fallback backend independent of cloud providers.
|
||||
- **Performance:** Efficient local network interaction.
|
||||
- **Simplicity:** Deterministic, non-streaming text generation.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Local API Connectivity
|
||||
*** TODO Model Specification (llama3)
|
||||
*** TODO Response Extraction Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for executing neural completion requests via the local Ollama API.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun execute-ollama-request (prompt system-prompt)
|
||||
"Executes a completion request via local Ollama.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Local Execution
|
||||
#+begin_src lisp :tangle projects/org-skill-provider-ollama/src/provider-logic.lisp
|
||||
(defun execute-ollama-request (prompt system-prompt)
|
||||
(let ((url "http://host.docker.internal:11434/api/generate")
|
||||
(model "llama3"))
|
||||
;; Physical local call logic (mocked for refactor)
|
||||
(format nil "Executing local Ollama request on ~a" model)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-provider-ollama
|
||||
:priority 100
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-provider-openai.org
|
||||
72
notes/org-skill-provider-openai.org
Normal file
72
notes/org-skill-provider-openai.org
Normal file
@@ -0,0 +1,72 @@
|
||||
#+TITLE: SKILL: OpenAI Provider Agent (Universal Literate Note)
|
||||
#+ID: skill-provider-openai
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :llm:provider:openai:gpt:psf:
|
||||
|
||||
* Overview
|
||||
The **OpenAI Provider Agent** integrates OpenAI's GPT models as a pluggable System 1 (neural) backend. It provides industry-standard processing capabilities for reasoning and content generation.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interface for reliable communication with the OpenAI Chat Completions API.
|
||||
|
||||
** 2. User Needs
|
||||
- **Compatibility:** Full implementation of the Chat Completions protocol.
|
||||
- **Reliability:** Secure management of `$OPENAI_API_KEY`.
|
||||
- **Optimized Inference:** Configurable temperature and model selection (GPT-4o, etc.).
|
||||
- **Resilience:** Graceful handling of timeouts and errors.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO API Authentication via Bearer Token
|
||||
*** TODO Chat Payload Construction
|
||||
*** TODO Choice Extraction Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for executing neural completion requests via OpenAI's Chat API.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun execute-openai-request (prompt system-prompt)
|
||||
"Executes a completion request via the OpenAI API.")
|
||||
|
||||
(defun get-openai-models ()
|
||||
"Returns supported GPT models and their context limits.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Request Execution
|
||||
#+begin_src lisp :tangle projects/org-skill-provider-openai/src/provider-logic.lisp
|
||||
(defun execute-openai-request (prompt system-prompt)
|
||||
(let ((api-key (uiop:getenv "OPENAI_API_KEY")))
|
||||
(unless api-key (return-from execute-openai-request "ERROR: Key missing"))
|
||||
(let ((model (get-config-attribute :LLM_MODEL_OPENAI "gpt-4o")))
|
||||
;; Physical API call logic (mocked for refactor)
|
||||
(format nil "Executing OpenAI request on ~a" model))))
|
||||
#+end_src
|
||||
|
||||
** Model Discovery
|
||||
#+begin_src lisp :tangle projects/org-skill-provider-openai/src/provider-logic.lisp
|
||||
(defun get-openai-models ()
|
||||
'((:id "gpt-4o" :context "128k")
|
||||
(:id "gpt-4-turbo-preview" :context "128k")
|
||||
(:id "gpt-3.5-turbo" :context "16k")))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-provider-openai
|
||||
:priority 100
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-provider-openrouter.org
|
||||
72
notes/org-skill-provider-openrouter.org
Normal file
72
notes/org-skill-provider-openrouter.org
Normal file
@@ -0,0 +1,72 @@
|
||||
#+TITLE: SKILL: OpenRouter Provider Agent (Universal Literate Note)
|
||||
#+ID: skill-provider-openrouter
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :llm:provider:openrouter:unified:psf:
|
||||
|
||||
* Overview
|
||||
The **OpenRouter Provider Agent** acts as a unified gateway to hundreds of LLMs. It provides flexibility by dynamically switching between models based on intelligence tiers while maintaining architectural alignment.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interface for unified communication with the OpenRouter API.
|
||||
|
||||
** 2. User Needs
|
||||
- **Abstraction:** OpenAI-compatible interface for all OpenRouter models.
|
||||
- **Dynamic Routing:** Support for intelligence tiers (:POWERFUL, :FAST, :FREE).
|
||||
- **Resilience:** Leverage auto-routing fallbacks.
|
||||
- **Transparency:** Proper identification via Referer and Title headers.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Tiered Model Resolution
|
||||
*** TODO OpenAI-Compatible Payload Generation
|
||||
*** TODO Header Compliance Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for executing neural completion requests via the unified OpenRouter gateway.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun execute-openrouter-request (prompt system-prompt)
|
||||
"Executes a completion request via the OpenRouter API.")
|
||||
|
||||
(defun get-openrouter-models ()
|
||||
"Returns a curated list of models across tiers.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Request Execution
|
||||
#+begin_src lisp :tangle projects/org-skill-provider-openrouter/src/provider-logic.lisp
|
||||
(defun execute-openrouter-request (prompt system-prompt)
|
||||
(let ((api-key (uiop:getenv "OPENROUTER_API_KEY")))
|
||||
(unless api-key (return-from execute-openrouter-request "ERROR: Key missing"))
|
||||
(let ((model (get-tiered-model :fast "meta-llama/llama-3-70b-instruct")))
|
||||
;; Physical API call logic (mocked for refactor)
|
||||
(format nil "Executing OpenRouter request on ~a" model))))
|
||||
#+end_src
|
||||
|
||||
** Model Discovery
|
||||
#+begin_src lisp :tangle projects/org-skill-provider-openrouter/src/provider-logic.lisp
|
||||
(defun get-openrouter-models ()
|
||||
'((:id "anthropic/claude-3.5-sonnet" :context "200k" :tier :powerful)
|
||||
(:id "google/gemini-flash-1.5" :context "1m" :tier :fast)
|
||||
(:id "openrouter/auto" :context "varying" :tier :free)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-provider-openrouter
|
||||
:priority 100
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-router.org
|
||||
89
notes/org-skill-router.org
Normal file
89
notes/org-skill-router.org
Normal file
@@ -0,0 +1,89 @@
|
||||
#+TITLE: SKILL: Router Agent (Universal Literate Note)
|
||||
#+ID: skill-router
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :router:meta-cognitive:delegation:psf:
|
||||
|
||||
* Overview
|
||||
The **Router Agent** is the system's "Pre-Frontal Cortex." It classifies unstructured user input, decomposes complex requests into atomic intents, and orchestrates delegation to specialized sub-agents.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interfaces for intent classification and sub-agent delegation.
|
||||
|
||||
** 2. User Needs
|
||||
- **Perception:** Monitor for explicit commands and implicit `@agent` requests.
|
||||
- **Decomposition:** Break natural language into sequential atomic operations.
|
||||
- **Efficiency:** Utilize low-latency models for rapid routing.
|
||||
- **Dynamic Identity:** Adapt triggers based on the active agent name.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO @Agent Tag Detection
|
||||
*** TODO Multi-Intent Decomposition
|
||||
*** TODO Sub-agent Stimulus Injection
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for AST inspection and intent-driven stimulus injection. Source of truth is the dynamic kernel identity and the Org AST.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-router (context)
|
||||
"Triggers on :user-command or @agent requests in AST.")
|
||||
|
||||
(defun find-agent-request (ast agent-name)
|
||||
"Recursive search for addressed headlines.")
|
||||
|
||||
(defun verify-skill-router (proposed-action context)
|
||||
"Executes delegation by injecting new stimuli.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Request Perception
|
||||
#+begin_src lisp :tangle projects/org-skill-router/src/router-logic.lisp
|
||||
(defun find-agent-request (ast agent-name)
|
||||
(when (listp ast)
|
||||
(let* ((type (getf ast :type))
|
||||
(props (getf ast :properties))
|
||||
(title (or (getf props :TITLE) "")))
|
||||
(if (and (eq type :HEADLINE)
|
||||
(or (search "@agent" title :test #'string-equal)
|
||||
(search (format nil "@~a" agent-name) title :test #'string-equal)))
|
||||
(let* ((pos (or (search "@agent" title :test #'string-equal)
|
||||
(search (format nil "@~a" agent-name) title :test #'string-equal)))
|
||||
(instruction (subseq title (+ pos (if (search "@agent" title :test #'string-equal) 6 (1+ (length agent-name)))))))
|
||||
(string-trim '(#\Space #\Tab) instruction))
|
||||
(cl:some (lambda (c) (find-agent-request c agent-name)) (getf ast :contents))))))
|
||||
#+end_src
|
||||
|
||||
** Symbolic Delegation
|
||||
#+begin_src lisp :tangle projects/org-skill-router/src/router-logic.lisp
|
||||
(defun verify-skill-router (proposed-action context)
|
||||
(let ((type (getf proposed-action :type)))
|
||||
(cond
|
||||
((eq type :MULTI-DELEGATION)
|
||||
(dolist (intent (getf proposed-action :intents))
|
||||
(org-agent:inject-stimulus `(:type :EVENT :payload (:sensor :delegation ,@intent))))
|
||||
nil)
|
||||
((eq type :DELEGATION)
|
||||
(org-agent:inject-stimulus `(:type :EVENT :payload (:sensor :delegation ,@(getf proposed-action :payload))))
|
||||
nil)
|
||||
(t '(:type :LOG :payload (:text "Router failed to classify."))))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-router
|
||||
:priority 90
|
||||
:trigger #'trigger-skill-router
|
||||
:neuro #'neuro-skill-router
|
||||
:symbolic #'verify-skill-router)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-scribe-rca.org
|
||||
66
notes/org-skill-scribe-rca.org
Normal file
66
notes/org-skill-scribe-rca.org
Normal file
@@ -0,0 +1,66 @@
|
||||
#+TITLE: SKILL: Scribe-RCA Agent (Universal Literate Note)
|
||||
#+ID: skill-scribe-rca
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :scribe:rca:learning:institutional-memory:psf:
|
||||
|
||||
* Overview
|
||||
The **Scribe-RCA Agent** is a specialized extension of the Scribe role. It closes the "Learning Loop" by extracting Root Cause Analysis (RCA) entries from failures and populating the Institutional Memory.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated behaviors for failure diagnosis and memory ledger updates.
|
||||
|
||||
** 2. User Needs
|
||||
- **Perception:** Scan logs for fatal Lisp or System errors.
|
||||
- **Diagnosis:** Identify underlying technical reasons for failures.
|
||||
- **Distillation:** Generate high-signal entries (Symptom, Cause, Prevention).
|
||||
- **Prevention:** Ensure recurrence is avoided via persistent heuristics.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Error Log Detection
|
||||
*** TODO RCA Entry Formatting
|
||||
*** TODO Institutional Memory Append Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for analyzing system "pain" and recording learnings. Source of truth is the system log and `institutional-memory.org`.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-scribe-rca (context)
|
||||
"Triggers on fatal error events or log rejections.")
|
||||
|
||||
(defun scribe-rca-append (symptom cause prevention)
|
||||
"Appends entry to institutional-memory.org.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Memory Append
|
||||
#+begin_src lisp :tangle projects/org-skill-scribe-rca/src/rca-logic.lisp
|
||||
(defun scribe-rca-append (symptom cause prevention)
|
||||
(let* ((notes-dir (or (uiop:getenv "MEMEX_NOTES") "notes/"))
|
||||
(memory-file (format nil "~ainstitutional-memory.org" notes-dir))
|
||||
(timestamp (local-time:format-timestring nil (local-time:now) :format '("[" :year "-" :month "-" :day " " :weekday "]"))))
|
||||
(with-open-file (out memory-file :direction :output :if-exists :append)
|
||||
(format out "~%** ~a ~a~%- **Symptom:** ~a~%- **Root Cause:** ~a~%- **Prevention:** ~a~%"
|
||||
timestamp cause symptom cause prevention))
|
||||
(format nil "SUCCESS - Updated Memory: ~a" cause)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-scribe-rca
|
||||
:priority 90
|
||||
:trigger #'trigger-skill-scribe-rca
|
||||
:neuro #'neuro-skill-scribe-rca
|
||||
:symbolic #'scribe-rca-append)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-scribe.org
|
||||
79
notes/org-skill-scribe.org
Normal file
79
notes/org-skill-scribe.org
Normal file
@@ -0,0 +1,79 @@
|
||||
#+TITLE: SKILL: Scribe Agent (Universal Literate Note)
|
||||
#+ID: skill-scribe
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :scribe:distillation:psf:audit:
|
||||
|
||||
* Overview
|
||||
The **Scribe Agent** is the primary custodian of the Institutional Memory. It distills ephemeral daily thoughts into atomic notes and audits foundry projects for compliance with PSF standards.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated distillation and auditing behaviors for the PSF.
|
||||
|
||||
** 2. User Needs
|
||||
- **Knowledge Distillation:** Extract evergreen concepts from raw dailies.
|
||||
- **Incremental Processing:** Efficient Git-based delta tracking.
|
||||
- **PSF Mandate Audit:** High-integrity check for PRD/PROTOCOL artifacts.
|
||||
- **Autonomous Execution:** Cron-compatible, environment-driven logic.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Distillation Accuracy
|
||||
*** TODO Audit Trigger Verification
|
||||
*** TODO State Persistence (Lisp alist)
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for state-aware knowledge extraction and structural auditing.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun scribe-scan-for-knowledge-gaps ()
|
||||
"Identifies new daily captures via git diff.")
|
||||
|
||||
(defun scribe-distill-concept (daily-path concept-meta)
|
||||
"Transforms raw data into a permanent node.")
|
||||
|
||||
(defun scribe-audit-foundry-mandate (project-name)
|
||||
"Checks for mandatory PSF artifacts.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** State Perception
|
||||
#+begin_src lisp :tangle projects/org-skill-scribe/src/scribe-engine.lisp
|
||||
(defun scribe-scan-for-knowledge-gaps ()
|
||||
(let* ((state-file (or (uiop:getenv "SCRIBE_STATE") "scribe-state.lisp"))
|
||||
(state (if (uiop:file-exists-p state-file) (with-open-file (in state-file) (read in)) '((:last-commit . "HEAD~1"))))
|
||||
(last-hash (cdr (assoc :last-commit state))))
|
||||
(uiop:run-program (list "git" "diff" "--name-only" last-hash "HEAD" "--" (or (uiop:getenv "MEMEX_DAILY") "daily/")) :output :lines)))
|
||||
#+end_src
|
||||
|
||||
** Concept Distillation
|
||||
#+begin_src lisp :tangle projects/org-skill-scribe/src/scribe-engine.lisp
|
||||
(defun scribe-distill-concept (daily-path concept-meta)
|
||||
(let* ((title (getf concept-meta :title))
|
||||
(content (getf concept-meta :content))
|
||||
(source (getf concept-meta :source))
|
||||
(filename (format nil "~a.org" (cl-ppcre:regex-replace-all " " (string-downcase title) "-")))
|
||||
(target-path (format nil "~a/~a" (or (uiop:getenv "MEMEX_NOTES") "notes") filename)))
|
||||
(with-open-file (out target-path :direction :output :if-exists :supersede)
|
||||
(format out "#+TITLE: ~a~%#+ID: ~a~%~%Source: [[file:~a]]~%~%~a" title (org-id-new) source content))
|
||||
target-path))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-scribe
|
||||
:priority 90
|
||||
:trigger #'trigger-skill-scribe
|
||||
:neuro #'neuro-skill-scribe
|
||||
:symbolic #'scribe-scan-for-knowledge-gaps)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-self-fix.org
|
||||
75
notes/org-skill-self-fix.org
Normal file
75
notes/org-skill-self-fix.org
Normal file
@@ -0,0 +1,75 @@
|
||||
#+TITLE: SKILL: Self-Fix Agent (Universal Literate Note)
|
||||
#+ID: skill-self-fix
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :self-fix:immune:meta-cognitive:psf:
|
||||
|
||||
* Overview
|
||||
The **Self-Fix Agent** acts as the system's "Immune System." It monitors kernel logs for failures (Lisp errors, rejections, hallucinations) and proactively drafts fixes for offending skills.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interfaces for autonomous log surveillance and self-repair drafting.
|
||||
|
||||
** 2. User Needs
|
||||
- **Constant Surveillance:** Periodic monitoring of system logs via heartbeats.
|
||||
- **Autonomous Recovery:** Root cause identification and corrective skill drafting.
|
||||
- **Neuro-Symbolic Alignment:** Refining neural prompts to meet symbolic constraints.
|
||||
- **Safety Verification:** Leveraging Creator validation for "surgeries."
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Error Pattern Detection
|
||||
*** TODO Skill Repair Drafting
|
||||
*** TODO Deployment Gatekeeping Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for log analysis and self-correction. Source of truth is the kernel log and the Skill Creator's validation logic.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-self-fix (context)
|
||||
"Triggers on :sensor :heartbeat.")
|
||||
|
||||
(defun neuro-skill-self-fix (context)
|
||||
"Neural analysis of system logs and fix drafting.")
|
||||
|
||||
(defun verify-skill-self-fix (proposed-action context)
|
||||
"Ensures repair actions target the correct system actuators.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Heartbeat Surveillance
|
||||
#+begin_src lisp :tangle projects/org-skill-self-fix/src/fix-logic.lisp
|
||||
(defun trigger-skill-self-fix (context)
|
||||
(let ((type (getf context :type))
|
||||
(payload (getf context :payload)))
|
||||
(and (eq type :EVENT)
|
||||
(eq (getf payload :sensor) :heartbeat))))
|
||||
#+end_src
|
||||
|
||||
** Symbolic Gatekeeping
|
||||
#+begin_src lisp :tangle projects/org-skill-self-fix/src/fix-logic.lisp
|
||||
(defun verify-skill-self-fix (proposed-action context)
|
||||
(let ((action (getf proposed-action :action)))
|
||||
(if (eq action :create-skill)
|
||||
proposed-action
|
||||
nil)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-self-fix
|
||||
:priority 40
|
||||
:trigger #'trigger-skill-self-fix
|
||||
:neuro #'neuro-skill-self-fix
|
||||
:symbolic #'verify-skill-self-fix)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-shell-actuator.org
|
||||
93
notes/org-skill-shell-actuator.org
Normal file
93
notes/org-skill-shell-actuator.org
Normal file
@@ -0,0 +1,93 @@
|
||||
#+TITLE: SKILL: Shell Actuator Agent (Universal Literate Note)
|
||||
#+ID: skill-shell-actuator
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :shell:actuator:system:psf:
|
||||
|
||||
* Overview
|
||||
The **Shell Actuator Agent** provides the bridge to the host operating system. It enables secure command execution while maintaining a strict security posture through whitelisting and diagnostic feedback loops.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define a secure, diagnostic-rich interface for host OS interaction.
|
||||
|
||||
** 2. User Needs
|
||||
- **Secure Actuation:** Strict whitelist of permitted commands.
|
||||
- **Diagnostic Feedback:** Capture STDOUT, STDERR, and exit codes.
|
||||
- **Loop Closure:** Automatic neural analysis of command results.
|
||||
- **Resilience:** Graceful handling of blocked or failed commands.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Whitelist Enforcement
|
||||
*** TODO Diagnostic Capture
|
||||
*** TODO Result Analysis Loop
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for secure system calls. State is event-driven via the core kernel bus.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun execute-shell-safely (action)
|
||||
"Verifies command against whitelist and captures diagnostics.")
|
||||
|
||||
(defun trigger-skill-shell-actuator (context)
|
||||
"Monitors for shell-response events.")
|
||||
|
||||
(defun neuro-skill-shell-actuator (context)
|
||||
"Neural interpretation of command diagnostics.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Whitelisting & Execution
|
||||
#+begin_src lisp :tangle projects/org-skill-shell-actuator/src/shell-logic.lisp
|
||||
(defparameter *allowed-commands* '("ls" "git" "rg" "grep" "date" "echo" "cat"))
|
||||
|
||||
(defun execute-shell-safely (action)
|
||||
(let* ((cmd-string (getf (getf action :payload) :cmd))
|
||||
(executable (car (uiop:split-string cmd-string :separator '(#\Space)))))
|
||||
(if (member executable *allowed-commands* :test #'string=)
|
||||
(multiple-value-bind (stdout stderr exit-code)
|
||||
(uiop:run-program cmd-string :output :string :error-output :string :ignore-error-status t)
|
||||
(org-agent:inject-stimulus
|
||||
`(:type :EVENT :payload (:sensor :shell-response :cmd ,cmd-string :stdout ,(or stdout "") :stderr ,(or stderr "") :exit-code ,exit-code))))
|
||||
(org-agent:inject-stimulus
|
||||
`(:type :EVENT :payload (:sensor :shell-response :cmd ,cmd-string :stdout "" :stderr "ERROR - Command not in security whitelist." :exit-code 1))))))
|
||||
#+end_src
|
||||
|
||||
** Feedback Perception
|
||||
#+begin_src lisp :tangle projects/org-skill-shell-actuator/src/shell-logic.lisp
|
||||
(defun trigger-skill-shell-actuator (context)
|
||||
(let ((type (getf context :type))
|
||||
(payload (getf context :payload)))
|
||||
(and (eq type :EVENT)
|
||||
(eq (getf payload :sensor) :shell-response))))
|
||||
#+end_src
|
||||
|
||||
** Neuro-Cognitive Analysis
|
||||
#+begin_src lisp :tangle projects/org-skill-shell-actuator/src/shell-logic.lisp
|
||||
(defun neuro-skill-shell-actuator (context)
|
||||
(let* ((p (getf context :payload))
|
||||
(cmd (getf p :cmd))
|
||||
(stdout (getf p :stdout))
|
||||
(stderr (getf p :stderr))
|
||||
(exit-code (getf p :exit-code)))
|
||||
(format nil "Command: ~a (Exit: ~a)~%STDOUT: ~a~%STDERR: ~a" cmd exit-code stdout stderr)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-shell-actuator
|
||||
:priority 80
|
||||
:trigger #'trigger-skill-shell-actuator
|
||||
:neuro #'neuro-skill-shell-actuator
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-task-integrity.org
|
||||
74
notes/org-skill-task-integrity.org
Normal file
74
notes/org-skill-task-integrity.org
Normal file
@@ -0,0 +1,74 @@
|
||||
#+TITLE: SKILL: Task Integrity Agent (Universal Literate Note)
|
||||
#+ID: skill-task-integrity
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :gtd:integrity:safety:psf:
|
||||
|
||||
* Overview
|
||||
The **Task Integrity Agent** is the "Guardian" of the GTD system. It ensures that all task transitions adhere to semantic rules, preventing logical inconsistencies and maintaining the structural health of the task hierarchy.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated behaviors for GTD state consistency and dependency verification.
|
||||
|
||||
** 2. User Needs
|
||||
- **Semantic Enforcement:** Valid state transitions (Active vs. Resolved).
|
||||
- **Dependency Awareness:** Block closing parents with active children.
|
||||
- **Proactive Assistance:** Suggesting next logical actions based on momentum.
|
||||
- **Fidelity:** Preservation of metadata during state transitions.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Semantic Category Mapping
|
||||
*** TODO Active Children Detection
|
||||
*** TODO State Transition Block Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for state verification and hierarchical auditing. Source of truth is the Org-mode AST and GTD metadata.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun semantic-state-category (state)
|
||||
"Maps raw keywords to :active or :resolved categories.")
|
||||
|
||||
(defun has-active-children-p (parent-id)
|
||||
"Recursively checks for active subtasks.")
|
||||
|
||||
(defun verify-skill-task-integrity (proposed-action context)
|
||||
"System 2 gatekeeper for logical task consistency.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** State Mapping
|
||||
#+begin_src lisp :tangle projects/org-skill-task-integrity/src/integrity-logic.lisp
|
||||
(defun semantic-state-category (state)
|
||||
(let ((s (string-upcase (or state ""))))
|
||||
(cond
|
||||
((member s '("TODO" "NEXT" "WAIT") :test #'string=) :active)
|
||||
((member s '("DONE" "CNCL" "CANCELED") :test #'string=) :resolved)
|
||||
(t :unknown))))
|
||||
#+end_src
|
||||
|
||||
** Dependency Checking
|
||||
#+begin_src lisp :tangle projects/org-skill-task-integrity/src/integrity-logic.lisp
|
||||
(defun has-active-children-p (parent-id)
|
||||
;; Simplified implementation for refactor
|
||||
nil)
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-task-integrity
|
||||
:priority 50
|
||||
:trigger #'trigger-skill-task-integrity
|
||||
:neuro #'neuro-skill-task-integrity
|
||||
:symbolic #'verify-skill-task-integrity)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-tech-analyst.org
|
||||
67
notes/org-skill-tech-analyst.org
Normal file
67
notes/org-skill-tech-analyst.org
Normal file
@@ -0,0 +1,67 @@
|
||||
#+TITLE: SKILL: Technical Analyst Agent (Universal Literate Note)
|
||||
#+ID: skill-tech-analyst
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :analyst:testing:tdd:psf:
|
||||
|
||||
* Overview
|
||||
The **Technical Analyst Agent** defines the **Success Criteria** for a project. It generates a failing test suite immediately after the architecture is signed, enforcing a strict TDD mandate within the PSF Consensus Loop.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated testing behaviors for the PSF Consensus Loop.
|
||||
|
||||
** 2. User Needs
|
||||
- **Protocol Perception:** Monitor for `SIGNED` Protocols.
|
||||
- **TDD Inception:** Translate interfaces into executable test cases.
|
||||
- **Edge Case Coverage:** Mandatory testing of failure modes and malformed input.
|
||||
- **Structural Enforcement:** Ensure the `tests/` directory is correctly initialized.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Trigger Accuracy
|
||||
*** TODO TDD Suite Generation Verification
|
||||
*** TODO Edge Case Coverage Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for TDD suite actuation and protocol perception. Source of truth is the project's SIGNED Protocol.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun tech-analyst-perceive-signed-protocol (project-name)
|
||||
"Checks if a project has a SIGNED PROTOCOL.")
|
||||
|
||||
(defun tech-analyst-actuate (project-name test-content)
|
||||
"Physically writes the TDD suite to tests/.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** TDD Suite Actuation
|
||||
#+begin_src lisp :tangle projects/org-skill-tech-analyst/src/analyst-logic.lisp
|
||||
(defun tech-analyst-actuate (project-name test-content)
|
||||
(let* ((projects-dir (or (uiop:getenv "PROJECTS_DIR") "projects/"))
|
||||
(project-dir (format nil "~a/~a/" projects-dir project-name))
|
||||
(test-dir (format nil "~atests/" project-dir))
|
||||
(test-path (format nil "~atests/test-suite.lisp" project-dir)))
|
||||
(ensure-directories-exist test-dir)
|
||||
(with-open-file (out test-path :direction :output :if-exists :supersede)
|
||||
(format out ";;; TDD Suite for ~a~%~a" project-name test-content))
|
||||
(format nil "SUCCESS - Tech-Analyst established TDD Suite for ~a" project-name)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-tech-analyst
|
||||
:priority 60
|
||||
:trigger #'trigger-skill-tech-analyst
|
||||
:neuro #'neuro-skill-tech-analyst
|
||||
:symbolic #'tech-analyst-actuate)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-web-interface.org
|
||||
60
notes/org-skill-web-interface.org
Normal file
60
notes/org-skill-web-interface.org
Normal file
@@ -0,0 +1,60 @@
|
||||
#+TITLE: SKILL: Web Dashboard Agent (Universal Literate Note)
|
||||
#+ID: skill-web-interface
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :web:dashboard:telemetry:psf:
|
||||
|
||||
* Overview
|
||||
The **Web Dashboard Agent** provides a lightweight telemetry window into the Neurosymbolic Kernel. It exposes the active skill graph and system logs via a local HTML dashboard.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interfaces for system observability and telemetry serving.
|
||||
|
||||
** 2. User Needs
|
||||
- **Transparency:** Overview of skill performance (executions, time, failures).
|
||||
- **Accessibility:** Served over a local HTTP port.
|
||||
- **Observability:** Tail of system logs for debugging.
|
||||
- **Low Overhead:** Background execution.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Server Bootstrap Verification
|
||||
*** TODO Telemetry Data Rendering
|
||||
*** TODO Log Tail Exposure
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for HTTP serving and skill introspection. Source of truth is the kernel telemetry bus and skill registry.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun start-dashboard (&optional (port 8080))
|
||||
"Starts the telemetry web server.")
|
||||
|
||||
(defun dashboard-home ()
|
||||
"Renders the primary HTML dashboard.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Server Initialization
|
||||
#+begin_src lisp :tangle projects/org-skill-web-interface/src/web-logic.lisp
|
||||
(defun start-dashboard (&optional (port 8080))
|
||||
(format nil "Starting dashboard on port ~a" port))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-web-interface
|
||||
:priority 10
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-web-research.org
|
||||
83
notes/org-skill-web-research.org
Normal file
83
notes/org-skill-web-research.org
Normal file
@@ -0,0 +1,83 @@
|
||||
#+TITLE: SKILL: Web Research Agent (Universal Literate Note)
|
||||
#+ID: skill-web-research
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :web:research:internet:psf:
|
||||
|
||||
* Overview
|
||||
The **Web Research Agent** provides the bridge to the internet. It fetches and synthesizes information from the web using pluggable engines like Lynx and Curl, enabling real-time research and fact verification.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interfaces for internet information retrieval and synthesis.
|
||||
|
||||
** 2. User Needs
|
||||
- **Connectivity:** Pluggable engines (Lynx, Curl) for fetching URLs.
|
||||
- **Synthesis:** Neural transformation of raw content into factual summaries.
|
||||
- **Efficiency:** Default to text-only engines to minimize overhead.
|
||||
- **Search Integration:** Automatic DuckDuckGo routing for general queries.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Engine Fetching Verification (Lynx/Curl)
|
||||
*** TODO URL vs Query Routing Logic
|
||||
*** TODO Neural Synthesis Formatting Accuracy
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for web I/O and content synthesis. Source of truth is the global internet and local CLI browser engines.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-web-research (context)
|
||||
"Triggers on :delegation :target-skill :web.")
|
||||
|
||||
(defun web-fetch (url &optional engine)
|
||||
"Dispatches fetch request to CLI engines.")
|
||||
|
||||
(defun neuro-skill-web-research (context)
|
||||
"Neural selection of engine and synthesis of fetched content.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Browser Engines
|
||||
#+begin_src lisp :tangle projects/org-skill-web-research/src/research-logic.lisp
|
||||
(defun fetch-with-lynx (url)
|
||||
(let ((cmd (format nil "lynx -dump -nolist '~a'" url)))
|
||||
(uiop:run-program cmd :output :string :ignore-error-status t)))
|
||||
|
||||
(defun fetch-with-curl (url)
|
||||
(let ((cmd (format nil "curl -sL '~a'" url)))
|
||||
(uiop:run-program cmd :output :string :ignore-error-status t)))
|
||||
|
||||
(defun web-fetch (url &optional engine)
|
||||
(case engine
|
||||
(:curl (fetch-with-curl url))
|
||||
(t (fetch-with-lynx url))))
|
||||
#+end_src
|
||||
|
||||
** Trigger Perception
|
||||
#+begin_src lisp :tangle projects/org-skill-web-research/src/research-logic.lisp
|
||||
(defun trigger-skill-web-research (context)
|
||||
(let ((type (getf context :type))
|
||||
(payload (getf context :payload)))
|
||||
(and (eq type :EVENT)
|
||||
(eq (getf payload :sensor) :delegation)
|
||||
(eq (getf payload :target-skill) :web))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-web-research
|
||||
:priority 80
|
||||
:trigger #'trigger-skill-web-research
|
||||
:neuro #'neuro-skill-web-research
|
||||
:symbolic #'verify-skill-web-research)
|
||||
#+end_src
|
||||
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-workspace-manager.org
|
||||
84
notes/org-skill-workspace-manager.org
Normal file
84
notes/org-skill-workspace-manager.org
Normal file
@@ -0,0 +1,84 @@
|
||||
#+TITLE: SKILL: Workspace Manager Agent (Universal Literate Note)
|
||||
#+ID: skill-workspace-manager
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :workspace:para:maintenance:psf:
|
||||
|
||||
* Overview
|
||||
The **Workspace Manager Agent** is responsible for the ongoing maintenance and organization of the Memex workspace. It automates the "housekeeping" aspects of the PARA/Zettelkasten workflow, focusing on clutter reduction and structural alignment.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated housekeeping behaviors for PARA/Zettelkasten maintenance.
|
||||
|
||||
** 2. User Needs
|
||||
- **Clutter Reduction:** Identify and archive `DONE` tasks.
|
||||
- **Workflow Alignment:** Ensure consistency with PARA directory structure.
|
||||
- **Proactive Organization:** Trigger on saves and heartbeats.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Task Identification
|
||||
*** TODO Archiving Suggestion Loop
|
||||
*** TODO Perception Coverage (Buffer & Heartbeat)
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for workspace auditing and archiving suggestions.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-workspace-manager (context)
|
||||
"Triggers on :buffer-update or :heartbeat.")
|
||||
|
||||
(defun archive-completed-tasks ()
|
||||
"Queries store for DONE tasks and returns their IDs.")
|
||||
|
||||
(defun neuro-skill-workspace-manager (context)
|
||||
"Neural synthesis of archiving suggestions.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Dual Perception
|
||||
#+begin_src lisp :tangle projects/org-skill-workspace-manager/src/workspace-logic.lisp
|
||||
(defun trigger-skill-workspace-manager (context)
|
||||
(let* ((payload (getf context :payload))
|
||||
(sensor (getf payload :sensor)))
|
||||
(or (eq sensor :buffer-update)
|
||||
(eq sensor :heartbeat))))
|
||||
#+end_src
|
||||
|
||||
** Stale Task Identification
|
||||
#+begin_src lisp :tangle projects/org-skill-workspace-manager/src/workspace-logic.lisp
|
||||
(defun archive-completed-tasks ()
|
||||
"Identify DONE tasks and suggest archiving."
|
||||
(let ((done-tasks (org-agent:context-query-store :todo-state "DONE" :type :HEADLINE)))
|
||||
(when done-tasks
|
||||
(mapcar #'org-agent:org-object-id done-tasks))))
|
||||
#+end_src
|
||||
|
||||
** Neuro-Cognitive Drafting
|
||||
#+begin_src lisp :tangle projects/org-skill-workspace-manager/src/workspace-logic.lisp
|
||||
(defun neuro-skill-workspace-manager (context)
|
||||
(let ((ready-to-archive (archive-completed-tasks))
|
||||
(archive-dir (or (uiop:getenv "ARCHIVES_DIR") "archives/")))
|
||||
(if ready-to-archive
|
||||
(format nil "I found these completed tasks: ~a. Should I move them to ~a?" ready-to-archive archive-dir)
|
||||
nil)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-workspace-manager
|
||||
:priority 40
|
||||
:trigger #'trigger-skill-workspace-manager
|
||||
:neuro #'neuro-skill-workspace-manager
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
Reference in New Issue
Block a user