merge

Parameters

discovered

What the scan found, in run order.

applied

What the history table holds, oldest first.

target

The highest version this run will go to, or null for all of them.