from __future__ import annotations from dataclasses import dataclass from typing import Protocol @dataclass(frozen=True) class DeliveryResult: ok: bool permanent: bool = False error: str | None = None class Notifier(Protocol): name: str async def deliver(self, event_type: str, payload: dict) -> DeliveryResult: ...