When an input moves mid-run, vx keeps the result and skips the save
A cache key is a promise: these outputs were built from exactly these inputs. vx takes the key just before the command runs. If an input changes while the command is running, the output was built from bytes the key does not describe, and filing it under that key would replay the wrong output on the next hit. So when an input moves mid-run, vx keeps the run's result, saves no entry, and tells you…
A cache key is a promise ensuring these outputs were constructed using exact inputs. When vx takes the key just before running a command, any change in the inputs mid-run prevents saving the output under that key, as it would replay the wrong result. Therefore, when an input moves during the run, vx keeps the result, does not save the entry, and informs which file changed.
If the task writes to the file, it must declare it in cache.outputs. On the next run, it is a miss and rebuilds from what is currently on disk. After the command, vx checks each input once, determining if a file was modified by statting the file. Any file touched after its digest was learned is rehashed and compared. If the file is gone, it has moved.
When a task writes to the same bytes, it is counted as moved, requiring a re-run. This is also applicable on CI runners, where a task running alongside can change an input and put it back, causing a byte check to miss the change. By default, mutable is set for every task, but it can be overridden with strategy: unchecked or severity: error for critical pipelines.
Withheld saves do not stop downstream tasks, and every task that ran over its outputs is affected, withholding its save as well.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.