move

fun move(replica: ReplicaId, ts: Long, node: String, newParent: String): Pair<MovableTree<V>, Patch<MovableTree<V>>>

Move node to newParent, tagging the op with (replica, ts).

If node is ROOT_ID, this is a no-op (root has no parent and cannot be reparented). If applying the move would create a cycle, the op is silently recorded in the log but skipped during replay — the node keeps its current parent. This is correct: on merge, the op remains in the log union and participates in the deterministic conflict resolution.

Return

the updated tree and a Patch carrying just the new op (for delta-propagation to peers).