I think I found a bug. I created a few tasks, one of which is overdue and the other isn’t. Then I added an agent, Overdue, that finds overdue tasks, using the following query:
$Prototype==“Task”&$DueDate<date(today)
This agent works fine. It matches the overdue task.
I added another agent, Non-overdue tasks, with this query:
($Prototype==“Task”)&(inside(“/Overdue”)==false)
This second agent incorrectly matches the overdue task. The overdue task is inside /Overdue, so it should be excluded. It seems like inside(“/Overdue”)==false is not excluding tasks matched by the Overdue agent. I also tried !inside("/Overdue") and a few variations for the path to the Overdue agent, to no avail.
So, inside(/Overdue) is false for the original note /Overdue task and true for the alias of /Overdue task inside the /Overdue agent. I hadn’t considered how inside() could return different results like that on different occurrences of the same note.
It looks like I need to define /Overdue and /NotOverdue independently. Unless I misunderstood your last sentence?
It looks like I need to define /Overdue and /NotOverdue independently. Unless I misunderstood your last sentence?
That’s what I’m suggesting.
Because of the semantics of aliases, it is possible for one note to be inside(X) and inside(Y) at once, even though X≠Y. This also means the same note may simultaneously be inside(X) and !inside(X). This seems strange in this context, but of course it’s necessary if you want inside(/the/Agent) to be useful.