PSF: Complete 'Thin Harness' refactor and move kernel logic to skills
This commit is contained in:
16
src/task-integrity.lisp
Normal file
16
src/task-integrity.lisp
Normal file
@@ -0,0 +1,16 @@
|
||||
(in-package :org-agent)
|
||||
|
||||
(defun semantic-mapping (task-state)
|
||||
"Maps Org-mode task states to semantic categories."
|
||||
(case (intern (string-upcase task-state) :keyword)
|
||||
((:todo :active :started :wait) :active)
|
||||
((:done :cancelled :resolved) :resolved)
|
||||
(t :unknown)))
|
||||
|
||||
(defun detect-active-children (task-id)
|
||||
"Checks if a task has any child tasks in an active state."
|
||||
(let ((children (list-objects-with-attribute :PARENT task-id)))
|
||||
(remove-if-not (lambda (child)
|
||||
(let ((todo (getf (org-object-attributes child) :TODO)))
|
||||
(and todo (eq (semantic-mapping todo) :active))))
|
||||
children)))
|
||||
Reference in New Issue
Block a user