feat(prompts): 建材 system.md/company_facts.md 双要改写——话术池/原则节/App反向留资/互留句/提醒配合全量对齐
计划外裁量(1 处): tests/test_site_import_template.py test_固定段行级来源 补 DUAL_ASK_DIVERGED 豁免清单——jiancai 双要演化后模板按 spec §3.4 有意 保持分步双要出厂,19 行联系方式话术分叉按特征子串豁免,其余行仍受 ≤8 阈值 守护(不豁免则该测试 19>8 必红,spec 冻结模板与全量绿冲突的唯一解)。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -46,3 +46,40 @@ def test_app_reverse_ask_dual_and_synced():
|
||||
app = w["no_contact"]["app"]
|
||||
assert "and email" in app
|
||||
assert app in w["reminders"]["contact_ask"]["app"]
|
||||
|
||||
|
||||
# ---- system.md / company_facts.md 侧 ----
|
||||
|
||||
def _md(name: str) -> str:
|
||||
return (SEED / "prompts" / name).read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def test_system_md_dual_ask_principle_and_pool():
|
||||
src = _md("system.md")
|
||||
assert "双渠道一次要齐" in src
|
||||
assert "WhatsApp and email" in src # en 话术池
|
||||
assert "WhatsApp和邮箱" in src # zh 话术池
|
||||
# 邮箱轻补两条逐字句原文存活(与引擎 email_light 模板逐字一致)
|
||||
assert ("Got it! And an email address would help too — our manager "
|
||||
"will send the formal quotation PDF there.") in src
|
||||
assert "收到!邮箱也留一个呗?客户经理把正式报价单 PDF 发你邮箱。" in src
|
||||
|
||||
|
||||
def test_app_reverse_ask_line_matches_wall():
|
||||
w = _wall()
|
||||
assert w["no_contact"]["app"] in _md("system.md") # L214 与 wall 一字不差
|
||||
|
||||
|
||||
def test_company_facts_dual_ask():
|
||||
assert "WhatsApp 和邮箱" in _md("company_facts.md")
|
||||
|
||||
|
||||
def test_deflections_no_either_or_wording():
|
||||
"""负向锚: 首次索要池不得回退二选一措辞(en "or email"/zh "或邮箱"/es "o correo")。"""
|
||||
w = _wall()
|
||||
for s in w["deflections"]["en"]:
|
||||
assert " or email" not in s
|
||||
for s in w["deflections"]["zh"]:
|
||||
assert "或邮箱" not in s
|
||||
for s in w["deflections"]["es"]:
|
||||
assert "o correo" not in s.lower()
|
||||
|
||||
@@ -15,6 +15,33 @@ INDUSTRY_WORDS = [
|
||||
"给水", "燃气", "排污", "灌溉", "波纹管", "球墨铸铁",
|
||||
]
|
||||
|
||||
# 双要分叉豁免清单(2026-11-02,spec docs/superpowers/specs/
|
||||
# 2026-11-02-jiancai-dual-contact-ask-design.md §3.4):jiancai system.md
|
||||
# 已演化到"双渠道一次要齐"话术,生成器模板按 spec 决策**有意保持**"分步双要"
|
||||
# 出厂默认——联系方式引导话术族的行级分叉是已归档的合规分叉,按行特征子串
|
||||
# 豁免不计 missing;其余行仍受 ≤8 阈值守护(防未归档漂移)。
|
||||
DUAL_ASK_DIVERGED = (
|
||||
'互留句 "Drop yours too..."', # 模板句族行(L7 同构)
|
||||
"I'll connect you with our manager to arrange that — drop your WhatsApp", # 转接句
|
||||
"Tell me your WhatsApp and our manager", # 预算后引导句
|
||||
"drop your WhatsApp and our manager will reply within 12 hours", # 磨价应对句
|
||||
"记录里确有号码", # 已留资确认句
|
||||
"4. 拿到联系方式后", # 对话流程尾括注
|
||||
"What's your WhatsApp number with the country code", # en 池①
|
||||
"who handles [country] market", # en 池②
|
||||
"Drop your WhatsApp or email?", # en 池③
|
||||
"Want me to get you a full quotation?", # en 池④
|
||||
"你WhatsApp多少?带上国家代码", # zh 池①
|
||||
"我让负责[国家]市场的同事加你", # zh 池②
|
||||
"留个WhatsApp或者邮箱吧", # zh 池③
|
||||
"你给我个联系方式,我让客户经理", # zh 池④
|
||||
"**分步双要,一次只问一个**", # 双渠道原则行
|
||||
'"Drop your WhatsApp and our manager', # App 反向留资句
|
||||
"【互留】", # 互留句
|
||||
'提醒说"已提供"时', # 系统提醒配合行
|
||||
"拿到后说一句", # 注意节尾括注
|
||||
)
|
||||
|
||||
|
||||
class TestTemplatePurity:
|
||||
def test_骨架无行业残留(self):
|
||||
@@ -45,13 +72,17 @@ class TestTemplatePurity:
|
||||
assert anchor in t, f"缺锚点: {anchor}"
|
||||
|
||||
def test_固定段行级来源(self):
|
||||
"""非占位行应逐字存在于 jiancai 原文(允许空行/标题差异 ±5% 行)。"""
|
||||
"""非占位行应逐字存在于 jiancai 原文(允许空行/标题差异 ±5% 行)。
|
||||
|
||||
双要改版后联系方式话术族的分叉按 DUAL_ASK_DIVERGED 豁免(见其注)。
|
||||
"""
|
||||
j = JIANCAI_SYSTEM.read_text(encoding="utf-8").splitlines()
|
||||
jset = set(l.strip() for l in j)
|
||||
t = (TPL_DIR / "system_template.md").read_text(encoding="utf-8").splitlines()
|
||||
missing = [l.strip() for l in t
|
||||
if l.strip() and "{{" not in l and "#" not in l[:2]
|
||||
and l.strip() not in jset]
|
||||
and l.strip() not in jset
|
||||
and not any(m in l for m in DUAL_ASK_DIVERGED)]
|
||||
# 允许少量结构性改写(拆段标题等)——阈值 ≤8 行,且打印出来人工可核
|
||||
assert len(missing) <= 8, f"来源外行过多: {missing}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user