```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:
    # Validate the span text against the part grammar and unit order,
    # then total its parts in inches.
    if not isinstance(text, str):
        raise ValueError("input must be a string")
    parts = text.split()
    if not parts:
        raise ValueError("span cannot be empty")
    
    total = 0
    for part in parts:
        if not part.endswith("yd") and not part.endswith("ft") and not part.endswith("in"):
            raise ValueError("unknown unit")
        if len(part) < 2 or not part[:-2].isdigit():
            raise ValueError("invalid value")
        value = int(part[:-2])
        unit = part[-2:]
        if unit not in ORDER:
            raise ValueError("units out of order")
        if unit != ORDER[ORDER.index(unit) - 1]:
            raise ValueError("units repeated")
        total += value * INCHES[unit]
    
    return total


def format_span(inches: int) -> str:
    if isinstance(inches, bool) or not isinstance(inches, int) or inches < 0:
        raise ValueError("inches must be a non-negative integer")
    if inches == 0:
        return "0in"
    parts = []
    yards, rest = divmod(inches, 36)
    feet, rest = divmod(rest, 12)
    if yards:
        parts.append(f"{yards}yd")
    if feet:
        parts.append(f"{feet}ft")
    if rest:
        parts.append(f"{rest}in")
    return " ".join(parts)


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