From 2253f48993d580decaada5e2737225af62222b94 Mon Sep 17 00:00:00 2001 From: m3taversal Date: Tue, 31 Mar 2026 13:44:04 +0100 Subject: [PATCH] fix: rename eval.py to eval_checks.py to avoid shadowing stdlib eval Also fixes _is_entity path check to use Path.parts instead of string containment, preventing false positives on paths like "domains/entities-overview/". Co-Authored-By: Claude Opus 4.6 (1M context) --- reweave.py | 4 ++-- telegram/bot.py | 2 +- telegram/{eval.py => eval_checks.py} | 0 tests/test_eval_pipeline.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename telegram/{eval.py => eval_checks.py} (100%) diff --git a/reweave.py b/reweave.py index 67ba61c..8d9d07c 100644 --- a/reweave.py +++ b/reweave.py @@ -168,8 +168,8 @@ def _is_entity(path: Path) -> bool: fm = _parse_frontmatter(path) if fm and fm.get("type") == "entity": return True - # Also check path — entities live under entities/ directory - return "entities/" in str(path) + # Check path parts — avoids false positives on paths like "domains/entities-overview/" + return "entities" in Path(path).parts def _same_source(path_a: Path, path_b: Path) -> bool: diff --git a/telegram/bot.py b/telegram/bot.py index a841df7..521972b 100644 --- a/telegram/bot.py +++ b/telegram/bot.py @@ -386,7 +386,7 @@ def get_db_stats() -> dict: return {"merged_claims": "?", "contributors": "?"} -from eval import ( +from eval_checks import ( _LLMResponse, estimate_cost, check_url_fabrication, apply_confidence_floor, CONFIDENCE_FLOOR, COST_ALERT_THRESHOLD, ) diff --git a/telegram/eval.py b/telegram/eval_checks.py similarity index 100% rename from telegram/eval.py rename to telegram/eval_checks.py diff --git a/tests/test_eval_pipeline.py b/tests/test_eval_pipeline.py index 6dde695..c8a455c 100644 --- a/tests/test_eval_pipeline.py +++ b/tests/test_eval_pipeline.py @@ -17,7 +17,7 @@ import pytest # Add telegram/ to path for imports sys.path.insert(0, str(Path(__file__).parent.parent / "telegram")) -from eval import ( +from eval_checks import ( _LLMResponse, estimate_cost, check_url_fabrication,