30 lines
759 B
Python
30 lines
759 B
Python
"""
|
|
policy 包:跨 handler 的公共校验落点(空壳)。
|
|
|
|
本文件职责:占位;身份/Schema/权限等确定性规则后续放本包。
|
|
禁止:自然语言语义;禁止把全部卡片逻辑堆进本包。
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import logging
|
|
from typing import Any
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def policy_package_ready() -> bool:
|
|
"""框架探测:包可导入即 True。"""
|
|
return True
|
|
|
|
|
|
def assert_has_sender_id(sender_id: str) -> dict[str, Any]:
|
|
"""
|
|
身份壳:无 sender_id 则 ok=False。
|
|
|
|
不做企微换号;不入 Graph 的裁决由调用方执行。
|
|
"""
|
|
if not (sender_id or "").strip():
|
|
return {"ok": False, "error": "missing_sender_id"}
|
|
return {"ok": True}
|