強化 P4 source deployment runtime truth 回報
Some checks failed
CD Pipeline / deploy (push) Has been cancelled

This commit is contained in:
ogt
2026-07-02 15:04:41 +08:00
parent 3e83973db3
commit edc3f1fdc3
4 changed files with 585 additions and 0 deletions

View File

@@ -95,6 +95,7 @@
- 2026-07-02 起 AI automation scheduled health summary 必須提供 machine-readable endpoint`/api/ai-automation/scheduled-health-summary` 會只讀 smoke history並可選擇 `include_current_smoke=1` 執行不寫 history 的 current smoke收斂 AI smoke、PChome drift monitor、history freshness、daily summary delivery readiness 四個 family輸出 `primary_human_gate_count=0``writes_database_count=0``next_machine_actions` 與 scheduled output endpoints。此 endpoint 不寄 Telegram、不寫 DB、不改排程只提供排程/監控可消費的健康摘要。
- 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。
- V10.644 起 `/ai_intelligence` 的商品明細列不得只用句子描述比價;每列必須顯示 PChome 價格、MOMO 參考價、差距、可信度四格價格證據,並保留下一步按鈕。單位價候選需顯示單位價與單位,候選待確認或缺資料則以「待補 / 候選待確認」呈現,不得捏造價格。
- V10.645 起 `/ai_intelligence` 的商品明細分流切換後,必須顯示「這類商品怎麼處理」的行動摘要,包含件數、近 7 天業績、平均可信度、最大價差、代表商品與主按鈕;使用者不得只能看到商品列表而不知道下一步。
- V10.646 起 `/ai_intelligence` 的商品明細必須提供搜尋與排序;搜尋至少涵蓋商品、分類、商品編號與 MOMO 候選資訊,排序至少支援優先級、近 7 天業績、價差、下滑幅度與可信度。搜尋/排序後的行動摘要與明細列表必須使用同一批結果。

View File

@@ -198,6 +198,16 @@
- 不意外 bump version。
- 不 recreate / destroy / prune `momo-db`
- source-control success、deployment success、production runtime readback 必須分開回報。
- `scripts/ops/report_source_deploy_runtime_truth.py` 必須可輸出 machine-readable P4 report明確拆開 local / origin / Gitea refs、部署檔案 hash、正式 `/health`、容器狀態與安全紅線。
已完成:
- Source / deploy / runtime truth report 已建立:
- policy: `p4_source_deployment_runtime_truth_v1`
- source truth: local HEAD、origin `main` / `dev`、Gitea SSH `main` / `dev`
- deployment truth: tracked file SHA256 readback
- runtime truth: production `/health` version/status 與 optional container readback
- safety truth: GitHub freeze、`momo-db` protected、no `--remove-orphans`、no secret read、no DB write
完成標準:
@@ -224,6 +234,7 @@
| P3.2 | Scheduled automation health summaries | 已完成 | `/api/ai-automation/scheduled-health-summary` + smoke service focused tests | P3.3 rollback evidence packages |
| 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 | P4 source / deployment governance ongoing |
| P4.1 | Source / deployment / runtime truth package | 已完成 | `scripts/ops/report_source_deploy_runtime_truth.py` + focused tests | 每次 Gitea push / production deploy 後執行 P4 report |
## 後續回報格式