- 分支内容对齐 qyqy_develop b6ec3aa,树完全一致(同步后 git diff 为空) - 覆盖本轮全部交付:客服 Agent 重构(安全路由 / 五出口 / 记忆与画像 / RAG 全链路) + 开发文档 62 份编号体系(D1.1 v1.17 索引) + 新增 D2.10-客服Agent端到端答辩文档-2026-09-21.html - 基线:e239eb7(2026-09-17 品牌口径统一快照),本提交为其直接后继
207 lines
8.6 KiB
JSON
207 lines
8.6 KiB
JSON
{
|
||
"artifact": "t2g-c09-visitor-advice-guard",
|
||
"generated_at": "2026-09-18T12:49:24.354760+00:00",
|
||
"date_local": "2026-09-18",
|
||
"purpose": "执行 C-09「访客侧推介边界」(关键路径 C-01 → C-03 → C-09 → C-06 的第三步)",
|
||
"scope": [
|
||
"app/core/customer_service_rules.py(业务层)",
|
||
"app/service/agent/implementations/customer_service.py(业务层)"
|
||
],
|
||
"hit_signature_boundary": {
|
||
"input_side": "route_message() 的 PROMOTION_REQUEST_PATTERNS 与身份**无关**:访客与客户都被拦下并拿到 ADVICE_BOUNDARY_REPLY(C-01~C-03 已落地)",
|
||
"why_not_visitor_only": "输入侧按身份分化会让**已登录客户**拿到推介内容(知识块里真实存在配置建议),而 MVP 第 1 步要求客服无投资建议类内容。做成身份无关是**更严的超集**,不削弱任何红线。",
|
||
"output_side": "按 DoD ② 严格分化:护栏**只作用于访客**(`visitor` in context.roles),客户侧完全不套用",
|
||
"flagged_for_user": "若你本意是「输入侧也仅对访客生效」,改动量是 route_message 增加一个身份参数 —— 属另一处口径变更,本轮未做"
|
||
},
|
||
"implementation": {
|
||
"VISITOR_ADVICE_PATTERNS": [
|
||
"(推荐|建议)[^。;!?,,]{0,6}(购买|买入|申购|赎回|卖出|投资|配置|入手)",
|
||
"(为您|给你|我们)?推荐[^。;!?,,]{0,6}(基金|产品|组合|标的|理财)",
|
||
"(更|最)?适合(您|你)",
|
||
"(收益|回报|业绩|涨幅|净值)[^。;!?,,]{0,4}(最高|最好|最优|第一|排名)",
|
||
"(最值得|最划算)[^。;!?,,]{0,2}(买|购买|投资|入手)",
|
||
"(排名|排行)(第一|首位|前列)"
|
||
],
|
||
"visitor_advice_violation": "复用底座 compliance_context.is_prohibited_context 做语境豁免(询问/否定/引用),判定口径只此一处",
|
||
"agent_hook": "CustomerServiceAgent.handle() → _route_and_answer() + _guard_visitor_advice();原 handle 主体改名为 _route_and_answer,保证**所有出口**都过护栏",
|
||
"on_hit": "整条换成 ADVICE_BOUNDARY_REPLY,且 transfer_required=False / transfer_reason=None(不建单:访客没有工单承接方)",
|
||
"single_source": "名单与边界话术都只在业务层规则文件,底座不复制 —— 避免治理层注释里警告过的那类『常量各写一份必然漂移』"
|
||
},
|
||
"why_narrow": {
|
||
"不收的表述": [
|
||
"推荐",
|
||
"适合您"
|
||
],
|
||
"推荐二字本身": "政策原文「不得登载推荐性文字」含该词,连它一起拦会把合规问答整条打成边界话术",
|
||
"可以买入": "操作性问答「交易时间内可以买入,T+1 确认份额」会被误伤;名单只收『推荐/建议 + 交易动作』",
|
||
"持有": "产品字段标签「建议持有期限」不是建议"
|
||
},
|
||
"probe": {
|
||
"cases": 10,
|
||
"mismatch_count": 0,
|
||
"mismatch": [],
|
||
"rows": [
|
||
{
|
||
"text": "稳健型客户建议配置:货币基金 30% + 纯债基金 50%",
|
||
"expected_hit": true,
|
||
"actual": "建议配置",
|
||
"note": "配置指向",
|
||
"ok": true
|
||
},
|
||
{
|
||
"text": "该产品更适合您",
|
||
"expected_hit": true,
|
||
"actual": "更适合您",
|
||
"note": "适合性结论",
|
||
"ok": true
|
||
},
|
||
{
|
||
"text": "这只基金收益最高",
|
||
"expected_hit": true,
|
||
"actual": "收益最高",
|
||
"note": "排序性表述",
|
||
"ok": true
|
||
},
|
||
{
|
||
"text": "为您推荐的产品如下",
|
||
"expected_hit": true,
|
||
"actual": "为您推荐的产品",
|
||
"note": "指向具体标的的推荐",
|
||
"ok": true
|
||
},
|
||
{
|
||
"text": "建议您购买南方现金添利货币基金",
|
||
"expected_hit": true,
|
||
"actual": "建议您购买",
|
||
"note": "购买指向",
|
||
"ok": true
|
||
},
|
||
{
|
||
"text": "是否适合您需要结合风险测评,不能在这里下结论",
|
||
"expected_hit": false,
|
||
"actual": null,
|
||
"note": "询问/否定语境",
|
||
"ok": true
|
||
},
|
||
{
|
||
"text": "产品建议持有期限 6 个月",
|
||
"expected_hit": false,
|
||
"actual": null,
|
||
"note": "字段标签",
|
||
"ok": true
|
||
},
|
||
{
|
||
"text": "不得登载其他单位或个人的推荐性文字、图片等",
|
||
"expected_hit": false,
|
||
"actual": null,
|
||
"note": "政策原文里的『推荐』二字",
|
||
"ok": true
|
||
},
|
||
{
|
||
"text": "交易时间内可以买入,T+1 确认份额",
|
||
"expected_hit": false,
|
||
"actual": null,
|
||
"note": "操作性问答",
|
||
"ok": true
|
||
},
|
||
{
|
||
"text": "货币基金风险等级 R1,1 元起投,赎回 T+1 到账",
|
||
"expected_hit": false,
|
||
"actual": null,
|
||
"note": "纯公开资料",
|
||
"ok": true
|
||
}
|
||
]
|
||
},
|
||
"chunk_scan": {
|
||
"chunk_total": 628,
|
||
"per_pattern": [
|
||
{
|
||
"index": 1,
|
||
"pattern": "(推荐|建议)[^。;!?,,]{0,6}(购买|买入|申购|赎回|卖出|投资|配置|入手)",
|
||
"chunks_hit": 4,
|
||
"hits": [
|
||
{
|
||
"doc_id": "PROD-012",
|
||
"visibility": "public",
|
||
"source_file": "product/个人理财产品手册.md",
|
||
"hit": "建议配置",
|
||
"snippet": "属违规行为。 / / **保守型客户(C1)** / / - 建议配置:货币基金 60% + 纯债基金 40% / - 目标"
|
||
},
|
||
{
|
||
"doc_id": "PROD-012",
|
||
"visibility": "public",
|
||
"source_file": "product/个人理财产品手册.md",
|
||
"hit": "建议配置",
|
||
"snippet": "%—3.0% / / **稳健型客户(C2)** / / - 建议配置:货币基金 30% + 纯债基金 50% + 混合"
|
||
},
|
||
{
|
||
"doc_id": "PROD-012",
|
||
"visibility": "public",
|
||
"source_file": "product/个人理财产品手册.md",
|
||
"hit": "建议配置",
|
||
"snippet": "%—5.0% / / **平衡型客户(C3)** / / - 建议配置:纯债基金 30% + 混合基金 45% + 股票"
|
||
},
|
||
{
|
||
"doc_id": "PROD-012",
|
||
"visibility": "public",
|
||
"source_file": "product/个人理财产品手册.md",
|
||
"hit": "建议配置",
|
||
"snippet": ".5% / / **进取型客户(C4/C5)** / / - 建议配置:混合基金 35% + 股票基金 35% + QD"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"index": 2,
|
||
"pattern": "(为您|给你|我们)?推荐[^。;!?,,]{0,6}(基金|产品|组合|标的|理财)",
|
||
"chunks_hit": 0,
|
||
"hits": []
|
||
},
|
||
{
|
||
"index": 3,
|
||
"pattern": "(更|最)?适合(您|你)",
|
||
"chunks_hit": 0,
|
||
"hits": []
|
||
},
|
||
{
|
||
"index": 4,
|
||
"pattern": "(收益|回报|业绩|涨幅|净值)[^。;!?,,]{0,4}(最高|最好|最优|第一|排名)",
|
||
"chunks_hit": 0,
|
||
"hits": []
|
||
},
|
||
{
|
||
"index": 5,
|
||
"pattern": "(最值得|最划算)[^。;!?,,]{0,2}(买|购买|投资|入手)",
|
||
"chunks_hit": 0,
|
||
"hits": []
|
||
},
|
||
{
|
||
"index": 6,
|
||
"pattern": "(排名|排行)(第一|首位|前列)",
|
||
"chunks_hit": 0,
|
||
"hits": []
|
||
}
|
||
]
|
||
},
|
||
"knowledge_defect_found": {
|
||
"doc_id": "PROD-012",
|
||
"title": "产品手册 · 四、产品对比表与推荐策略 · 4.2 按客户类型的推荐策略",
|
||
"source_file": "product/个人理财产品手册.md",
|
||
"visibility": "public",
|
||
"content_hit": "建议配置:货币基金 60% + 纯债基金 40%(C1)… 等四档配置比例",
|
||
"verdict": "public 档携带**投资建议类内容**,与 MVP 第 1 步「游客线无投资建议类内容」冲突;运行时已被访客护栏挡住,故不是运行期漏洞,但属**语料缺陷**(该块对访客永远不可用)",
|
||
"recommendation": "登记为决策项:修语料(下线该节或降为非 public 档)需要补切片 + 重建集合 + 重跑检索自检,属知识侧动作,建议与 F-05 回写合并或单独立项"
|
||
},
|
||
"tests": {
|
||
"rules_level": "5 例真阳性 + 5 例克制用例(test_visitor_advice_violation_detects_advice / ..._ignores_non_advice)",
|
||
"agent_level": "4 例(访客被替换 / 客户原样 / 无措辞原样 / 边界话术不自绊)",
|
||
"targeted": "2 文件 69 passed"
|
||
},
|
||
"gate": {
|
||
"pytest": "2 failed / 1534 passed / 2 skipped(失败集与 T0 基线同一组)",
|
||
"ruff": "22(改动文件 All checks passed)",
|
||
"mypy": "3(无新增)",
|
||
"docs": "50 documents, no number collision",
|
||
"schema": "89 business tables passed"
|
||
}
|
||
} |