ENH remove deadline from epg buffer status

This commit is contained in:
Nathan Dwarshuis 2022-04-20 00:17:39 -04:00
parent 0cf3695f06
commit be46904cc3
1 changed files with 16 additions and 34 deletions

View File

@ -898,33 +898,18 @@ used for optimization."
((-some->> it-planning (org-ml-get-property :scheduled)) ((-some->> it-planning (org-ml-get-property :scheduled))
(either :left "EPGs cannot be scheduled")) (either :left "EPGs cannot be scheduled"))
((equal it-todo org-x-kw-todo) ((equal it-todo org-x-kw-todo)
(let ((dead (-some->> it-planning (org-ml-get-property :deadline)))) (org-x-dag-bs-fold-children child-bss `(:active)
(org-x-dag-bs-fold-children child-bss `(:active ,dead) (->> (pcase `(,acc ,it)
(->> (pcase `(,acc ,it) (`((:active) (:active)) nil)
(`((:active ,_) (:active ,_)) nil) (`(,_ (:active)) t)
(`(,_ (:active ,_)) t) (`((:active) ,_) nil))
(`((:active ,_) ,_) nil)) (either :right))
(either :right)) nil
nil (pcase it
(pcase it ('(:active)
(`(:active ,c-dead) (either :right '(:active)))
;; TODO I might want to enforce the same precision here like I do (_
;; for iterators (either :left "Active EPGs must have at least one active child")))))
(let ((c-epoch (-some->> c-dead
(org-ml-timestamp-get-start-time)
(org-ml-time-to-unixtime)))
(p-epoch (-some->> dead
(org-ml-timestamp-get-start-time)
(org-ml-time-to-unixtime))))
(cond
((and c-epoch p-epoch (<= c-epoch p-epoch))
(either :right `(:active ,dead)))
((not dead)
(either :right `(:active ,c-dead)))
(t
(either :left "Child deadlines must be before parent deadlines")))))
(_
(either :left "Active EPGs must have at least one active child"))))))
(t (t
(org-x-dag-bs-error-kw "Endpoint goal" it-todo))))) (org-x-dag-bs-error-kw "Endpoint goal" it-todo)))))
@ -2564,8 +2549,8 @@ FUTURE-LIMIT in a list."
(-let (((&plist :planned p :fulfilled f) (-let (((&plist :planned p :fulfilled f)
(either-from-right ns nil))) (either-from-right ns nil)))
(mk-item it :lifetime p f nil)))) (mk-item it :lifetime p f nil))))
;; TODO not sure how I want to handle deadlines yet here ;; TODO need to grab deadlines from the network status (when done)
(`(:endpoint :active ,_) (`(:endpoint :active)
(-when-let (ns (org-x-dag-id->ns it)) (-when-let (ns (org-x-dag-id->ns it))
(-let (((&plist :planned p :fulfilled f :committed c) (-let (((&plist :planned p :fulfilled f :committed c)
(either-from-right ns nil))) (either-from-right ns nil)))
@ -3736,11 +3721,8 @@ FUTURE-LIMIT in a list."
(format-comptime "task" comptime)) (format-comptime "task" comptime))
(`(:sp-task :task-active ,_) (`(:sp-task :task-active ,_)
"Active Task") "Active Task")
(`(:endpoint :active ,dead) (`(:endpoint :active)
(->> (if dead (->> (org-ml-to-trimmed-string dead) "Active Endpoint Goal")
(format "deadline: %s"))
"no deadline")
(format "Active with %s")))
(`(:sp-iter :iter-active ,_) (`(:sp-iter :iter-active ,_)
"Active Iterator") "Active Iterator")
(`(:sp-iter :iter-empty) (`(:sp-iter :iter-empty)