Files
memex/projects/org-skill-delegation/src/delegation.lisp

12 lines
559 B
Common 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)))
(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))