"""Pure-domain exceptions. This layer must not import :mod:`packages.shared` (enforced by import-linter), so it defines its own error types. Adapters translate them into :class:`packages.shared.errors.AppError` at the boundary. """ from __future__ import annotations class DomainError(Exception): """Base class for all pure-domain rule violations.""" class QuotaExceededError(DomainError): def __init__(self, *, required: int, remaining: int) -> None: self.required = required self.remaining = remaining super().__init__(f"quota exceeded: required={required} remaining={remaining}") class InvalidTaskTransitionError(DomainError): def __init__(self, *, current: str, target: str) -> None: self.current = current self.target = target super().__init__(f"invalid task transition: {current} -> {target}")