contract: only the contract after removing the stand-ins
Drops the helpers only the stand-ins used, tests the contract with an estimator defined in the test, and updates the README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,8 +11,6 @@ patients).
|
||||
This module doesn't import the kit, Persistance or the orchestration: it receives lists.
|
||||
"""
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
from dataclasses import asdict, dataclass
|
||||
from typing import NamedTuple, Protocol, runtime_checkable
|
||||
|
||||
@@ -50,13 +48,3 @@ class RiskEstimator(Protocol):
|
||||
def provenance(self) -> Provenance: ...
|
||||
|
||||
def estimate(self, columns: list[str], rows: list[tuple]) -> list[Risk]: ...
|
||||
|
||||
|
||||
def _rule_sha(rule: dict) -> str:
|
||||
return hashlib.sha256(json.dumps(rule, sort_keys=True).encode("utf-8")).hexdigest()
|
||||
|
||||
|
||||
def _missing(columns: list[str], needed: tuple[str, ...]) -> None:
|
||||
missing = [c for c in needed if c not in columns]
|
||||
if missing:
|
||||
raise ValueError(f"The frame lacks the columns {missing}: the stand-in needs them.")
|
||||
|
||||
Reference in New Issue
Block a user