So, as I replied in the other thread – problem is output() is a part of the scheduling rather than the execution. This is because it needs to check if that task was already run, and the way this works is it looks if the output() targets are all complete.
So output() is actually run before run().
This is kind of a requirement to be able to run tasks across multiple processes, since otherwise there would have to be communication back to the server about what targets were produced in run time. This is doable, but would require a lot of refactoring.
Hope this makes sense