37 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""pipeline-opportunity 模块装载入口。
宿主应用(pipeline-app)在 init() 中调用 load_pipeline_opportunity() 即挂载商机产线:
能力包注册(opp_ability)。未装本模块的宿主完全零接触。
平台边界:本模块属于产线平台,只通过内网 HTTP 消费数据爬取平台的只读数据接口;
报告/确认/审批状态落产线自己的库(opp_* 表),绝不回写爬虫库。
表结构不在此处建(铁律:运行期不做 schema 变更),建表走部署期 build.sh。
"""
import logging
logger = logging.getLogger("pipeline.opportunity")
_loaded = False
def load_pipeline_opportunity():
"""挂载商机产线(幂等)。"""
global _loaded
if _loaded:
return True
# 主 agent 能力包 + slash 命令(import 即注册,与投标产线同机制)
# 注意:宿主日志级别过滤 info,模块加载日志须用 debug 才能被观察到(与宿主各模块一致)
try:
from . import opp_ability # noqa: F401
logger.debug("[pipeline_opportunity] ability registered: opportunity_general")
except Exception as e:
logger.warning("[pipeline_opportunity] ability 注册失败: %s", str(e)[:200])
return False
_loaded = True
logger.debug("[pipeline_opportunity] v0.1.0 loaded")
return True