refactor(evidence): remove legacy Python layout (#31)

This commit is contained in:
2026-08-24 02:36:30 +02:00
parent 44f1efa5ba
commit 840848df94
36 changed files with 246 additions and 321 deletions
+40
View File
@@ -0,0 +1,40 @@
from pathlib import Path
HARNESS_ROOT = Path(__file__).resolve().parents[1]
LEGACY_PATHS = (
"tht/ports/evidence.py",
"tht/adapters/evidence",
"tht/corpus",
"tht/search/evidence.py",
"tht/session/artifacts.py",
)
LEGACY_REFERENCES = (
"tht.ports.evidence",
"tht.adapters.evidence",
"tht.corpus",
"tht.search.evidence",
"tht.session.artifacts",
"build_evidence_sources",
"build_evidence_entries",
)
def test_replaced_evidence_layout_is_removed():
remaining = [path for path in LEGACY_PATHS if (HARNESS_ROOT / path).exists()]
assert remaining == []
def test_production_and_tests_use_only_the_evidence_module():
offenders = []
for root in (HARNESS_ROOT / "tht", HARNESS_ROOT / "tests"):
for path in root.rglob("*.py"):
if path == Path(__file__).resolve() or "__pycache__" in path.parts:
continue
contents = path.read_text(encoding="utf-8")
matched = [reference for reference in LEGACY_REFERENCES if reference in contents]
if matched:
offenders.append((path.relative_to(HARNESS_ROOT).as_posix(), matched))
assert offenders == []