"""Typed failures that can safely cross the service boundary."""


class BackplaneError(Exception):
    """Base class for expected runtime failures."""


class AuthenticationError(BackplaneError):
    """A tenant or management credential was rejected."""


class PolicyViolation(BackplaneError):
    """A card blocked a request or response under declared policy."""


class PackageVerificationError(BackplaneError):
    """A card package failed integrity, signature, or trust validation."""


class UnsupportedCapability(BackplaneError):
    """The selected backend cannot execute the requested card stack."""


class RequestLimitError(BackplaneError):
    """A request exceeded an explicit resource or rate limit."""

