```python
def capped_compositions(total: int, parts: int, lo: int, hi: int) -> int:
    if not isinstance(parts, int) or parts <= 0:
        raise ValueError("parts must be a positive integer")
    if not isinstance(lo, int) or not isinstance(hi, int) or lo < 0 or hi < 0 or lo > hi:
        raise ValueError("bounds must be non-negative integers with lo <= hi")
    if not isinstance(total, int):
        raise ValueError("total must be an integer")

    dp = [[0] * (parts + 1) for _ in range(total + 1)]
    dp[0][0] = 1

    for i in range(1, total + 1):
        for j in range(1, parts + 1):
            dp[i][j] = sum(dp[i - k][j - 1] for k in range(lo, hi + 1) if i - k >= 0)

    return dp[total][parts]
```