chore(sync): zsy_developcc 全量同步至 qyqy_develop(W26 口径)
- 分支内容对齐 qyqy_develop b6ec3aa,树完全一致(同步后 git diff 为空) - 覆盖本轮全部交付:客服 Agent 重构(安全路由 / 五出口 / 记忆与画像 / RAG 全链路) + 开发文档 62 份编号体系(D1.1 v1.17 索引) + 新增 D2.10-客服Agent端到端答辩文档-2026-09-21.html - 基线:e239eb7(2026-09-17 品牌口径统一快照),本提交为其直接后继
This commit is contained in:
@@ -61,6 +61,38 @@ def test_visitor_does_not_request_memory_extraction() -> None:
|
||||
assert requested is False
|
||||
|
||||
|
||||
def test_customer_service_never_requests_memory_extraction() -> None:
|
||||
"""`DEC-19`:客服不写长期记忆——命中偏好信号、甚至带业务事件也不入抽取队列。"""
|
||||
context = RequestContext(
|
||||
user_id="9001", trace_id="cs-memory-trace", roles=("customer",),
|
||||
permissions=("agent:run",), data_scope="self",
|
||||
)
|
||||
result = AgentResult(run_id="cs-memory-run", result=CoreResult(text="客服答复"))
|
||||
|
||||
def decision(agent_type: str) -> bool:
|
||||
return WorkerRuntime.should_request_memory_extraction(
|
||||
agent_type=agent_type, context=context,
|
||||
message="我的风险偏好是稳健型,只买货币基金",
|
||||
result=result, business_events=("trade.completed",),
|
||||
)
|
||||
|
||||
assert decision("customer_service") is False
|
||||
# 对照组:闸门只拦客服,不能顺手把其它 Agent 的长期记忆一起关掉。
|
||||
assert decision("risk_agent") is True
|
||||
|
||||
|
||||
def test_customer_service_never_produces_profile_candidate() -> None:
|
||||
"""`DEC-19`:客服不产生画像候选,已登录客户陈述偏好也不产候选。"""
|
||||
context = RequestContext(
|
||||
user_id="9001", trace_id="cs-candidate-trace", roles=("customer",),
|
||||
permissions=("agent:run",), data_scope="self",
|
||||
)
|
||||
|
||||
assert WorkerRuntime.should_request_profile_candidate(
|
||||
agent_type="customer_service", context=context, message="我的风险偏好是稳健型"
|
||||
) is False
|
||||
|
||||
|
||||
def test_visitor_does_not_request_profile_candidate() -> None:
|
||||
"""访客即使陈述偏好也不能创建画像候选。"""
|
||||
context = RequestContext(
|
||||
|
||||
Reference in New Issue
Block a user