• Resolve the effective "from" version for a world, distinguishing a brand-new world from a pre-tracking legacy one.

    The systemMigrationVersion setting defaults to "" for both a freshly created world (nothing to migrate) and a world created before migration tracking existed (everything to migrate). They are told apart by whether the world holds any content:

    • stored version present → use it verbatim.
    • empty + world unpopulated → fresh: return current, so the plan is empty and the runner simply stamps the version forward.
    • empty + world populated → legacy: return "0.0.0", so every registered migration runs.

    Parameters

    • stored: string

      The stored systemMigrationVersion (may be empty).

    • current: string

      The running system version.

    • worldHasContent: boolean

      Whether the world holds any migratable documents.

    Returns string

    The version to plan migrations from.