Taskwarrior virtual tag logic
23 Mar 2021 | all notes
Information about this is a bit scattered in the Taskwarrior docs, but the two main sources are:
The information below is what I figured out by trial and error (using taskwarrior 2.5.3).
Mandatory virtual tag sets
Task status
The following 4 virtual tags are mutually exclusive, and any task will have exactly one of them:
COMPLETED(has anenddate)DELETED(has anenddate)WAITING(has awaitdate. thewaitentry is automatically removed when thewaitdate is reached)PENDINGfor any task for which none of the above apply (INCOMPLETEwould’ve been a more intuitive label tbh) It’s noteworthy that bothPENDINGandWAITINGtasks can be assignedACTIVE! Only completed and deleted tasks cannot be started.
(There is also the RECURRING tag for recurring events which is not covered here.)
Task dependencies
The following 2 virtual tags are mutually exclusive, and any task will have exactly one of them:
BLOCKEDif there is at least one incomplete(?) depending taskUNBLOCKEDotherwise
TODO what are the conditions for a BLOCKING task?
Optional virtual tags
Task readiness
SCHEDULEDif the task has ascheduleddate, whether it is in the past or the future. Note that this virtual tag is not mutually exclusive with:READYif the task is bothPENDINGandUNBLOCKEDand has either noscheduleddate or thescheduleddate is in the past
Task activeness
ACTIVEif the task has astartdate
Both the start date (and with it the virtual tag) are removed when a task is completed or deleted. However, a currently active task maintains its ACTIVE state when it is assigned a wait date (and thus changes to a WAITING task status).
Task dueness
Like with ACTIVE, all of the following tags are only applied to PENDING and WAITING tasks.
When a task has a due date it is given the following virtual tags if the due date is within the same named time unit as ‘now’ independently of whether the actual due date is in the past or the future from now: YEAR, QUARTER, MONTH, WEEK, TOMORROW, TODAY, DUETODAY (not sure what’s the difference there?), YESTERDAY
There are also two mutually exclusive tags:
OVERDUEif the due date is in the pastDUEif the due date lies between ‘now’ and midnight 6 days from now
Task expiry
Any task with an until date carries the UNTIL virtual tag, which seems to not interact with the any of the other tags. Upon reaching the until date, the task is automatically deleted (not sure what happens with the until date or the tag at this point).