feat(growth): automate Yahoo same-item offer canary
Some checks failed
CD Pipeline / deploy (push) Has been cancelled

This commit is contained in:
ogt
2026-07-15 12:43:24 +08:00
parent f3f23a3b1c
commit 4670f80f98
26 changed files with 3097 additions and 45 deletions

View File

@@ -1,8 +1,18 @@
# PChome 業績成長自動化作戰系統 — AI 競價情報模組 Single Source of Truth
> **最後更新**: 2026-07-15 (台北時間)
> **狀態**: 🟠 Partial。V10.799 已在 production 以 exact Gitea object `01329c7048ffb54d7f323e84d8c9de086eb1cd68` 運行。`pchome_comparison_coverage_v3` 把 TOP50 固定為 action-priority scoring 前的營收排名母體mapping 狀態不再把已完成商品擠出分母production 最終 readback 為 `21/50 = 42%` 商品覆蓋與 `NT$180,667 / NT$354,062 = 51.0%` 業績覆蓋,母體 fingerprint `7b74504fcc1e1801c2ca2b42` 在三輪 bounded run 前後不變。仍有 `1` 件候選驗證、`28` 件未對應,外部平台 runtime 仍僅 `1/15`。SEC-P0-001 已完成 production closureSEC-P0-002 維持 production hybrid canary-readyfull asset reconciliation、software supply chain、統一 controlled-apply envelope、restore drill、internal RAG canary 與 MCP/RAG runtime closure 尚未全部完成。任何局部 receipt 不得代表整體閉環完成。
> **適用版本**: V10.799 source + production runtimeGitea Action #1131 仍因 `ewoooc-host` runner 離線而未提供 CD 執行證據
> **狀態**: 🟠 Partial。V10.799 已在 production 以 exact Gitea object `01329c7048ffb54d7f323e84d8c9de086eb1cd68` 運行。`pchome_comparison_coverage_v3` 把 TOP50 固定為 action-priority scoring 前的營收排名母體mapping 狀態不再把已完成商品擠出分母production 最終 readback 為 `21/50 = 42%` 商品覆蓋與 `NT$180,667 / NT$354,062 = 51.0%` 業績覆蓋,母體 fingerprint `7b74504fcc1e1801c2ca2b42` 在三輪 bounded run 前後不變。V10.800 Yahoo Shopping structured adapter 已完成 source candidateworkstation regression 為 `2,105 passed / 9 skipped / 0 failed`,但尚未部署或改變 production KPI正式外部平台 runtime 仍僅 `1/15`。SEC-P0-001 已完成 production closureSEC-P0-002 維持 production hybrid canary-readyfull asset reconciliation、software supply chain、統一 controlled-apply envelope、restore drill、internal RAG canary 與 MCP/RAG runtime closure 尚未全部完成。任何局部 receipt 不得代表整體閉環完成。
> **適用版本**: V10.799 production runtime + V10.800 source candidateGitea Action #1131 仍因 `ewoooc-host` runner 離線而未提供 CD 執行證據
---
## 零之負四、Yahoo Shopping 公開結構化同品 canaryV10.800 source candidate
- Yahoo 搜尋只解析公開頁面的 `script#isoredux-data`,商品頁只解析 schema.org `Product` / `Offer` JSON-LDPChome 目標商品則由公開 JSONP product API 回讀 `Name``Spec``Price``Qty`。所有 URL 都受 HTTPS host/path allowlist、回應大小、timeout、查詢數、detail 數與 request interval 約束,不讀登入 cookie/session也不繞過平台阻擋。
- 正式候選必須同時通過 search/detail product ID 一致、TWD 正價、PChome current price、雙方庫存有證據時、PChome Spec 出現在來源標題、非「任選/多款/可選」、非括號多規格組、deterministic exact same-item matcher 與獨立 DB post-verifier。只有 exact offer 能寫 `external_offers`;其餘候選只留 receipt不因 KPI 壓力放寬 matcher。
- Controlled apply 強制先做零寫入 check-mode再以同一 `trace_id/run_id/work_item_id` bounded execute至少兩筆 exact offer 全數獨立回讀成功後,才一次啟用 `active + enabled + write_enabled`。來源尚未啟用但 post-verifier 失敗時也會 quarantine 同 run rowactivation 後失敗則同時還原 source state不刪除歷史資料。compact atomic receipt 由 scheduler 每六小時更新API/CLI 與 UI 分開顯示正式來源、候選證據與任何 runtime evidence。
- 最新 workstation 公開 live no-write probe 對 OBgE、Amywo、Lancome、Sebamed 取得三筆 in-stock source-guard/total-price exact 候選Lancome 因 Yahoo 明確 `ec_has_stock=0` 被阻擋。Critic 另以 Estee 色號、Armani 色號及 Gatsby 香型做反例;唯一曾漏過的括號多規格 listing 已加 guardGatsby 聚焦重跑的三筆候選全數阻擋。PChome sales-report fallback 不得冒充 current public price公開 HTTP 採真正 bounded streaming。這些都是 source validation不是 production DB、正式 coverage 或平台 activation 證據。
- Production 仍為 V10.799、`21/50` 商品覆蓋、`51.0%` 業績覆蓋與 `1/15` 正式平台 runtime。V10.800 已通過 `2,105 passed / 9 skipped / 0 failed` 完整 regression剩餘 exit 必須依序完成 Gitea main/dev、部署 readback、production check-mode、bounded canary、獨立 DB verifier、TOP50 fingerprint/KPI delta、三應用容器健康與 `momo-db` identity unchanged。
---

View File

@@ -1,6 +1,6 @@
# AI Automation Mainline Work Items
> Updated: 2026-07-15 10:48 Asia/Taipei
> Updated: 2026-07-15 12:39 Asia/Taipei
> Governance: `global_product_governance_v2` + ADR-038
> Current P0: `GROWTH-P0-001 comparison coverage truth + autonomous refresh`
@@ -17,7 +17,7 @@
| Order | ID | Status | Work item | Exit evidence / next machine action |
|---:|---|---|---|---|
| 1 | `SEC-P0-001` | Completed | Deny-by-default route access control | `governance/evidence/SEC-P0-001-20260711T122758Z.json` plus the current runtime receipt prove anonymous matrix 8/8 denied, public `/metrics` 404, exact internal target up, EwoooC product markers present, Prometheus identity preserved and `momo-db` unchanged. |
| 2 | `GROWTH-P0-001` | In progress (`runtime_partial`) | Comparison coverage truth + autonomous refresh | V10.799 is live. `pchome_comparison_coverage_v3` fixes TOP50 membership before action-priority scoring; fingerprint `7b74504fcc1e1801c2ca2b42` stayed unchanged across all bounded runs. Final production truth is `21 ready + 1 candidate validation + 28 unmatched`, count coverage `42%`, and revenue coverage `NT$180,667 / NT$354,062 = 51.0%`. Two productive runs independently wrote/read back `3 + 2` verified MOMO offers; the next run found 9 candidates but safely closed `no_write_verified` with 8/8 durable target receipts. Sales date `2026-07-13` remains decision-ready inside the `2026-07-15 20:00` arrival SLA; source readiness remains `1/4` and registered platform runtime remains `1/15`. Next: retry the remaining 28 unmatched products only after fresh source evidence, while advancing Lane C structured platform adapters and continuously verifying Lane A report arrival. |
| 2 | `GROWTH-P0-001` | In progress (`runtime_partial`) | Comparison coverage truth + autonomous refresh | V10.799 is live. `pchome_comparison_coverage_v3` fixes TOP50 membership before action-priority scoring; fingerprint `7b74504fcc1e1801c2ca2b42` stayed unchanged across all bounded runs. Final production truth is `21 ready + 1 candidate validation + 28 unmatched`, count coverage `42%`, and revenue coverage `NT$180,667 / NT$354,062 = 51.0%`. V10.800 source candidate adds a bounded Yahoo Shopping public structured adapter, enforced zero-write check-mode, exact same-item guards, independent DB verifier, automatic activation/rollback, six-hour scheduler and formal-versus-candidate UI evidence. Final regression is `2,105 passed / 9 skipped / 0 failed`; latest four-target live no-write probe produced three exact in-stock candidates and correctly blocked one explicit out-of-stock Lancome offer. Next: merge through Gitea, deploy V10.800 and execute the bounded production canary before updating any runtime KPI. |
| 3 | `SEC-P0-002` | In progress (`canary_ready`) | Database identity + least-privilege RBAC | V10.789 is live and `governance/auth_identity_runtime_receipt.json` verifies required tables, two active admins, durable lockout, session revocation, trusted proxy policy and no-secret mutation audit readiness. Runtime is intentionally hybrid because zero database-admin success receipts have been captured; `auto` retires shared authority after two durable successes without a manual review gate. Next: capture database-admin login receipts and verify automatic database-only cutover. |
| 4 | `SEC-P0-003` | In progress | Webhook trust and replay protection | Telegram secret-token verification code exists; production secret activation remains unproven. Exit: secret provisioned outside source, required mode enabled, invalid-secret 401 and authorized callback canary pass. |
| 5 | `SUPPLY-P0-001` | In progress | Gitea-only secure software supply chain | Gitea-native checkout, secret-safe `.dockerignore`, commit-bound source receipt and governance gate are active. Exit: exact dependency lock, internal SAST/SCA/secret scan, SBOM, image digest/provenance, vulnerability SLA and production digest readback. |
@@ -36,7 +36,7 @@ These lanes are one ordered current P0, not optional side work. They must advanc
|---|---|---|---|
| A. Sales freshness | In progress (`sla_runtime_closed_source_redundancy_partial`) | Latest sales date `2026-07-13`; before the `2026-07-15 20:00` cutoff, raw lag is `2` but SLA lag is `0`, state is `grace` and decisions remain released. Scheduler receipt `0f24219e0bbb4740b7ad6645e7952296` and explicit canary receipt `6e2df008f65544fe8e557c11ff0dbb93` both persisted `completed_no_write`; durable decision is `no_candidate_fresh_no_write`. Live and persisted readiness now agree at Google Drive `1/4`; HTTPS, IMAP and local remain disabled. | Continue automatic report-arrival reconciliation. At/after 20:00 require `2026-07-14` or automatically block decision use, emit the bounded upstream action and verify the next arrival receipt; keep source redundancy partial until another approved source is live. |
| B. Verified same-item evidence | In progress | TOP50 fixed cohort: `21` verified, `1` candidate/source validation, `28` unmatched. Count coverage is `42%`; revenue-weighted coverage is `NT$180,667 / NT$354,062 = 51.0%`. V10.797 outer-pack false exact candidates were quarantined without deletion; V10.798 normalizes nested quantity, and V10.799 prevents mapping status from changing cohort membership. Runs `58bb702057284cd382c82314b418d713` and `cb40a5dcdaa045c69bf9611ebb13bba2` wrote/read back five verified offers; run `14d4aac64d434e34bfbd0f0edb7ef1eb` closed no-write after zero safe candidates. | Wait for fresh source evidence before retrying the same unresolved subset, broaden approved structured platform adapters, preserve deterministic identity/unit/variant gates, and publish both count and revenue coverage deltas with the same scope fingerprint per run. |
| C. Platform runtime coverage | In progress | `1/15` registered external sources currently contributes formal runtime data (`6.7%`). PixelRAG remains evidence-only. | Activate approved structured adapters in source-contract order, use PixelRAG/OCR/VLM only to generate replayable candidates, classify anti-bot pages as blocked evidence, and require provenance/freshness/verifier receipts before formal price promotion. |
| C. Platform runtime coverage | In progress (`source_candidate_ready`) | Production remains `1/15` registered external sources with formal runtime data (`6.7%`); PixelRAG remains evidence-only. V10.800 source adds the first additional structured adapter for Yahoo Shopping and has three current in-stock exact candidates, but no production activation or KPI gain is claimed yet. | Deploy through Gitea, run Yahoo check-mode then bounded execute, require at least two exact offers with independent DB readback before atomically enabling `active + enabled + write_enabled`, and roll back/quarantine same-run rows on any failed post-verifier. |
## P1
@@ -49,8 +49,8 @@ These lanes are one ordered current P0, not optional side work. They must advanc
| 16 | `ARCH-P1-001` | In progress | Split oversized policy/executor/verifier modules | Current top debts include 44k-line PChome mapping and 14k-line smoke service. Split by bounded family and independent tests. |
| 17 | `UX-P1-001` | In progress | Professional full-site UI/UX | V10.799 production template leads with `業績比價覆蓋`, now backed by 51.0% revenue coverage and 21/50 product transparency instead of the old unqualified 10% card. Mapping and automation evidence remain structured grids with progressive disclosure, and the first viewport distinguishes calendar lag from report-arrival SLA. Existing V10.795 desktop/mobile overflow smoke remains valid for layout; this release still needs a fresh authenticated production screenshot before visible closure is claimed. Continue the same first-viewport, progressive-disclosure, accessibility and state coverage across every remaining primary page. |
| 18 | `PIXELRAG-P1-001` | Not started | Ollama-first multimodal embedding benchmark | Verify approved visual embedding on GCP-A -> GCP-B -> 111 and design pgvector-compatible visual metadata; FAISS remains disallowed without ADR. |
| 19 | `MARKET-P1-001` | In progress | Marketplace source contracts | Finish stable, public-boundary, provenance and rate-limit contracts for Shopee, Coupang, Yahoo, ETMall, Friday and Rakuten; blocked pages remain non-product data. |
| 20 | `QA-P1-001` | In progress | Deterministic test and CI governance | V10.799 final source baseline is `2,089 passed / 9 skipped / 0 failed`; focused cohort/reconciliation scope is `37 passed`, Ruff and diff checks are clean. Production exact-object hashes, external health, fixed cohort fingerprint, two positive bounded runs and one no-write run all have readback evidence. Action #1131 remains waiting without runner execution, so CI parity is not claimed. Next: reproduce the same terminal in Gitea CI after runner recovery, split deterministic release tests from nightly integration and production canaries, and prevent workstation disk pressure from invalidating evidence. |
| 19 | `MARKET-P1-001` | In progress | Marketplace source contracts | Yahoo Shopping has a V10.800 source candidate with public-boundary allowlists, bounded timeout/bytes/rate, provenance, current product-detail readback, stock/spec/variant guards and controlled canary. Production activation remains pending; Shopee, Coupang, ETMall, Friday and Rakuten still require equivalent structured contracts, and blocked pages remain non-product data. |
| 20 | `QA-P1-001` | In progress | Deterministic test and CI governance | V10.800 workstation source baseline is `2,105 passed / 9 skipped / 0 failed`; the final focused Yahoo, source-readiness, same-item rollback and modularization scope is `62 passed`. This is source/test evidence only. V10.799 production exact-object hashes, external health and fixed cohort fingerprint remain the runtime baseline; Action #1131 remains waiting without runner execution, so CI parity and V10.800 deployment are not yet claimed. Next: reproduce the terminal through Gitea or bounded exact-object fallback, then run the production Yahoo canary and post-verifier. |
## P2