feat(ai): add automation surface summary
Some checks failed
CD Pipeline / deploy (push) Has been cancelled

This commit is contained in:
ogt
2026-07-02 18:47:00 +08:00
parent b69d173f18
commit 5b8e4b3568
10 changed files with 479 additions and 20 deletions

View File

@@ -96,7 +96,7 @@
- 2026-07-02 起 PChome controlled apply rollback evidence 必須提供聚合 endpoint`/api/ai/pchome-growth/mapping-backlog/direct-mapping-retry-candidate-exception-controlled-apply-rollback-evidence-package` 會聚合 receipt replay、drift verifier、drift recovery、compact readback、artifact retention 五類 evidence輸出 rollback required / ready actions / protected chain / next machine action。此 endpoint 不執行 rollback、不執行 re-apply、不執行 SQL、不寫 DB0 drift 時必須輸出 no-op evidencedrift detected 時才輸出 check-mode reapply action。
- 2026-07-02 起 `/metrics` 必須匯出 AI automation scheduled health summary gauges`momo_ai_automation_scheduled_health_summary_total``momo_ai_automation_scheduled_health_family_status``momo_ai_automation_scheduled_health_primary_human_gate_count``momo_ai_automation_scheduled_health_writes_database_count`。Prometheus scrape 不得寄 Telegram、不寫 DB、不執行 current smoke只讀 scheduled health summary history。
- 2026-07-02 起 P4 source / deployment governance 必須提供 machine-readable report`scripts/ops/report_source_deploy_runtime_truth.py` 會分層輸出 Gitea / origin / local HEAD source truth、部署檔案 SHA256 readback、正式 `/health` runtime truth、optional container readback 與 GitHub freeze / `momo-db` protected / no DB write / no secret read 安全紅線。此 report 是推 Gitea 與正式部署後的 P4 收斂證據,不得把 source-control success 直接等同 deployment success 或 production runtime success。
- 2026-07-02 起 `/ai_intelligence``/observability/overview` 必須同樣套用 AI automation benchmark golden signals首屏需有 `AI 自動化狀態` 區塊,直接顯示「已自動落地、已驗證、異動狀態、下一步」。`/ai_intelligence` 需以 `/api/ai/pchome-growth/ai-automation-readiness` 只讀更新狀態`/observability/overview` 需用正式觀測資料分層呈現風險與下一步。raw endpoint、artifact、DB table、manual/human gate 文字不得進首屏訊號。
- 2026-07-02 起 `/ai_intelligence``/observability/overview` 必須同樣套用 AI automation benchmark golden signals首屏需有 `AI 自動化狀態` 區塊,直接顯示「已自動落地、已驗證、異動狀態、下一步」。`/ai_intelligence` 需以 `/api/ai/pchome-growth/ai-automation-surface-summary` 只讀更新首屏,該 endpoint 由 `/api/ai/pchome-growth/ai-automation-readiness` 聚合 safe lanes 後輸出 `golden_signals``safe_automation_lanes``surface_contract``primary_human_gate_count=0``writes_database_count=0``next_machine_action``/observability/overview` 需用正式觀測資料分層呈現風險與下一步。raw endpoint、artifact、DB table、manual/human gate 文字不得進首屏訊號。
- V10.644 起 `/ai_intelligence` 的商品明細列不得只用句子描述比價;每列必須顯示 PChome 價格、MOMO 參考價、差距、可信度四格價格證據,並保留下一步按鈕。單位價候選需顯示單位價與單位,候選待確認或缺資料則以「待補 / 候選待確認」呈現,不得捏造價格。
- V10.645 起 `/ai_intelligence` 的商品明細分流切換後,必須顯示「這類商品怎麼處理」的行動摘要,包含件數、近 7 天業績、平均可信度、最大價差、代表商品與主按鈕;使用者不得只能看到商品列表而不知道下一步。
- V10.646 起 `/ai_intelligence` 的商品明細必須提供搜尋與排序;搜尋至少涵蓋商品、分類、商品編號與 MOMO 候選資訊,排序至少支援優先級、近 7 天業績、價差、下滑幅度與可信度。搜尋/排序後的行動摘要與明細列表必須使用同一批結果。

View File

@@ -80,11 +80,14 @@ Baymard 的商品頁與比較 UX 研究強調:使用者需要清楚的 product
3. 將 PPT / AI payload 的比價項目拆成 identity evidence 與 offer evidence。
4. 每週 benchmark 結果若命中上述 TODO回寫 `TODO_NEXT_STEPS.txt` 或新增 ADR / memory。
5. 將 PChome AI automation benchmark guardrails 套到後續 AI Agent surfaces 與每條 safe automation lane 的 first-viewport summary。
- 已完成: `/api/ai/pchome-growth/ai-automation-surface-summary``golden_signals` 固化「已自動落地、已驗證、異動狀態、下一步」。
- 已完成: `/ai_intelligence` 首屏直接消費 surface summaryraw receipt / hash / DB table / endpoint 細節留在 evidence-on-demand 層。
## 參考來源
- Google Merchant Center Product data specification: https://support.google.com/merchants/answer/7052112
- Google Search Central Product structured data: https://developers.google.com/search/docs/appearance/structured-data/product
- Google SRE The Four Golden Signals: https://sre.google/sre-book/monitoring-distributed-systems/
- Schema.org Product / Offer / AggregateOffer: https://schema.org/Product, https://schema.org/Offer, https://schema.org/AggregateOffer
- Baymard Product Page UX Best Practices: https://baymard.com/blog/current-state-ecommerce-product-page-ux
- Baymard Product Comparison UX: https://baymard.com/blog/provide-comparison-features

View File

@@ -163,6 +163,8 @@
- 已完成: 兩頁都明確呈現「已自動落地、已驗證、異動狀態、下一步」。
- 已完成: `tests/test_ai_surface_benchmark_guardrails.py` 鎖住 DOM、下一步優先與 evidence-on-demand wording。
2. 為後續 safe automation lanes 建立同樣的 first-viewport summary。
- 已完成: `/api/ai/pchome-growth/ai-automation-surface-summary` 會把 readiness safe lanes 收斂成 `golden_signals``safe_automation_lanes``surface_contract``next_machine_action` 與 no-write 安全欄位。
- 已完成: `/ai_intelligence` 首屏改吃 surface summary不再自行拼接 receipt replay / drift verifier 欄位。
完成標準: