Coverage for src / lexigram / contracts / domain / specification.py: 0%
6 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-15 18:57 +0800
« prev ^ index » next coverage.py v7.13.5, created at 2026-08-15 18:57 +0800
1"""SpecificationProtocol pattern relocated into domain package."""
3from __future__ import annotations
5from typing import Protocol, TypeVar, runtime_checkable
7T = TypeVar("T")
10@runtime_checkable
11class SpecificationProtocol(Protocol[T]):
12 """Protocol for the SpecificationProtocol pattern.
14 This class was previously defined in ``lexigram.contracts.specification``
15 before the 2026 reorg. It has been moved here alongside the other
16 DDD primitives. A migration mapping ensures imports are rewritten.
17 """
19 def is_satisfied_by(self, candidate: T) -> bool: ...
21 def __and__(self, other: SpecificationProtocol[T]) -> SpecificationProtocol[T]: ...
23 def __or__(self, other: SpecificationProtocol[T]) -> SpecificationProtocol[T]: ...
25 def __invert__(self) -> SpecificationProtocol[T]: ...
28__all__ = ["SpecificationProtocol", "T"]