From 8cc4ecd5770b45ddf2e80191e8b1e1ffe0880e78 Mon Sep 17 00:00:00 2001 From: TianyeDong Date: Sun, 5 Jul 2026 12:35:10 -0400 Subject: [PATCH] fix(miles-pipeline): narrow startup-validation import guard to ModuleNotFoundError The F10 topology validation import was wrapped in `except Exception`, which skipped all validation on any import error and defeated the fail-fast intent. Co-Authored-By: Claude Opus 4.8 --- rlix/pipeline/miles_pipeline.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rlix/pipeline/miles_pipeline.py b/rlix/pipeline/miles_pipeline.py index be10691..dc97cd6 100644 --- a/rlix/pipeline/miles_pipeline.py +++ b/rlix/pipeline/miles_pipeline.py @@ -103,10 +103,14 @@ def _validate_topology(self, pipeline_config: Any) -> None: return try: from miles.utils.rlix_validation import assert_rlix_topology - except Exception as exc: # noqa: BLE001 + except ModuleNotFoundError as exc: + # miles not installed (test/dev fixture). A partial or broken + # install raises ImportError/SyntaxError and must NOT be swallowed + # here — in production miles is always importable, so those signal + # a real bug and should fail fast. logger.warning( - "MilesPipeline: miles.utils.rlix_validation unavailable; " - "skipping startup validation: %r", + "MilesPipeline: miles not installed; skipping F10 startup " + "validation (test-fixture path): %r", exc, ) return