diff --git a/src/veritext/validators/base.py b/src/veritext/validators/base.py new file mode 100644 index 0000000..30055fd --- /dev/null +++ b/src/veritext/validators/base.py @@ -0,0 +1,31 @@ +"""Base types and protocols for validation checks.""" + +from typing import Protocol, runtime_checkable + +from veritext.core.types import CheckResult, ValidationContext + + +@runtime_checkable +class Check(Protocol): + """Protocol for validation checks. + + A Check computes a score or property of text and compares it against + a threshold to produce a pass/fail result. + """ + + @property + def name(self) -> str: + """Return the name of this check.""" + ... + + def check(self, text: str, context: ValidationContext) -> CheckResult: + """Run the check and return a result. + + Args: + text: The text to validate. + context: Validation context containing reference text and metadata. + + Returns: + CheckResult with pass/fail status and diagnostics. + """ + ...