diff --git a/scripts/verify_import_closure.py b/scripts/verify_import_closure.py index aedb1ff..66fbb12 100644 --- a/scripts/verify_import_closure.py +++ b/scripts/verify_import_closure.py @@ -344,21 +344,17 @@ def check_runtime_import(name: str, repo: str, pkg: str) -> Dict: "path": loaded_from, } except ModuleNotFoundError as exc: - missing = getattr(exc, "name", "") or "" - if missing.split(".")[0] in BASE_TOPLEVEL: - return { - "module": name, "code": "RUNTIME_IMPORT_SKIP_BASE_ABSENT", - "severity": "SKIP", - "detail": "基座未安装(Q5 未解除):%s" % exc, - "path": repo, - } + # 缺基座/第三方模块 = 依赖未 pip install -e(Q5 派生症状),非代码缺陷 -> SKIP return { - "module": name, "code": "RUNTIME_IMPORT_FAIL", "severity": "FAIL", - "detail": str(exc), "path": repo, + "module": name, "code": "RUNTIME_IMPORT_SKIP_DEP_ABSENT", + "severity": "SKIP", + "detail": "依赖未安装(Q5 未解除;pip install -e 基座后复跑即转 OK):%s" % exc, + "path": repo, } except ImportError as exc: + # cannot import name X = 符号级缺陷(如 entity 命名空间歧义)-> FAIL,必须修 return { - "module": name, "code": "RUNTIME_IMPORT_FAIL", "severity": "FAIL", + "module": name, "code": "RUNTIME_IMPORT_SYMBOL_FAIL", "severity": "FAIL", "detail": str(exc), "path": repo, } except Exception as exc: # 基座副作用(无 DB/无配置)不计闭包失败