feat: stabilized org-agent two-way communication and UX

- Fixed kernel-to-Emacs communication bridge.
- Resolved boot-time crashes in multiple skeletal skills.
- Refined Chat skill prompt to eliminate conversational filler.
- Updated Emacs UI to automatically clean up status markers.
- Synchronized all fixes via Literate Org-mode documents.
- Verified physical two-way interaction via simulation.
This commit is contained in:
2026-04-03 17:25:01 -04:00
parent 93f9ccee17
commit fdb55c616d
30 changed files with 654 additions and 100 deletions

View File

@@ -44,24 +44,36 @@ Interfaces for TCP I/O and protocol framing. Source of truth is the OACP specifi
* Phase D: Build (Implementation)
** TCP Sensory Layer
#+begin_src lisp :tangle projects/org-skill-emacs-bridge/src/bridge-logic.lisp
#+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
#+begin_src lisp :tangle ../projects/org-skill-emacs-bridge/src/bridge-logic.lisp
(defun stream-to-emacs (stream action-plist)
"Streams a chunk of data to a specific Emacs client over OACP."
(let ((msg (prin1-to-string action-plist)))
(format stream "~a" msg)
(force-output stream)))
"Streams a chunk of data to a specific Emacs client over OACP using framing."
(let* (;; Ensure the message is wrapped in a :request envelope if it's just an action
(envelope (if (getf action-plist :type)
action-plist
(list :type :request
:id (get-universal-time)
:target (getf action-plist :target)
:payload (getf action-plist :payload))))
(msg (prin1-to-string envelope))
(len (length msg))
(framed (format nil "~6,'0x~a" len msg)))
(write-string (string-downcase framed) stream)
(finish-output stream)))
(defun broadcast-to-emacs (action-plist)
"Sends a framed message to all connected clients."
(let ((msg (prin1-to-string action-plist)))
(kernel-log "Broadcasting OACP: ~a" msg)))
(defun broadcast-to-emacs (action-plist context)
"Sends a framed message back to the client that sent the stimulus."
(let ((stream (getf context :reply-stream)))
(if stream
(handler-case (stream-to-emacs stream action-plist)
(error (c) (kernel-log "BRIDGE ERROR: Failed to write to Emacs: ~a" c)))
(kernel-log "BRIDGE ERROR: No reply-stream in context."))))
#+end_src
* Registration