From f4af77d261d9e5cf924a9fff1c070bb7728179cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Fri, 18 Sep 2026 17:56:49 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E9=98=B6=E6=AE=B5B=20spec=E7=AC=AC?= =?UTF-8?q?=E5=9B=9B=E8=BD=AE=E4=BF=AE=E6=AD=A3=E2=80=94=E2=80=94mailsent?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E8=A1=A8=E8=BF=B0=E7=BB=9F=E4=B8=80/?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=BD=92=E4=BD=8D=C2=A72/=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E8=A1=8C=E4=B8=8ECF7=E7=89=88=E6=9C=AC=E6=8E=AA=E8=BE=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Code --- .../specs/2026-09-18-collection-phase-b-design.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/superpowers/specs/2026-09-18-collection-phase-b-design.md b/docs/superpowers/specs/2026-09-18-collection-phase-b-design.md index b54e749..f8dc064 100644 --- a/docs/superpowers/specs/2026-09-18-collection-phase-b-design.md +++ b/docs/superpowers/specs/2026-09-18-collection-phase-b-design.md @@ -2,7 +2,7 @@ 日期:2026-09-18 分支:m1 -状态:设计已获用户批准(含两轮自审 17 项修正) +状态:设计已获用户批准(含三轮自审 21 项修正) 依据:gpt/14 §5/§6.2;前置阶段A 已上线(2026-09-18,归属冻结/区间停留/清洗三轨制/契约 v2) 实测基础:hesucar.com 载体盘点(2026-09-18 Playwright)——tel/mailto/wa.me 链接、Contact Form 7 v6.1.6 留言表单(Name/Tel/Message→Inquiry Now)、悬浮聊天组件 @@ -63,7 +63,7 @@ - `EVENT_NAMES` +6:contact_click / form_start / form_error / form_submit / form_submit_result / product_view。 - `EVENT_PROP_WHITELIST` 严格枚举(§1 表格所列键;无自由文本字段)。 -- validate_event 新键校验:`channel` ∈ {whatsapp, phone, email};`result_code` ∈ {mail_sent, mail_failed};`error_code` 短枚举(invalid/spam/other);`submission_id` uuid 或空串;`product_id` slug 格式(复用清洗 `_SAFE_VALUE` 同款正则);`inferred` 布尔;`rule_version` 短 slug。 +- validate_event 新键校验:`channel` ∈ {whatsapp, phone, email};`result_code` ∈ {mail_sent, mail_failed};`error_code` 短枚举(invalid/spam/other);`submission_id` uuid 或空串;`form_id` 格式 `cf7-\d+`;`product_id` slug 格式(复用清洗 `_SAFE_VALUE` 同款正则);`inferred` 布尔;`rule_version` 短 slug。 - 幂等沿 uq_site_event;归属走既有 v2 路径,零新机制。 ## 3. D06 归因扩展(attribution.py + constants.py) @@ -71,7 +71,7 @@ - **优先级重排**:点击参数决定平台性质——fbclid → **paid_social**(Meta 平台本质),gclid/msclkid/yclid → paid_search;utm_medium 仅在无点击参数时参与判定(label_only 证据)。 - `CHANNELS` +`paid_social`;utm_medium 规范化映射(写死):paid_search 强化集 {cpc, ppc, paidsearch, paid}、paid_social 判定集 {social, paid_social, social_ads, paidsocial}(需同时有 fb 家族 utm_source)。 - **`ATTRIBUTION_RULE_VERSION` bump v1→v2** + 历史重算:`recompute_attribution` 管理命令**已存在**(management/commands/recompute_attribution.py,含 --site 参数与既有幂等测试 test_attribution.py:226 可参照),本任务只需 bump 版本 + 新渠道分支测试 + 线上重算执行。 -- `form_id` 服务端格式校验:`cf7-\d+`。 +- fb 家族 utm_source 判定复用既有广告家族归一表(132e2fe 引入的家族映射)。 - admin 中文标签同步:付费社交(渠道徽章/来源分布,grep 全部渠道显示点统一改)。 ## 4. Admin 前端 @@ -100,7 +100,7 @@ spec 附录写死(阶段C 直接照做,客迹侧零改动): ## 6. 验证与部署 -- **CF7 事实核验(实现第一步)**:读 CF7 6.1.6 公开源码(wp-content/plugins/contact-form-7/includes/js/index.js)确认事件 dispatch 名/payload/FormData 时序;Playwright 在 hesucar 空表单提交实测 invalid+submit 路径(无副作用)。**不真提交验证 mailsent**(会给商家发邮件)——按源码实现,上线后以第一封真实询盘闭环验证。 +- **CF7 事实核验(实现第一步)**:读线上 CF7 版本(当前 6.1.6)公开源码(wp-content/plugins/contact-form-7/includes/js/index.js)确认事件 dispatch 名/payload/FormData 时序;Playwright 在 hesucar 空表单提交实测 invalid+submit 路径(无副作用)。开发期不真提交验证 mailsent——按源码实现,**部署后以本节末条的真实测试询盘闭环验证**。 - SDK 单测:点击委托命中/漏判、CF7 事件模拟、submission_id 每次尝试独立、form_start 去重、pattern 匹配、onSegmentChange、track 补归属。 - server 测试:6 新事件校验(枚举/格式)、漏斗 API distinct session 口径、归因 paid_social/utm_medium 分支、规则 v2 重算幂等。 - admin:时间线渲染新事件、漏斗卡数据正确。