Thanks to @mwra for the authoritative answer; thanks to @laotang for the interesting question.
Further on this…
[quote=“mwra, post:5, topic:1067”]
So this fixes your problem, but it also suggests it is perhaps not the bast way to use aliases.[/quote]
Your set-up, and question, rest on the idea of the aliases being more or less permanent things, akin to the original note itself. A mental TB leap for me was realizing that, when it comes to aliases created by agents, it was worth thinking of them as highly transient, disposable-and-recreateable bits of ephemera. You can always make more of them, by any criteria you want, with a new agent or rule.
Why does this matter? Because it might highly streamline what you’re doing. Your query is based on working with an alias, and later moving that specific alias to the Archive container. But you don’t have to be that precise. All that matters is having an alias of your original item show up in the archive.
This suggests, in turn, a simpler way to set up the agent structure. You would just need:
An agent to find items you want to move into your active work zone-- and then remove aliases from that active work zone once you mark them as finished. (So the query would include $DoneWithThisItem==false to bring items in. When you changed that to true, the alias would disappear from this area.)
Another agent to populate your Archive container with items that are finished. The query for this would include $DoneWithThisNote==true.
The conceptual difference here is that you are not moving the alias. You’re creating one when you want to work on it; you’re making that one disappear when you’ve completed the item; and you’re creating a new alias to store in Archives. The system doesn’t know whether the original alias has been “moved” or whether a new one has been created there, but for your programming purposes it’s a lot easier, I think.