```python
"""The cheapest set of travel passes covering every trip day."""


def _validate_plan(trip_days, passes):
    for day in trip_days:
        if isinstance(day, bool) or not isinstance(day, int) or day < 1:
            raise ValueError("trip days must be positive integers")
    for earlier, later in zip(trip_days, trip_days[1:]):
        if later <= earlier:
            raise ValueError("trip days must be strictly increasing")
    if not passes:
        raise ValueError("at least one pass kind is required")
    for cover in passes:
        span = cover["span"]
        cost = cover["cost"]
        if isinstance(span, bool) or not isinstance(span, int) or span < 1:
            raise ValueError("pass span must be a positive integer")
        if isinstance(cost, bool) or not isinstance(cost, int) or cost < 0:
            raise ValueError("pass cost must be a non-negative integer")


def cheapest_pass_plan(trip_days: list, passes: list) -> dict:
    _validate_plan(trip_days, passes)
    
    # Sort passes by span in ascending order
    sorted_passes = sorted(passes, key=lambda x: x["span"])
    
    # Initialize variables
    total_cost = 0
    purchases = []
    current_day = 0
    
    # Iterate over each trip day
    for trip_day in trip_days:
        if trip_day <= current_day:
            raise ValueError("trip days must be strictly increasing")
        
        # Find the cheapest pass that covers the current day
        pass_index = next((i for i, pass_info in enumerate(sorted_passes) 
                           if pass_info["span"] >= trip_day - current_day + 1), None)
        
        if pass_index is None:
            raise ValueError("trip day not covered by any pass")
        
        # Add the cheapest pass to the purchases list
        purchases.append([trip_day, sorted_passes[pass_index]["span"]])
        
        # Update total cost and move current day forward
        total_cost += sorted_passes[pass_index]["cost"]
        current_day = trip_day + sorted_passes[pass_index]["span"] - 1
    
    return {"total": total_cost, "purchases": purchases}
```