New use case exposes bug in VF track-trace instructions
We ran into a new use case that cannot be tracked or traced by the current https://www.valueflo.ws/algorithms/track/ instructions.
The problem arises when the same resource goes many times through processes with the same ProcessSpecification. That situation can't be handled by the Stage, as suggested in those instructions:
When the same economic resource is both input and output of a process, sometimes a series of processes, such as for repair or quality testing or a workflow where a resource is refined through stages like writing/editing/etc, the stage must be identified, based on the kind of process the resource was last output of.
Stage will not work because it uses the ProcessSpecification, and in this case, that is the same for all of the repetitive Processes.
People have suggested timestamps.
The problem with using timestamps for sequencing resource flows is that we are working in distributed systems, and it can be difficult or impossible to sequence using timestamps in distributed systems. The standard way to do it is called causal ordering, which is the way the VF track and trace logic is described in the instructions.
Here are some references where you can learn a lot more, or you can just believe temporarily that the problem with timestamps is real.
- https://en.wikipedia.org/wiki/Happened-before
- https://www.microsoft.com/en-us/research/publication/time-clocks-ordering-events-distributed-system/
- https://duckduckgo.com/?q=causal+order+distributed+system&t=h_&ia=web
But when the same resource goes through the same types of processes over and over, the methods we have used for causal ordering don't work.
First I'll describe this fascinating use case. Then I'll describe a possible solution, and in separate follow-on comments, step through some pseudocode, first to demonstrate the problem, and then to demonstrate the solution.