• Fold a single document's source through a plan, producing one merged update.

    Each step's migrator for kind is applied in plan order; every non-empty result is merged into the accumulating update, so later steps win on colliding keys. Returns an empty object when nothing changed — the caller skips the document.update() entirely in that case.

    Parameters

    Returns Record<string, unknown>

    A flattened update payload; {} when the plan changes nothing.