def is_legacy_data(sorald_stats: dict) -> bool:
    """Detect whether this data is detailed stats output from modern Sorald or
    legacy data (from the old PRs.json file or simply empty).
    """
    return all(
        isinstance(key, str) and isinstance(value, (int, str))
        for key, value in sorald_stats.items()
    )