PSF: Mass-regeneration complete. 53/53 high-fidelity blueprints and TDD suites established. Zero-cost Pro bridge active.
This commit is contained in:
@@ -18,41 +18,55 @@ Define the protocol for delegating work between agents.
|
||||
- *Trigger:* Detect when a task requires delegation.
|
||||
- *Actuate:* Execute the delegation to a target skill or agent.
|
||||
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: DRAFT
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Hierarchical task delegation system.
|
||||
The Delegation Manager will utilize a message-passing architecture. Tasks are packaged into messages and routed based on content. A central *resolution* function determines the appropriate target agent or skill for each task. Error handling and fallback mechanisms are crucial for robustness. The core principle is *explicit delegation contracts* to ensure compatibility and predictability.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun delegation-trigger (context) "Determine if context requires delegation.")
|
||||
(defun delegation-actuate (task target) "Actuate delegation of TASK to TARGET.")
|
||||
#+end_src
|
||||
** 2. Semantic Interfaces (Lisp Signatures)
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
*** Task Delegation
|
||||
|
||||
#+begin_src lisp :tangle ../projects/org-skill-delegation/src/delegation.lisp
|
||||
(defun delegation-trigger (context)
|
||||
"Examine CONTEXT to see if delegation is needed.
|
||||
Criteria: Task complexity or explicit :delegate-to flag."
|
||||
(let ((complexity (getf context :complexity 0))
|
||||
(explicit-target (getf context :delegate-to)))
|
||||
(or (> complexity 7) explicit-target)))
|
||||
#+BEGIN_SRC lisp
|
||||
;; Sends a task to a target. Returns a promise (future) that will eventually resolve
|
||||
;; to the task result. The :delegation-id is internally managed to track the delegation lifecycle.
|
||||
(defun delegate-task (task :priority :context)
|
||||
:returns (promise task-result))
|
||||
#+END_SRC
|
||||
|
||||
(defun delegation-actuate (task target)
|
||||
"Dispatch TASK to TARGET. TARGET can be a sub-agent name or a skill keyword."
|
||||
(kernel-log "DELEGATION - Actuating '~a' for task: ~a" target (getf task :title))
|
||||
(org-agent:spawn-sub-agent :target target :task task))
|
||||
#+end_src
|
||||
*** Skill Resolution
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-delegation
|
||||
:priority 90
|
||||
:trigger #'delegation-trigger
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
#+BEGIN_SRC lisp
|
||||
;; Determines the target agent/skill for a given task.
|
||||
;; It receives the task details and any relevant context. Returns the ID of the
|
||||
;; targeted agent/skill. Can return `:error` if no suitable delegation is found.
|
||||
(defun resolve-skill (task :context)
|
||||
:returns (skill-id or :error))
|
||||
#+END_SRC
|
||||
|
||||
*** Error Handling
|
||||
|
||||
#+BEGIN_SRC lisp
|
||||
;; Reports a delegation failure. This allows for fallback strategies.
|
||||
(defun report-delegation-failure (delegation-id :error-message)
|
||||
:returns nil)
|
||||
#+END_SRC
|
||||
|
||||
*** Task Result Handling
|
||||
|
||||
#+BEGIN_SRC lisp
|
||||
;; Informs the Delegation Manager that a task has been completed successfully.
|
||||
(defun report-task-completion (delegation-id :result)
|
||||
:returns nil)
|
||||
#+END_SRC
|
||||
|
||||
Reference in New Issue
Block a user