"""Phase 11 site 11: top-level env var preset loader. Site 11 at module-level: if os.environ.get("SLOP_TOOL_PRESET"): try: set_tool_preset(os.environ["SLOP_TOOL_PRESET"]) except Exception: pass Body: pass = SS violation. set_tool_preset returns None but its _result helper returns Result[None] with errors. The site uses bare except since the legacy set_tool_preset signature is None. """ import sys sys.path.insert(0, ".") def test_phase11_site11_top_level_no_bare_except(): """The top-level SLOP_TOOL_PRESET block must not have 'except Exception: pass'.""" import inspect import src.ai_client src_text = inspect.getsource(src.ai_client) # Find the block assert "if os.environ.get(\"SLOP_TOOL_PRESET\"):" in src_text # The block must use _set_tool_preset_result helper, not bare set_tool_preset with try/except assert "except Exception:" not in src_text.split("# Check for tool preset in environment variable")[1].split("#endregion: Session")[0] if "Check for tool preset" in src_text else True