PSF: Mass-regeneration complete. 53/53 high-fidelity blueprints and TDD suites established. Zero-cost Pro bridge active.
This commit is contained in:
@@ -24,42 +24,37 @@ Define the interfaces for asynchronous external message enqueuing.
|
||||
*** TODO Channel-specific ID Resolution
|
||||
*** TODO Org Timestamp Formatting Accuracy
|
||||
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: DRAFT
|
||||
: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.")
|
||||
The *Org-Native Delivery Agent* will function as a *stateless* message queuing system. It receives message envelopes as Lisp data structures, persists them to a designated Org-mode file (`delivery.org`), and returns upon successful enqueuing. External bridge processes are responsible for consuming messages from `delivery.org` and handling delivery to specific channels. This decoupling ensures resilience and scalability. We favor simplicity and robustness over complex routing logic *within* the Agent itself. The Org file acts as a source of truth for queued messages, enabling auditing and recovery.
|
||||
|
||||
(defun format-universal-time-org (ut)
|
||||
"Formats time for Org-mode properties.")
|
||||
#+end_src
|
||||
** 2. Semantic Interfaces (Lisp Signatures)
|
||||
|
||||
* 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
|
||||
#+BEGIN_SRC lisp
|
||||
;;; Signature: `org-delivery-enqueue'
|
||||
;;;
|
||||
;;; Enqueues a message for delivery.
|
||||
;;;
|
||||
;;; Arguments:
|
||||
;;; `recipient-id`: Channel-specific identifier (e.g., Signal number, Telegram chat ID). STRING.
|
||||
;;; `channel`: Keyword indicating the target channel. SYMBOL (one of: :signal, :telegram, :discord, ...).
|
||||
;;; `message-body`: The content of the message. STRING. Can contain Org-mode markup.
|
||||
;;; `properties`: A plist of additional metadata. LIST (plist).
|
||||
;;;
|
||||
;;; Returns: A plist containing `:status :success` or `:status :failure` with an optional `:error-message`.
|
||||
;;; Upon success: returns a message id.
|
||||
;;; Upon failure: returns `:error-message`.
|
||||
;;;
|
||||
(defun org-delivery-enqueue (recipient-id channel message-body &optional properties)
|
||||
|
||||
Reference in New Issue
Block a user