chore: 服务端品牌与行业残留更名清零(HESUPIPE/DB名/redis字段)

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-29 18:29:07 +08:00
parent 528b81b192
commit f0af1cfe8e
12 changed files with 24 additions and 28 deletions
+3 -3
View File
@@ -198,7 +198,7 @@ def test_asks_contact_fragment_followup_still_pass():
def test_warranty_commitment_violates():
# 政策变更(2026-09-10 用户定调: 不清楚的留资转经理): AI 输出的保修期限
# 是编造的公司政策承诺——从"白名单放行"改为墙级违规
assert violates_boundary("we offer 6 months warranty on every car")
assert violates_boundary("we offer 6 months warranty on every pipe")
assert violates_boundary("battery has 8 years warranty") # year 靠定向模式
assert violates_boundary("warranty of 8 years on battery") # EN 倒装
assert violates_boundary("电池保修8个月")
@@ -214,9 +214,9 @@ def test_chinese_time_commitment_violates():
def test_age_and_year_talk_still_clean():
# 误杀防护: 二手车龄/车型年款/无数字保修讨论必须放行(实证 13 条全清)
# 误杀防护: 库货年限/年款/规格数字/无数字保修讨论必须放行(实证 13 条全清)
assert not violates_boundary("under 5 years old")
assert not violates_boundary("5 years old car")
assert not violates_boundary("5 years old stock pipe")
assert not violates_boundary("2024年款")
assert not violates_boundary("5座SUV")
assert not violates_boundary("600km续航")
+2 -2
View File
@@ -123,7 +123,7 @@ def test_scan_wa_me_link():
def test_scan_ignores_prices_years_and_ai_messages():
texts = m(
"budget $25,000 for 2024 BYD Tang", # 价格+年份
"budget $25,000 for 2024 PE100 pipes", # 价格+年份
"50,000 km mileage", # 里程
"I want 5 units", # 数量
)
@@ -221,7 +221,7 @@ def test_recency_kills_extractor_oscillation():
before = {"phone": "+8613800138004", "whatsapp": "+8613800138004"}
after = {"phone": "+8613800138000", "whatsapp": "+8613800138004"} # extractor 振荡
msgs = _u("my whatsapp is +8613800138000", "my whatsapp is +8613800138004",
"any car talk")
"any pipe talk")
assert resolve_by_recency(before, after, msgs) == before # 无变化→不触发更正
+3 -3
View File
@@ -132,7 +132,7 @@ def test_no_contact_never_emails_and_marks_stuck(async_db, monkeypatch):
# D8: interested+无联系方式 → 不发邮件,upsert Evaluation 卡单记录
(manager, conv), sent = _setup(async_db, monkeypatch,
ai=_mk_ai({}, evaluate=INTERESTED))
for text in ("hi", "kenya", "20k budget", "byd tang"):
for text in ("hi", "kenya", "20k budget", "pe100 pipe"):
asyncio.run(_send(manager, conv.session_id, text))
assert sent == []
@@ -263,7 +263,7 @@ def test_oscillation_does_not_burn_correction_quota(async_db, monkeypatch):
ai = FakeAI(extract=seq)
(manager, conv), sent = _setup(async_db, monkeypatch, ai=ai)
texts = ["my whatsapp is +8613800138000", "my whatsapp is +8613800138004",
"什么车好", "再说", "还有吗", "18325698745"]
"哪种管好", "再说", "还有吗", "18325698745"]
for t in texts:
asyncio.run(_send(manager, conv.session_id, t))
kinds = [s[0] for s in sent]
@@ -464,7 +464,7 @@ def test_evaluation_upsert_keeps_flags_and_intent(async_db, monkeypatch):
def test_reminder_boundary_redline_on_price_question():
text = ConversationManager._build_context_reminder(
{}, "how much is the BYD Tang?", [])
{}, "how much is the DN800 pipe?", [])
assert "职能边界" in text and "禁止" in text