```python
"""Tape-measure spans: parse to inches, format canonically, and add."""

INCHES = {"yd": 36, "ft": 12, "in": 1}
ORDER = ("yd", "ft", "in")


def parse_span(text: str) -> int:
    if not isinstance(text, str):
        raise ValueError("input must be a string")
    
    parts = text.split()
    if len(parts) < 3 or len(parts) > 4:
        raise ValueError("span must contain exactly three or four parts")
    
    for part in parts[:-1]:
        if not part.isdigit() or int(part) < 0:
            raise ValueError("each value must be a non-negative integer")
    
    unit = parts[-1]
    if unit not in ORDER:
        raise ValueError(f"unknown unit: {unit}")
    
    total = 0
    for i, part in enumerate(parts[:-1]):
        total += int(part) * INCHES[ORDER[i]]
    
    return total


def format_span(inches: int) -> str:
    if not isinstance(inches, int) or inches < 0:
        raise ValueError("inches must be a non-negative integer")
    
    if inches == 0:
        return "0in"
    
    parts = []
    for unit in ORDER:
        value = inches // INCHES[unit]
        if value > 0:
            parts.append(f"{value}{unit}")
            inches %= INCHES[unit]
    
    return " ".join(parts)


def add_spans(first: str, second: str) -> str:
    total = parse_span(first) + parse_span(second)
    return format_span(total)
```