feat(smoke): monitor pchome decision preflight
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# PChome 業績成長自動化作戰系統 — AI 競價情報模組 Single Source of Truth
|
||||
|
||||
> **最後更新**: 2026-07-03 (台北時間)
|
||||
> **狀態**: 🟢 四 AI Agent 自動化閉環已落地;LLM 路由紅線升級為 Ollama-first 三主機級聯;PChome 後台業績匯入韌性已補強;產品定位正名為「PChome 業績成長自動化作戰系統」;外部市場來源正規化層、自動同步、作戰清單與價格參考表優先讀取、CSV 備援預檢、前台操作入口、高可見頁面繁中化守門、比價/作戰 UI 工作台化、AI 密集工作台文字密度守門、跨平台來源治理、商品身份 UI 契約、sitewide visual QA runtime readback 與 PChome auto-policy authorization guard monitoring 已建立,GCP embedding 熔斷延後處理、110 proxy rescue 與 direct host health skip 已建立
|
||||
> **適用版本**: V10.726
|
||||
> **狀態**: 🟢 四 AI Agent 自動化閉環已落地;LLM 路由紅線升級為 Ollama-first 三主機級聯;PChome 後台業績匯入韌性已補強;產品定位正名為「PChome 業績成長自動化作戰系統」;外部市場來源正規化層、自動同步、作戰清單與價格參考表優先讀取、CSV 備援預檢、前台操作入口、高可見頁面繁中化守門、比價/作戰 UI 工作台化、AI 密集工作台文字密度守門、跨平台來源治理、商品身份 UI 契約、sitewide visual QA runtime readback、PChome auto-policy authorization guard monitoring 與 decision preflight machine evidence monitoring 已建立,GCP embedding 熔斷延後處理、110 proxy rescue 與 direct host health skip 已建立
|
||||
> **適用版本**: V10.727
|
||||
|
||||
---
|
||||
|
||||
@@ -242,6 +242,7 @@ SQL漏斗(~300筆)
|
||||
- `/ai_automation_smoke` 提供登入後 AI 自動化健康檢查頁。
|
||||
- `/api/ai-automation/smoke` 提供 read-only JSON 狀態,不做外部網路呼叫。
|
||||
- `/api/ai-automation/smoke` 必須包含 `PChome auto-policy authorization guard`:read-only 組裝 PChome auto-policy DB apply guard lane,檢查 no-secret、no-SQL、no-DB-write、machine-verifiable contract、`manual_review_mode=exception_only` 與 `primary_human_gate_count=0`。此 check 不做外部 fetch、不寫 DB、不發 authorization;`/api/ai-automation/scheduled-health-summary` 需輸出 `pchome_auto_policy_authorization_guard` family,`/metrics` 需暴露對應 `momo_ai_automation_scheduled_health_family_status`。
|
||||
- `/api/ai-automation/smoke` 必須包含 `PChome auto-policy decision preflight`:以本機 deterministic machine evidence adapter 推進 `execute_fetch=True` 的 no-write decision preflight ready path,並明確回報 `payload_source=local_contract_fixture`、`machine_fetch_evidence_source=local_schema_fixture`、`outbound_network=false`、`business_data_source=false`、`writes_database_count=0`、`primary_human_gate_count=0`、`ready_for_database_apply_now=false`、`issues_database_apply_authorization=false`。此 check 不讀 secret、不執行 shell/SQL、不寫 DB、不使用外部 PChome 網路、不把 fixture 當商業資料;`/api/ai-automation/scheduled-health-summary` 需輸出 `pchome_auto_policy_decision_preflight` family,`/metrics` 需暴露對應 `momo_ai_automation_scheduled_health_family_status`。
|
||||
- 健康檢查 API 會將最近檢查結果保存到 JSONL,頁面顯示最近狀態趨勢。
|
||||
- 健康檢查歷史支援 JSONL 匯出、清理與每日「正常 / 注意 / 嚴重」摘要。
|
||||
- 健康檢查每日摘要支援手動 Telegram 推播,並由 `momo-scheduler` 每日 09:10 呼叫 `run_ai_smoke_daily_summary_task()`。
|
||||
@@ -844,6 +845,7 @@ POSTGRES_HOST=momo-db
|
||||
| 2026-06-27 | 系統事件頁不得顯示或下載原始工程紀錄 | V10.723 起 `/logs` 改為「系統事件紀錄」,前台只顯示事件等級、營運判讀與建議處置;不得以 raw log 變數、舊下載檔名或「系統日誌/下載日誌」作為使用者可見介面。 |
|
||||
| 2026-06-27 | AI 挑品必須直接顯示商品證據與賣場入口 | V10.724 起商品看板 AI 挑品清單會在 selection 階段合併最新 PChome 同款證據,卡片需顯示 MOMO 商品ID、PChome 商品ID、同款信心與兩邊賣場入口;商品圖需使用 PChome 圖片作為 fallback,不得只給一段建議理由。 |
|
||||
| 2026-06-27 | Google Drive 自動匯入不得在背景排程啟動瀏覽器授權 | V10.725 起正式容器與排程服務即使誤設 `GOOGLE_DRIVE_ALLOW_INTERACTIVE_AUTH=true` 也會硬阻擋互動 OAuth;匯入前會檢查 JSON token 是否存在、可刷新且可寫回,Drive 測試與檔案列表 API 會 fail-closed 回傳可處理的授權狀態。 |
|
||||
| 2026-07-03 | PChome auto-policy decision preflight 必須有 machine evidence runtime monitoring | V10.727 起 `/api/ai-automation/smoke`、`/api/ai-automation/scheduled-health-summary` 與 `/metrics` 必須輸出 `PChome auto-policy decision preflight` / `pchome_auto_policy_decision_preflight`;此 runtime check 使用本機 deterministic schema evidence adapter 與 `payload_source=local_contract_fixture` 自動驗證 `execute_fetch=True` 的 decision preflight ready path,但明確標記 `outbound_network=false`、`business_data_source=false`、`writes_database_count=0`、`primary_human_gate_count=0`,不讀 secret、不執行 SQL、不寫 DB、不發 apply authorization。 |
|
||||
| 2026-06-29 | PChome DB apply 授權 lane 必須先通過 no-write guard / decision preflight / decision closeout / issuer gate / signing-decision preflight / signing-decision closeout / signing-issuer guard | V10.725 的 PChome mapping backlog auto-policy 已新增 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-lane-guard`、`/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-decision-preflight`、`/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-decision-closeout`、`/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-issuer-gate`、`/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-signing-decision-preflight`、`/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-signing-decision-closeout` 與 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-signing-issuer-guard`;這些 endpoint 只驗證 final exact request package、same-run production truth requirement、secret rejection、rollback boundary、lane entry requirements、decision input requirements、rejection policy、post-apply verifier、future authorization decision package、final nonsecret authorization envelope、signing decision preflight inputs、unsigned signing decision package 與 signable request boundary,不讀 secret、不執行 shell/SQL、不寫 DB,也不簽發 database apply authorization。 |
|
||||
| 2026-06-29 | PChome DB apply 授權簽署發行者 lane 必須先產出 final signable request package | V10.725 的 PChome mapping backlog auto-policy 新增 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-signing-issuer-closeout`;此 endpoint 只把 signing-issuer guard 的 signable request boundary 收斂成 final signable request package 與 closeout contract,確認 fresh production truth、post-apply verifier、migration hash、secret boundary 與 no-side-effect checks,不讀 secret、不簽發 authorization、不執行 shell/SQL、不寫 DB,也不代表正式 DB apply 已授權。 |
|
||||
| 2026-06-29 | PChome DB apply 授權簽署執行 lane 必須先通過 operator-held secret boundary preflight | V10.725 的 PChome mapping backlog auto-policy 新增 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-signing-execution-preflight`;此 endpoint 只把 final signable request package 轉成 future signing execution preflight package、operator-held secret boundary contract、nonsecret signing inputs、command-shape preview、rollback boundary 與 abort conditions,不讀 secret、不接受 plaintext secret、不簽發 authorization、不執行 shell/SQL、不寫 DB,也不代表正式 DB apply 已授權。 |
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
以下是使用者在主線推進期間插入、且必須保留在完整工作項目裡的要求。後續不得再把這些需求漏掉或變成口頭提醒。
|
||||
|
||||
1. 正式環境才是最新版本真相;不得用本機檔案、舊筆記、舊分支蓋過 production truth。
|
||||
2. 版本不得搞錯;目前正式環境 `/health` 版本維持 `V10.726`,除非有明確版本 bump、部署與 readback。
|
||||
2. 版本不得搞錯;目前正式環境 `/health` 版本維持 `V10.727`,除非有明確版本 bump、部署與 readback。
|
||||
3. GitHub 全面 freeze;不得使用 GitHub、`gh`、GitHub API、GitHub Actions、PR、issue、mirror 或 read-only GitHub 流程。
|
||||
4. 實作結果必須推到 Gitea `dev` 與 `main`;若改到 runtime 行為,還必須部署到正式環境並回讀。
|
||||
5. 主方向是 AI 自動化,不是人工審核;人工欄位只能當 evidence / ledger / UI truth,不得阻擋低爆炸半徑、可驗證、可回滾的 controlled apply。
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
已完成:
|
||||
|
||||
- 正式環境版本真相 guard:`/health` 是最高真相,目前維持 `V10.726`。
|
||||
- 正式環境版本真相 guard:`/health` 是最高真相,目前維持 `V10.727`。
|
||||
- Gitea `dev` / `main` source truth 對齊。
|
||||
- Retry exception controlled apply executor 已落地,目標表為 `pchome_product_matches`。
|
||||
- 正式 DB 已 controlled apply 4 個 selectors:
|
||||
@@ -92,10 +92,17 @@
|
||||
- `/api/ai-automation/scheduled-health-summary` 已輸出 `pchome_auto_policy_authorization_guard` family
|
||||
- `/metrics` 已輸出 `momo_ai_automation_scheduled_health_family_status{family="pchome_auto_policy_authorization_guard",...}`
|
||||
- 不做外部 fetch、不寫 DB、不發 apply authorization,下一個機器動作是補 machine fetch evidence 與後續 controlled authorization lane
|
||||
- PChome auto-policy decision preflight runtime monitoring 已完成:
|
||||
- `/api/ai-automation/smoke` 已加入 `PChome auto-policy decision preflight`
|
||||
- 以本機 machine evidence adapter 自動推進 `execute_fetch=True` 的 decision preflight ready path
|
||||
- 明確標記 `payload_source=local_contract_fixture`、`outbound_network=false`、`business_data_source=false`、`writes_database_count=0`、`primary_human_gate_count=0`
|
||||
- `/api/ai-automation/scheduled-health-summary` 已輸出 `pchome_auto_policy_decision_preflight` family
|
||||
- `/metrics` 已輸出 `momo_ai_automation_scheduled_health_family_status{family="pchome_auto_policy_decision_preflight",...}`
|
||||
- 不讀 secret、不執行 SQL、不寫 DB、不發 apply authorization,下一個機器動作是 authorization decision closeout lane
|
||||
|
||||
進行中 / 下一步,必須照順序:
|
||||
|
||||
1. 將 auto-policy authorization guard 往下一條 machine-fetch evidence / authorization decision preflight lane 推進。
|
||||
1. 將 auto-policy decision preflight 往 authorization decision closeout lane 推進。
|
||||
|
||||
完成標準:
|
||||
|
||||
@@ -262,7 +269,7 @@
|
||||
|
||||
進行中 / 下一步,必須照順序:
|
||||
|
||||
1. 將 auto-policy authorization guard 補齊 machine fetch evidence,推進到 authorization decision preflight lane。
|
||||
1. 將 auto-policy decision preflight 推進到 authorization decision closeout lane。
|
||||
2. 對其他 safe mapping backlog lanes 套用 receipt / replay / drift verifier 模式。
|
||||
3. 為每一類 controlled apply 自動產生 rollback evidence package。
|
||||
4. 把 AI automation metrics 持續整合進既有 observability surfaces。
|
||||
@@ -335,6 +342,7 @@
|
||||
| P3.3 | Rollback evidence packages | 已完成 | controlled apply rollback evidence route + focused tests | P3.4 observability metrics integration |
|
||||
| P3.4 | Observability metrics integration | 已完成 | `/metrics` exports scheduled health summary gauges + focused tests; AI surface HTML readback now feeds smoke and scheduled health | P3.5 auto-policy guard monitoring |
|
||||
| P3.5 | PChome auto-policy authorization guard monitoring | 已完成 | AI smoke + scheduled family + metrics family read no-write/no-secret/exception-only guard; focused tests | machine fetch evidence / authorization decision preflight lane |
|
||||
| P3.6 | PChome auto-policy machine evidence decision preflight monitoring | 已完成 | AI smoke + scheduled family + metrics family prove local contract fixture, no-network machine evidence, decision preflight ready, no DB write, no human primary gate | authorization decision closeout lane |
|
||||
| P4.1 | Source / deployment / runtime truth package | 已完成 | `scripts/ops/report_source_deploy_runtime_truth.py` + focused tests | 每次 Gitea push / production deploy 後執行 P4 report |
|
||||
| P2.2 | Benchmark guardrails applied to core AI surfaces | 已完成 | `/ai_intelligence` + `/observability/overview` golden-signal strips + focused tests | 後續 safe automation lanes 套同樣 first-viewport summary |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user