chore(dev): sync ewoooc development workbench state
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
| `schema_inventory_baseline.md` | DB 表分類與 drift 基線 | 要收斂 migration / ORM / raw SQL 真相時 |
|
||||
| `frontend_v3_handoff_20260512.md` | 前端 V3 守門落地、正式部署、UI/UX 響應式缺口與接續順序 | 新 session 接續前端 V3 全站 UI/UX、手機版確認、`/daily_sales` 或 `/edm` 修正與部署時 |
|
||||
| `claude_inventory_validation_20260513.md` | Claude Code V1/V2 盤點逐項驗證、已修項與不可盲動清單 | 接續盤點整改、判斷某項是否仍是阻擋、避免重複清已修項時 |
|
||||
| `production_version_truth_20260627.md` | 正式環境 `/health` 作為最新版本真相,避免 local/Gitea/iCloud drift 誤判 | 開工、部署前、handoff 或任何版本宣稱前 |
|
||||
| `pchome_mapping_backlog_20260628.md` | PChome growth API 的商品對應缺口只讀盤點、mapping rate 與下一步順序 | 接續 PChome 商品對應率、正式 API readback、mapping backlog 優化時 |
|
||||
|
||||
## 關聯 Guide
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
- Python 總量:約 139,476 行(排除 `venv/`、`backups/`、`__pycache__/`、`.claude/worktrees/`)。
|
||||
- 最大壓力區:`services/` 約 84,159 行、`routes/` 約 36,245 行。
|
||||
- `app.py` 目前約 1,232 行,功能定位應固定為 bootstrap / Blueprint registration / startup guard,不再承接新 route。
|
||||
- 目前工作樹仍有 33 個 Python 檔案達到或超過 800 行;這些不是禁止修 bug,而是禁止繼續塞新功能。
|
||||
- 目前工作樹仍有 42 個 Python 檔案達到或超過 800 行;這些不是禁止修 bug,而是禁止繼續塞新功能。
|
||||
- 2026-05-05 追記:Phase 38→56 觀測台戰役讓 `routes/admin_observability_routes.py` 與 `run_scheduler.py` 進入大檔治理清單;後續觀測台功能應先抽 query/action service,不再把新 SQL 與 L2 mutation 直接塞回 route。
|
||||
- 2026-05-06 追記:跨平台市場情報模組啟動前,必須先把新增爬蟲、排程、DB schema、UI route 全部隔離在 `market_*` / `services/market_intel/` / `routes/market_intel_routes.py`,不可塞回既有大檔。
|
||||
- 2026-05-18 追記:Phase 42 市場情報只在 `app.py` 的 `EXPECTED_METADATA_TABLES` 補上 `market_alert_review_queue` 名稱,未新增 route / bootstrap 邏輯;後續仍應把 metadata verification 抽到 app factory 或 startup guard module,避免 `app.py` 繼續承接功能。
|
||||
@@ -71,46 +71,56 @@
|
||||
- 2026-05-24 追記:同步 PChome review queue 決策信封合併後的 `services/competitor_intel_repository.py` 行數;此處只更新 inventory,不變更拆分策略。
|
||||
- 2026-05-25 追記:同步背景 embedding 讀取 `host_health_probes` skip guard 後的 `services/ollama_service.py` 行數;此處只更新 inventory,不變更 Ollama 路由決策。
|
||||
- 2026-05-29 追記:同步 PChome near-threshold / focused identity 回收系列後的 `services/marketplace_product_matcher.py` 行數;此處只更新 inventory,不變更拆分策略。
|
||||
- 2026-06-29 追記:同步 AI 自動化例外決策、PChome mapping backlog 與 market intel alias work 後的 >800 行檔案清單;此處只更新 inventory,不變更拆分策略。
|
||||
- 2026-06-29 追記:同步 market intel AI-controlled canonical route aliases 後的 route extension 行數;`routes/market_intel_mcp_run_routes.py` 與 `routes/market_intel_review_post_routes.py` 進入 800 行治理清單,下一步新增 route alias 應優先抽 route registration helper,避免 extension 檔繼續膨脹。
|
||||
- 2026-06-29 追記:同步 market intel review/report endpoint compatibility migration 後的 route extension 行數;`routes/market_intel_review_routes.py` 進入 800 行治理清單,下一步應抽 `market_intel_review_route_registration.py` 或 declarative endpoint map,避免 decorator 重複擴張。
|
||||
|
||||
## 達到或超過 800 行檔案清單
|
||||
|
||||
| 行數 | 檔案 | 分類 | 拆分方向 |
|
||||
|---:|---|---|---|
|
||||
| 9225 | `routes/openclaw_bot_routes.py` | P0 巨型 Blueprint | route / bot command service / report service / scheduler hook;禁止再新增市場情報入口 |
|
||||
| 5499 | `services/ppt_generator.py` | P0 報表生成巨型 service | deck orchestration / slide builders / chart builders / report type registry |
|
||||
| 3186 | `routes/sales_routes.py` | P0 巨型 Blueprint | page routes / API routes / chart query service / calendar service;分析頁新增功能先抽 `services/sales/` |
|
||||
| 2973 | `scheduler.py` | P0 排程總管 | task registry / crawler jobs / report jobs / notification jobs;市場情報只能透過獨立 job module 掛入 |
|
||||
| 2731 | `services/openclaw_strategist_service.py` | P0 OpenClaw service | prompt builders / report composer / strategy rules |
|
||||
| 3681 | `routes/admin_observability_routes.py` | P0 觀測台巨型 Blueprint | `services/observability_query_service.py` / `services/observability_action_service.py` / route glue |
|
||||
| 1796 | `routes/ai_routes.py` | P1 AI Blueprint | route glue / AI orchestration service / prompt builders |
|
||||
| 2154 | `services/nemoton_dispatcher_service.py` | P1 NemoTron service | NIM client / tool-call parser / action dispatcher |
|
||||
| 2535 | `routes/dashboard_routes.py` | P1 Dashboard Blueprint | competitor decision overview / dashboard query service;首頁資料整併需抽 service |
|
||||
| 1485 | `routes/vendor_routes.py` | P1 Vendor Blueprint | route glue / stockout mutation/email;V2 page query、stockout list/batches API query、vendor list/detail query 已抽到 `services/vendor_stockout_query_service.py` |
|
||||
| 1390 | `services/telegram_bot_service.py` | P1 Telegram service | command handlers / message formatters / bot client |
|
||||
| 1237 | `app.py` | P1 bootstrap | 保持只做 app setup;繼續往 app_factory / extension setup 抽;Phase 42 只做 metadata table name 對齊 |
|
||||
| 2149 | `services/elephant_alpha_autonomous_engine.py` | P1 ElephantAlpha engine | HITL / executor / planning policy |
|
||||
| 970 | `routes/cicd_routes.py` | P2 CI/CD Blueprint | route glue / CI query service / deployment action service |
|
||||
| 1250 | `run_scheduler.py` | P2 scheduler entrypoint | observability jobs / token report jobs / task registration 分離 |
|
||||
| 916 | `services/ppt_auto_generation_service.py` | P2 PPT 自動產線 service | schedule resolver / generation queue / missing report planner |
|
||||
| 9424 | `routes/openclaw_bot_routes.py` | P0 巨型 Blueprint | route / bot command service / report service / scheduler hook;禁止再新增市場情報入口 |
|
||||
| 8689 | `services/pchome_mapping_backlog_service.py` | P0 PChome mapping backlog service | mapping backlog / evidence receipt / controlled apply package 分拆到 `services/pchome_mapping/` |
|
||||
| 5865 | `services/marketplace_product_matcher.py` | P2 marketplace matcher | identity parsing / unit-comparable scoring / search term quality / persistence normalization |
|
||||
| 5513 | `services/ppt_generator.py` | P0 報表生成巨型 service | deck orchestration / slide builders / chart builders / report type registry |
|
||||
| 4398 | `routes/ai_routes.py` | P1 AI Blueprint | route glue / AI orchestration service / prompt builders |
|
||||
| 4152 | `routes/admin_observability_routes.py` | P0 觀測台巨型 Blueprint | `services/observability_query_service.py` / `services/observability_action_service.py` / route glue |
|
||||
| 3763 | `services/competitor_price_feeder.py` | P2 competitor price feeder | crawler scheduling / price normalization / retryable candidate recovery / cache strategy |
|
||||
| 3290 | `routes/sales_routes.py` | P0 巨型 Blueprint | page routes / API routes / chart query service / calendar service;分析頁新增功能先抽 `services/sales/` |
|
||||
| 3125 | `routes/dashboard_routes.py` | P1 Dashboard Blueprint | competitor decision overview / dashboard query service;首頁資料整併需抽 service |
|
||||
| 3107 | `scheduler.py` | P0 排程總管 | task registry / crawler jobs / report jobs / notification jobs;市場情報只能透過獨立 job module 掛入 |
|
||||
| 2961 | `services/openclaw_strategist_service.py` | P0 OpenClaw service | prompt builders / report composer / strategy rules |
|
||||
| 2383 | `services/competitor_intel_repository.py` | P2 competitor intel repository | review queue query / cache shaping / formatting helpers |
|
||||
| 2332 | `services/elephant_alpha_autonomous_engine.py` | P1 ElephantAlpha engine | AI exception policy / executor / planning policy |
|
||||
| 2166 | `services/nemoton_dispatcher_service.py` | P1 NemoTron service | NIM client / tool-call parser / action dispatcher |
|
||||
| 2017 | `services/market_intel/deployment_readiness.py` | P2 market intel deployment readiness | preflight gates / readiness payload / route contract helpers |
|
||||
| 1956 | `services/external_market_offer_service.py` | P2 external offer service | offer ingestion / freshness / quality normalization 分離 |
|
||||
| 1658 | `routes/market_intel_review_report_routes.py` | P2 market intel review report Blueprint | review report route glue / export payload / phase handoff orchestration |
|
||||
| 1494 | `routes/vendor_routes.py` | P1 Vendor Blueprint | route glue / stockout mutation/email;V2 page query、stockout list/batches API query、vendor list/detail query 已抽到 `services/vendor_stockout_query_service.py` |
|
||||
| 1456 | `services/ollama_service.py` | P2 Ollama client | host health / request client / fallback policy / response parsing |
|
||||
| 1417 | `services/telegram_templates.py` | P2 Telegram templates | alert template groups / channel-specific formatting / reusable render helpers |
|
||||
| 1394 | `services/telegram_bot_service.py` | P1 Telegram service | command handlers / message formatters / bot client |
|
||||
| 1385 | `services/import_service.py` | P2 import service | validators / import writers / report builders |
|
||||
| 1306 | `run_scheduler.py` | P2 scheduler entrypoint | observability jobs / token report jobs / task registration 分離 |
|
||||
| 1271 | `services/code_review_pipeline_service.py` | P2 Code review pipeline service | scan orchestration / finding normalization / persistence adapter |
|
||||
| 1255 | `app.py` | P1 bootstrap | 保持只做 app setup;繼續往 app_factory / extension setup 抽;Phase 42 只做 metadata table name 對齊 |
|
||||
| 1188 | `services/ppt_auto_generation_service.py` | P2 PPT 自動產線 service | schedule resolver / generation queue / missing report planner |
|
||||
| 1023 | `routes/cicd_routes.py` | P2 CI/CD Blueprint | route glue / CI query service / deployment action service |
|
||||
| 1014 | `routes/daily_sales_routes.py` | P2 Daily Sales Blueprint | route glue / export helpers / daily query and formatting service |
|
||||
| 1013 | `routes/export_routes.py` | P2 Export flow | export command/router glue / file path / download orchestration |
|
||||
| 966 | `services/trend_crawler.py` | P2 crawler service | source adapters / parser / persistence |
|
||||
| 942 | `services/learning_pipeline.py` | P2 RAG learning pipeline | distiller / promotion gate / persistence / telemetry |
|
||||
| 940 | `services/import_service.py` | P2 import service | validators / import writers / report builders |
|
||||
| 1071 | `services/telegram_templates.py` | P2 Telegram templates | alert template groups / channel-specific formatting / reusable render helpers |
|
||||
| 941 | `services/pchome_revenue_growth_service.py` | P2 PChome revenue growth service | growth aggregation / mapping backlog handoff / source adapter 分離 |
|
||||
| 931 | `services/pchome_crawler.py` | P2 PChome crawler | search fetch / parsing / fallback source handling / rate limit policy |
|
||||
| 920 | `routes/market_intel_routes.py` | P2 market intel Blueprint | page route / API route glue / MCP gate route registration helper |
|
||||
| 906 | `services/competitor_match_attempt_rescore_audit.py` | P2 rescore audit service | audit query / matcher replay / summary payload 分離 |
|
||||
| 895 | `routes/market_intel_review_routes.py` | P2 market intel review route extension | review decision route glue / canonical alias decorators / legacy endpoint compatibility |
|
||||
| 867 | `services/token_report_service.py` | P2 token report service | query / aggregation / chart payload / notification formatting |
|
||||
| 4865 | `services/marketplace_product_matcher.py` | P2 marketplace matcher | identity parsing / unit-comparable scoring / search term quality / persistence normalization |
|
||||
| 865 | `routes/daily_sales_routes.py` | P2 Daily Sales Blueprint | route glue / export helpers / daily query and formatting service |
|
||||
| 1266 | `services/ollama_service.py` | P2 Ollama client | host health / request client / fallback policy / response parsing |
|
||||
| 849 | `services/pchome_crawler.py` | P2 PChome crawler | search fetch / parsing / fallback source handling / rate limit policy |
|
||||
| 1100 | `services/code_review_pipeline_service.py` | P2 Code review pipeline service | scan orchestration / finding normalization / persistence adapter |
|
||||
| 953 | `routes/export_routes.py` | P2 Export flow | export command/router glue / file path / download orchestration |
|
||||
| 816 | `services/ppt_vision_service.py` | P2 PPT vision QA service | runtime state / queue status / model probe / audit execution 分離 |
|
||||
| 2149 | `services/competitor_price_feeder.py` | P2 competitor price feeder | crawler scheduling / price normalization / retryable candidate recovery / cache strategy |
|
||||
| 1535 | `services/competitor_intel_repository.py` | P2 competitor intel repository | review queue query / cache shaping / formatting helpers |
|
||||
| 805 | `routes/bot_api_routes.py` | P2 Bot API Blueprint | route glue / bot action service |
|
||||
| 1319 | `routes/market_intel_review_report_routes.py` | P2 market intel review report Blueprint | review report route glue / export payload / phase handoff orchestration |
|
||||
| 917 | `routes/market_intel_routes.py` | P2 market intel Blueprint | page route / API route glue / MCP gate route registration helper |
|
||||
| 1965 | `services/market_intel/deployment_readiness.py` | P2 market intel deployment readiness | preflight gates / readiness payload / route contract helpers |
|
||||
| 864 | `services/ppt_vision_service.py` | P2 PPT vision QA service | runtime state / queue status / model probe / audit execution 分離 |
|
||||
| 846 | `services/market_intel/candidate_queue_review_ai_summary_persistence_telegram_dispatch_report_catalog_record_run_receipt.py` | P2 market intel review receipt pipeline | AI summary / persistence / Telegram dispatch / report catalog run receipt orchestration |
|
||||
| 826 | `routes/market_intel_mcp_run_routes.py` | P2 market intel MCP run route extension | route glue / canonical alias decorators / MCP run preview handoff |
|
||||
| 861 | `routes/market_intel_review_post_routes.py` | P2 market intel review post route extension | review post route glue / canonical alias decorators / AI summary persistence preview handoff |
|
||||
| 813 | `services/momo_crawler.py` | P2 MOMO crawler | targeted search / browser fallback / parsing 分離 |
|
||||
|
||||
## 市場情報開發前置禁區
|
||||
|
||||
|
||||
117
docs/memory/pchome_mapping_backlog_20260628.md
Normal file
117
docs/memory/pchome_mapping_backlog_20260628.md
Normal file
@@ -0,0 +1,117 @@
|
||||
# PChome Mapping Backlog Read-Only Report (2026-06-28)
|
||||
|
||||
正式環境目前以 `/api/ai/pchome-growth/opportunities` 作為 PChome 業績成長作戰清單來源。接續商品對應率優化時,先用只讀 reporter 取得 mapping backlog,不直接碰正式 DB。
|
||||
|
||||
## 產品優先順序
|
||||
|
||||
1. 先守住正式版本真相:production `/health` 必須是最新版本來源,本機只當 source candidate。
|
||||
2. AI 自動化營收閉環優先:正式 `needs_mapping_count=16` 先處理 direct mapping,再處理 review candidate,不退回人工逐筆找商品。
|
||||
3. AI Agent 決策必須 machine-verifiable:每個候選、證據補齊、單位價判斷、待確認項都要有 confidence、guardrails、trace、資料品質與可回滾下一步。
|
||||
4. 主流專業產品網站化必須同步推進:首頁 / Dashboard 要直接呈現缺口、價值、下一步與可執行 package,不得只顯示工程 API 或 raw endpoint。
|
||||
5. 外部來源治理要跟上:MOMO 是已接入來源,其他主流平台至少要有來源契約或待接入狀態;所有資料要正規化成 offer evidence。
|
||||
6. 再做小批次 no-write operator package / persistence dry-run / verifier,確認可回滾、可重跑、可讀回。
|
||||
7. 最後才推 DB apply authorization / signing / closeout 鏈;這些是底層 apply 安全工程,不得搶在產品缺口、AI 自動化與專業網站化前面。
|
||||
|
||||
## 技術入口順序(按需使用,不代表產品優先順序)
|
||||
|
||||
1. 先跑 `python scripts/ops/check_production_version_truth.py`,確認 production `/health` 仍是版本真相。
|
||||
2. 再跑 `python scripts/ops/report_pchome_mapping_backlog.py --json`。
|
||||
3. 或使用登入後只讀 API `/api/ai/pchome-growth/mapping-backlog` 讀同一套 service summary。
|
||||
4. 需要小批次操作前,先讀只讀 API `/api/ai/pchome-growth/mapping-backlog/operator-preview`。
|
||||
5. 需要 P1 direct mapping 自動搜尋候選包時,先讀 `/api/ai/pchome-growth/mapping-backlog/direct-mapping-auto-search-package`;預設只產生搜尋詞、身份錨點與接受門檻,不搜尋、不寫 DB。
|
||||
6. 需要 P2 候選機器決策包時,讀 `/api/ai/pchome-growth/mapping-backlog/direct-mapping-candidate-decision-package`;預設不搜尋、不寫 DB,若有候選則輸出 decision envelope、confidence、guardrails、failure reasons 與 exception-only machine review 分流。
|
||||
7. 需要看整體 AI 自動化進度時,讀 `/api/ai/pchome-growth/ai-automation-readiness`;它聚合缺口偵測、同款搜尋包、候選決策包、證據收據與受控落地,並回傳 `primary_human_gate_count=0`、`automation_policy.primary_flow=ai_controlled`。
|
||||
8. 需要補商品證據前,先讀只讀 API `/api/ai/pchome-growth/mapping-backlog/evidence-enrichment-preview`。
|
||||
9. 需要檢查 image / availability / price 要從哪裡補時,先讀只讀 API `/api/ai/pchome-growth/mapping-backlog/evidence-source-preview`。
|
||||
10. 需要 controlled GET smoke 時,先讀 `/api/ai/pchome-growth/mapping-backlog/evidence-fetch-gate`;預設不抓外站,只有 `execute_fetch=1` 才執行小批次 GET。
|
||||
11. 需要檢查 fetch receipt 能補掉哪些 evidence 缺口時,先讀 `/api/ai/pchome-growth/mapping-backlog/evidence-merge-preview`;預設不抓外站,只有 `execute_fetch=1` 才走 controlled fetch gate。
|
||||
12. 需要自動化收據時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-receipt-gate`;預設不抓外站、不 persistence,只有 `execute_fetch=1` 才走 controlled fetch gate 產生 ready receipt。
|
||||
13. 需要自動化 persistence dry-run contract 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-persistence-gate`;只接受 ready receipts,輸出 idempotency key、payload hash、schema migration contract、transaction preview、rollback plan 與 post-write verifier,但不寫 DB。
|
||||
14. 需要 schema migration / future apply verifier contract 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-schema-migration-preview`;只輸出 DDL preview、rollback preview、prewrite snapshot contract 與 post-write verifier,不執行 migration、不寫 DB。
|
||||
15. 需要 migration file / future apply endpoint contract 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-migration-file-preview`;只輸出 `migrations/045_pchome_auto_policy_evidence_receipts.sql` 內容預覽、hash、request contract、abort conditions 與 rollback contract,不寫檔、不執行 endpoint。
|
||||
16. 需要真正 migration file 生成前的 readiness closeout 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-apply-readiness-closeout`;只輸出 readiness checks、future-apply blockers 與 closeout decision,不寫檔、不執行 endpoint、不寫 DB。
|
||||
17. 需要 migration file generation request contract 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-migration-file-generation-request`;只輸出 request id、target file、expected hash、required artifacts 與 file generation steps,不寫檔、不執行 endpoint、不寫 DB。
|
||||
18. 需要 migration apply gate preview 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-migration-apply-gate-preview`;只讀本地 `045` migration 檔、hash、apply endpoint contract、prewrite snapshot requirement 與 post-apply verifier,不執行 SQL、不寫 DB。
|
||||
19. 需要 explicit DB apply request gate preview 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-request-gate-preview`;只輸出 command preview、required artifacts、abort conditions、runtime readback 與 rollback gate preview,不讀 secret、不執行 SQL、不寫 DB。
|
||||
20. 需要 DB apply execution preflight / snapshot artifact preview 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-execution-preflight`;只輸出 prewrite snapshot plan、post-apply readback plan、rollback artifact plan 與 abort conditions,不讀 secret、不執行 SQL、不寫 DB。
|
||||
21. 需要 fresh production apply authorization package 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-package`;只輸出 authorization checks、freshness requirements、machine apply manifest 與 verifier bundle,不讀 secret、不執行 SQL、不寫 DB。
|
||||
22. 需要 fresh-run verifier artifact generator preview 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-verifier-artifact-preview`;只輸出 prewrite snapshot / post-apply readback / rollback artifact schema、generation plan 與 verifier manifest,不寫檔、不讀 secret、不執行 SQL、不寫 DB。
|
||||
23. 需要 final explicit DB apply handoff package 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-final-handoff-package`;只輸出 final handoff sections、future runbook、command previews、abort gates 與 source proof manifest,不寫檔、不讀 secret、不執行 SQL、不寫 DB。
|
||||
24. 需要 controlled apply dry-run shell preview 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-controlled-dry-run-shell-preview`;只輸出 shell phases、script preview、check-mode contract 與 rollback hooks,不寫 script、不讀 secret、不執行 shell、不執行 SQL、不寫 DB。
|
||||
25. 需要 controlled dry-run shell closeout / explicit apply authorization boundary 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-controlled-dry-run-shell-closeout`;只輸出 closeout checks、future apply boundaries 與 explicit authorization boundary,不寫 script、不讀 secret、不執行 shell、不執行 SQL、不寫 DB。
|
||||
26. 需要 explicit DB apply authorization request intake 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-request-intake`;只輸出 authorization request intake、request payload schema、acceptance gates 與 rejection reasons,不讀 secret、不執行 shell、不執行 SQL、不寫 DB,且不簽發 database apply authorization。
|
||||
27. 需要 authorization request intake closeout / final exact request package 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-request-closeout`;只輸出 final exact request package、machine request manifest 與 closeout checks,不讀 secret、不執行 shell、不執行 SQL、不寫 DB,且不簽發 database apply authorization。
|
||||
28. 需要 future DB apply authorization lane guard 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-lane-guard`;只輸出 future authorization lane guard、lane transfer contract 與 lane entry requirements,不讀 secret、不執行 shell、不執行 SQL、不寫 DB,且不簽發 database apply authorization。
|
||||
29. 需要 future DB apply authorization decision preflight 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-decision-preflight`;只輸出 future authorization decision preflight、decision input requirements、decision rejection policy 與 preflight checks,不讀 secret、不執行 shell、不執行 SQL、不寫 DB,且不簽發 database apply authorization。
|
||||
30. 需要 future DB apply authorization decision closeout 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-decision-closeout`;只輸出 future authorization decision closeout、decision package、decision closeout contract 與 closeout checks,不讀 secret、不執行 shell、不執行 SQL、不寫 DB,且不簽發 database apply authorization。
|
||||
31. 需要 future DB apply authorization issuer gate / final nonsecret authorization envelope 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-issuer-gate`;只輸出 future authorization issuer gate、final nonsecret authorization envelope、issuer gate contract 與 issuer gate checks,不讀 secret、不執行 shell、不執行 SQL、不寫 DB,且不簽發 database apply authorization。
|
||||
32. 需要 future DB apply authorization signing-decision preflight 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-signing-decision-preflight`;只輸出 future authorization signing decision preflight、signing decision input requirements、rejection policy 與 preflight checks,不讀 secret、不執行 shell、不執行 SQL、不寫 DB,且不簽發 database apply authorization。
|
||||
33. 需要 future DB apply authorization signing-decision closeout / unsigned signing decision package 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-signing-decision-closeout`;只輸出 future authorization signing decision closeout、unsigned signing decision package、closeout contract 與 closeout checks,不讀 secret、不執行 shell、不執行 SQL、不寫 DB,且不簽發 database apply authorization。
|
||||
34. 需要 future DB apply authorization signing-issuer guard / signable request boundary 時,讀 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-signing-issuer-guard`;只輸出 future authorization signing issuer guard、signable request boundary、signing issuer guard contract 與 guard checks,不讀 secret、不執行 shell、不執行 SQL、不寫 DB,且不簽發 database apply authorization。
|
||||
35. 若 `result=NEEDS_MAPPING`,先處理 `direct_mapping_count`,再處理 `review_candidate_count`。
|
||||
|
||||
## 目前讀到的正式缺口
|
||||
|
||||
- production `/health`: `V10.725`
|
||||
- PChome growth candidate_count: `20`
|
||||
- mapped_count: `4`
|
||||
- mapping_rate: `20.0%`
|
||||
- needs_mapping_count: `16`
|
||||
- action_counts: `先補商品對應=14`、`確認候選=2`、`放大價格優勢=4`
|
||||
|
||||
## 邊界
|
||||
|
||||
- reporter 只做 GET readback。
|
||||
- service truth source: `services/pchome_mapping_backlog_service.py`
|
||||
- operator preview 只產生 run package 與 write gate,不執行搜尋或寫入。
|
||||
- direct mapping auto-search package 已接上 `/api/ai/pchome-growth/mapping-backlog/direct-mapping-auto-search-package`;預設只產生搜尋詞、身份錨點與接受門檻,`execute_search=1` 才執行 read-only candidate search,仍不寫 DB。
|
||||
- direct mapping candidate decision package 已接上 `/api/ai/pchome-growth/mapping-backlog/direct-mapping-candidate-decision-package`;把候選轉成 P2 decision envelope,分流到 no-write receipt 或 exception-only machine review,仍不寫 DB、不 persistence。
|
||||
- AI automation readiness 已接上 `/api/ai/pchome-growth/ai-automation-readiness` 與 Dashboard status strip;它用單一摘要顯示缺口偵測、同款搜尋包、候選決策包、證據收據與受控落地,且 `primary_human_gate_count=0`、`automation_policy.primary_flow=ai_controlled`,例外也走 AI machine-verifiable auto-resolution。
|
||||
- Dashboard command center 已加入 AI 自動化作戰流水線,將 P1 搜尋包、P2 決策包、證據收據與受控落地轉成營運語言與數字,不外露 raw endpoint。
|
||||
- 外部來源治理已改成由 source readiness 產生完整 source_scope;除 MOMO 已接入外,Shopee、Lazada、Amazon、Google Merchant / Shopping、TikTok Shop、LINE 購物、Rakuten、Yahoo、露天、品牌官網 / Shopify、Meta Commerce、Coupang 都列為待接入且不進告警,並提供 offer evidence 欄位契約。
|
||||
- operator preview 參考外部主流規範:Google Merchant Center product data、Google Product / Merchant structured data、Baymard ecommerce product/search UX。
|
||||
- 每個 target 都應帶 `evidence_completeness`,至少列出 product URL、present/missing fields、blocking missing fields、auto_accept_ready 與 human_review_required。
|
||||
- deterministic `unit_package_basis` parser preview 已接入 evidence completeness,可從商品標題解析 `30ml`、`40ml x2`、`3.2g 多款任選`、`42張` 等單位/入數訊號;若遇到任選、色號、贈品、即期等風險訊號,仍要求人工覆核。
|
||||
- evidence enrichment preview 只產生 image / availability / unit basis 的補證據任務與來源建議,不抓外站、不寫 DB;unit basis 可由本地 parser 補足時,不再列為缺口。
|
||||
- evidence source preview 已接上 `/api/ai/pchome-growth/mapping-backlog/evidence-source-preview`,只列出 image / availability 的 future GET fetch gate、payload keys checked,以及 price payload mapping probe;preview 本身不抓外站、不寫 DB、不呼叫 LLM。
|
||||
- check-mode product-page evidence parser 已完成,可用 HTML fixture 解析 JSON-LD `Product.image`、`Offer.availability`、`og:image` 與 `product:availability` fallback;parser 本身不抓外站、不寫 DB、不呼叫 LLM。
|
||||
- controlled read-only fetch gate 已接上 `/api/ai/pchome-growth/mapping-backlog/evidence-fetch-gate`;預設 `execute_fetch=false` 只產生 planned receipts,`execute_fetch=1` 時才對 allowlist domain `24h.pchome.com.tw` 執行最多 12 筆 GET,含 timeout、512KB HTML cap、no-write receipt。
|
||||
- production-derived 1 筆 GET smoke:`DDBH3K-A900K0KWV-002` 回 `HTTP 200`、`content_bytes=215631`,解析到 image URL 與 `Offer.availability=InStock`;receipt 仍是 `writes_database=false`、`dispatches_telegram=false`、`llm_calls=false`。
|
||||
- evidence merge preview 已接上 `/api/ai/pchome-growth/mapping-backlog/evidence-merge-preview`;production-derived 1 筆 smoke 讓 `DDBH3K-A900K0KWV-002` 的 `image/availability` 從 missing fields 移除,`merge_ready_count=1`、`writes_database_count=0`。
|
||||
- automation-first merge policy 已接上:review candidate 的 `pchome_price` 會自動納入 price evidence;production-derived batch=12 已達 `AUTO_ACCEPT_EVIDENCE_MERGE=10/10`、`manual_review_required_count=0`、`remaining_blocker_count=0`、`writes_database_count=0`。
|
||||
- auto-policy receipt gate 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-receipt-gate`;production-derived batch=12 已達 `READY_FOR_AUTO_PERSISTENCE=10/10`、`persists_receipt_count=0`、`writes_database_count=0`、`manual_review_required_count=0`。
|
||||
- auto-policy persistence gate 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-persistence-gate`;只接受 ready receipts,輸出 idempotency key、payload hash、future target table、transaction preview、schema contract、rollback plan 與 post-write verifier;production-derived batch=12 smoke 已達 `PERSISTENCE_DRY_RUN_READY`、`dry_run_ready_count=10/10`、`manual_review_required_count=0`、`writes_database_count=0`、`persists_receipt_count=0`,目前仍是 no-write / dry-run-only。
|
||||
- auto-policy schema migration preview 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-schema-migration-preview`;輸出 `external_offer_evidence_receipts` DDL preview、rollback preview、prewrite snapshot contract、future apply verifier 與 exception-only failure routing;production-derived batch=12 smoke 已達 `SCHEMA_MIGRATION_PREVIEW_READY`、`dry_run_ready_count=10/10`、`schema_statement_count=13`、`future_verifier_count=5`、`current_preview_apply_allowed=false`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 no-write / no-SQL-execute preview。
|
||||
- auto-policy migration file preview 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-migration-file-preview`;輸出 `migrations/045_pchome_auto_policy_evidence_receipts.sql` forward SQL preview、hash、rollback preview、future apply endpoint request contract、preflight sequence、abort conditions 與 rollback contract;production-derived batch=12 smoke 已達 `MIGRATION_FILE_PREVIEW_READY`、`dry_run_ready_count=10/10`、`migration_file_line_count=31`、`apply_endpoint_contract_ready_count=1`、`forbidden_forward_tokens_absent=true`、`writes_file_count=0`、`executes_endpoint_count=0`、`writes_database_count=0`,目前仍是 no-file-write / no-endpoint-execute / no-SQL-execute preview。
|
||||
- auto-policy apply-readiness closeout 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-apply-readiness-closeout`;輸出 readiness checks、future-apply blockers、migration file hash summary 與 apply endpoint summary;production-derived batch=12 smoke 已達 `APPLY_READINESS_CLOSEOUT_READY`、`readiness_pass_count=9/9`、`current_preview_ready_count=1`、`ready_for_migration_file_generation_request=true`、`ready_for_database_apply=false`、`future_apply_blocker_count=4`、`writes_file_count=0`、`executes_endpoint_count=0`、`writes_database_count=0`;closeout ready 只代表可提出 migration file generation request,不代表 DB apply。
|
||||
- auto-policy migration file generation request 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-migration-file-generation-request`;輸出 request id、target file、expected SHA256、required artifacts 與 file generation steps;`migrations/045_pchome_auto_policy_evidence_receipts.sql` 已在本地 repo 生成,hash 與 request expected SHA256 對齊;production-derived batch=12 smoke 已達 `FILE_GENERATION_REQUEST_READY`、`request_ready_count=1`、`dry_run_ready_count=10/10`、`required_artifact_count=4`、`file_generation_step_count=3`、`ready_to_generate_file=true`、`ready_for_database_apply=false`、`generated_file_exists=true`、`generated_file_hash_matches_request=true`、`writes_file_count=0`、`executes_endpoint_count=0`、`writes_database_count=0`,request API 本身仍是 no-file-write / no-endpoint-execute / no-DB-write。
|
||||
- auto-policy migration apply gate preview 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-migration-apply-gate-preview`;讀本地 `045` migration 檔並比對 request hash、additive-only、future apply endpoint contract、prewrite snapshot requirement 與 post-apply verifier requirement;production-derived batch=12 smoke 已達 `MIGRATION_APPLY_GATE_PREVIEW_READY`、`apply_gate_pass_count=9/9`、`apply_preview_ready_count=1`、`generated_file_hash_matches_count=1`、`ready_for_explicit_db_apply_request=true`、`ready_for_database_apply_now=false`、`future_apply_blocker_count=3`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy explicit DB apply request gate preview 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-request-gate-preview`;輸出 DB apply request id、future command preview、required artifacts、apply sequence、abort conditions、runtime readback 與 rollback gate preview;production-derived batch=12 smoke 已達 `DB_APPLY_REQUEST_GATE_READY`、`request_ready_count=1`、`required_artifact_count=5`、`apply_sequence_step_count=5`、`abort_condition_count=6`、`generated_file_hash_matches_count=1`、`ready_for_explicit_db_apply_request=true`、`ready_for_database_apply_now=false`、`reads_secret_in_preview=false`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 no-secret-read / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply execution preflight 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-execution-preflight`;輸出 prewrite snapshot plan、post-apply readback plan、rollback artifact plan、required artifacts 與 abort conditions;production-derived batch=12 smoke 已達 `DB_APPLY_EXECUTION_PREFLIGHT_READY`、`preflight_ready_count=1`、`request_ready_count=1`、`required_artifact_count=6`、`snapshot_plan_count=5`、`readback_plan_count=6`、`rollback_artifact_count=1`、`generated_file_hash_matches_count=1`、`ready_for_preflight_artifact_generation=true`、`ready_for_database_apply_now=false`、`reads_secret_in_preview=false`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 no-secret-read / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply authorization package 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-package`;輸出 authorization checks、freshness requirements、machine apply manifest 與 verifier bundle;production-derived batch=12 smoke 已達 `DB_APPLY_AUTHORIZATION_PACKAGE_READY`、`authorization_check_count=11`、`authorization_pass_count=11`、`authorization_waiting_count=0`、`authorization_package_ready_count=1`、`freshness_requirement_count=5`、`manifest_step_count=6`、`verifier_bundle_count=3`、`ready_for_explicit_apply_authorization_request=true`、`ready_for_database_apply_now=false`、`reads_secret_in_preview=false`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 no-secret-read / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply verifier artifact preview 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-verifier-artifact-preview`;輸出 prewrite snapshot / post-apply readback / rollback artifact schema、generation plan 與 verifier manifest;production-derived batch=12 smoke 已達 `DB_APPLY_VERIFIER_ARTIFACT_PREVIEW_READY`、`artifact_preview_ready_count=1`、`authorization_package_ready_count=1`、`artifact_schema_count=3`、`artifact_generation_step_count=5`、`verifier_check_count=15`、`writes_artifact_count=0`、`ready_for_future_artifact_generation=true`、`ready_to_write_artifacts_now=false`、`ready_for_database_apply_now=false`、`reads_secret_in_preview=false`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 no-file-write / no-secret-read / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply final handoff package 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-final-handoff-package`;輸出 final handoff sections、future runbook、command previews、abort gates 與 source proof manifest;production-derived batch=12 smoke 已達 `DB_APPLY_FINAL_HANDOFF_PACKAGE_READY`、`final_handoff_ready_count=1`、`artifact_preview_ready_count=1`、`handoff_section_count=6`、`final_runbook_step_count=7`、`command_preview_count=3`、`abort_gate_count=10`、`source_endpoint_count=4`、`ready_for_explicit_db_apply_handoff=true`、`ready_for_database_apply_now=false`、`writes_artifact_count=0`、`reads_secret_in_preview=false`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 no-file-write / no-secret-read / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply controlled dry-run shell preview 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-controlled-dry-run-shell-preview`;輸出 shell phases、script preview、check-mode contract 與 rollback hooks;production-derived batch=12 smoke 已達 `DB_APPLY_CONTROLLED_DRY_RUN_SHELL_PREVIEW_READY`、`dry_run_shell_preview_ready_count=1`、`final_handoff_ready_count=1`、`shell_phase_count=9`、`shell_script_line_count=10`、`check_mode_required_check_count=6`、`rollback_hook_count=3`、`writes_script_count=0`、`executes_script_count=0`、`ready_for_future_shell_script_generation=true`、`ready_to_write_script_now=false`、`ready_to_execute_shell_now=false`、`ready_for_database_apply_now=false`、`reads_secret_in_preview=false`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 no-script-write / no-secret-read / no-shell-execute / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply controlled dry-run shell closeout 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-controlled-dry-run-shell-closeout`;輸出 closeout checks、future apply boundaries 與 explicit authorization boundary;production-derived batch=12 smoke 已達 `DB_APPLY_CONTROLLED_DRY_RUN_SHELL_CLOSEOUT_READY`、`closeout_ready_count=1`、`closeout_check_count=13`、`closeout_pass_count=13`、`closeout_waiting_count=0`、`dry_run_shell_preview_ready_count=1`、`future_apply_boundary_count=6`、`ready_for_explicit_apply_authorization_boundary=true`、`ready_for_database_apply_now=false`、`writes_script_count=0`、`executes_script_count=0`、`reads_secret_in_preview=false`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 no-script-write / no-secret-read / no-shell-execute / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply authorization request intake 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-request-intake`;輸出 authorization request intake、request payload schema、acceptance gates、required request evidence 與 rejection reasons;production-derived batch=12 smoke 已達 `DB_APPLY_AUTHORIZATION_REQUEST_INTAKE_READY`、`authorization_request_intake_ready_count=1`、`required_request_evidence_count=7`、`request_payload_required_field_count=10`、`authorization_acceptance_gate_count=11`、`authorization_acceptance_pass_count=11`、`authorization_acceptance_waiting_count=0`、`rejection_reason_count=10`、`closeout_ready_count=1`、`future_apply_boundary_count=6`、`accepts_authorization_request=true`、`issues_database_apply_authorization=false`、`ready_for_database_apply_now=false`、`reads_secret_in_preview=false`、`executes_script_count=0`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 request-intake-only / no-secret-read / no-shell-execute / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply authorization request closeout 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-request-closeout`;輸出 final exact request package、machine request manifest 與 closeout checks;production-derived batch=12 smoke 已達 `DB_APPLY_AUTHORIZATION_REQUEST_CLOSEOUT_READY`、`authorization_request_closeout_ready_count=1`、`closeout_check_count=12`、`closeout_pass_count=12`、`closeout_waiting_count=0`、`authorization_request_intake_ready_count=1`、`exact_request_payload_field_count=10`、`machine_request_manifest_step_count=6`、`required_request_evidence_count=7`、`authorization_acceptance_gate_count=11`、`rejection_reason_count=10`、`ready_for_exact_authorization_request_package=true`、`issues_database_apply_authorization=false`、`ready_for_database_apply_now=false`、`reads_secret_in_preview=false`、`executes_script_count=0`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 final-request-package-only / no-secret-read / no-shell-execute / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply authorization lane guard 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-lane-guard`;輸出 future authorization lane guard、lane transfer contract、lane entry requirements 與 lane guard checks;production-derived batch=12 smoke 已達 `DB_APPLY_AUTHORIZATION_LANE_GUARD_READY`、`authorization_lane_guard_ready_count=1`、`lane_guard_check_count=12`、`lane_guard_pass_count=12`、`lane_guard_waiting_count=0`、`authorization_request_closeout_ready_count=1`、`exact_request_payload_field_count=10`、`machine_request_manifest_step_count=6`、`lane_entry_requirement_count=6`、`required_request_evidence_count=7`、`authorization_acceptance_gate_count=11`、`rejection_reason_count=10`、`ready_for_future_authorization_lane_entry=true`、`issues_database_apply_authorization=false`、`ready_for_database_apply_now=false`、`reads_secret_in_preview=false`、`executes_script_count=0`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 lane-guard-only / no-secret-read / no-shell-execute / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply authorization decision preflight 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-decision-preflight`;輸出 future authorization decision preflight、decision input requirements、decision rejection policy 與 preflight checks;production-derived batch=12 smoke 已達 `DB_APPLY_AUTHORIZATION_DECISION_PREFLIGHT_READY`、`authorization_decision_preflight_ready_count=1`、`decision_preflight_check_count=12`、`decision_preflight_pass_count=12`、`decision_preflight_waiting_count=0`、`authorization_lane_guard_ready_count=1`、`decision_input_requirement_count=8`、`decision_rejection_reason_count=10`、`lane_entry_requirement_count=6`、`exact_request_payload_field_count=10`、`machine_request_manifest_step_count=6`、`allows_authorization_decision_in_future_lane=true`、`issues_database_apply_authorization=false`、`ready_for_database_apply_now=false`、`reads_secret_in_preview=false`、`executes_script_count=0`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 decision-preflight-only / no-secret-read / no-shell-execute / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply authorization decision closeout 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-decision-closeout`;輸出 future authorization decision closeout、future authorization decision package、decision closeout contract 與 closeout checks;production-derived batch=12 smoke 已達 `DB_APPLY_AUTHORIZATION_DECISION_CLOSEOUT_READY`、`authorization_decision_closeout_ready_count=1`、`decision_closeout_check_count=12`、`decision_closeout_pass_count=12`、`decision_closeout_waiting_count=0`、`authorization_decision_preflight_ready_count=1`、`decision_input_requirement_count=8`、`decision_rejection_reason_count=10`、`post_apply_verifier_required_count=1`、`same_run_truth_required_count=1`、`permits_future_authorization_decision_lane=true`、`issues_database_apply_authorization=false`、`ready_for_database_apply_now=false`、`reads_secret_in_preview=false`、`executes_script_count=0`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 decision-closeout-only / no-secret-read / no-shell-execute / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply authorization issuer gate 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-issuer-gate`;輸出 future authorization issuer gate、final nonsecret authorization envelope、issuer gate contract 與 issuer gate checks;production-derived batch=12 smoke 已達 `DB_APPLY_AUTHORIZATION_ISSUER_GATE_READY`、`authorization_issuer_gate_ready_count=1`、`issuer_gate_check_count=12`、`issuer_gate_pass_count=12`、`issuer_gate_waiting_count=0`、`authorization_decision_closeout_ready_count=1`、`decision_closeout_check_count=12`、`required_issuer_evidence_count=9`、`nonsecret_authorization_claim_count=8`、`post_apply_verifier_required_count=1`、`same_run_truth_required_count=1`、`permits_future_authorization_issuer_lane=true`、`issues_database_apply_authorization=false`、`signs_database_apply_authorization=false`、`ready_for_database_apply_now=false`、`secret_material_included=false`、`reads_secret_in_preview=false`、`executes_script_count=0`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 issuer-gate-only / nonsecret-envelope-only / no-secret-read / no-shell-execute / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply authorization signing-decision preflight 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-signing-decision-preflight`;輸出 future authorization signing decision preflight、signing decision preflight envelope、signing decision input requirements、rejection policy 與 preflight checks;production-derived batch=12 smoke 已達 `DB_APPLY_AUTHORIZATION_SIGNING_DECISION_PREFLIGHT_READY`、`authorization_signing_decision_preflight_ready_count=1`、`signing_decision_preflight_check_count=12`、`signing_decision_preflight_pass_count=12`、`signing_decision_preflight_waiting_count=0`、`authorization_issuer_gate_ready_count=1`、`issuer_gate_check_count=12`、`required_issuer_evidence_count=9`、`nonsecret_authorization_claim_count=8`、`signing_decision_input_requirement_count=10`、`signing_decision_rejection_reason_count=11`、`allows_future_authorization_signing_decision_lane=true`、`issues_database_apply_authorization=false`、`signs_database_apply_authorization=false`、`ready_for_database_apply_now=false`、`secret_material_required_in_preview=false`、`reads_secret_in_preview=false`、`executes_script_count=0`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 signing-decision-preflight-only / no-secret-read / no-signing / no-shell-execute / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply authorization signing-decision closeout 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-signing-decision-closeout`;輸出 future authorization signing decision closeout、unsigned signing decision package、signing decision closeout contract 與 closeout checks;production-derived batch=12 smoke 已達 `DB_APPLY_AUTHORIZATION_SIGNING_DECISION_CLOSEOUT_READY`、`authorization_signing_decision_closeout_ready_count=1`、`signing_decision_closeout_check_count=12`、`signing_decision_closeout_pass_count=12`、`signing_decision_closeout_waiting_count=0`、`authorization_signing_decision_preflight_ready_count=1`、`signing_decision_input_requirement_count=10`、`signing_decision_rejection_reason_count=11`、`required_issuer_evidence_count=9`、`nonsecret_authorization_claim_count=8`、`permits_future_unsigned_signing_decision_package_lane=true`、`issues_database_apply_authorization=false`、`signs_database_apply_authorization=false`、`ready_for_database_apply_now=false`、`secret_material_included=false`、`secret_material_required_in_preview=false`、`reads_secret_in_preview=false`、`executes_script_count=0`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 signing-decision-closeout-only / unsigned-package-only / no-secret-read / no-signing / no-shell-execute / no-SQL-execute / no-DB-write preview。
|
||||
- auto-policy DB apply authorization signing-issuer guard 已接上 `/api/ai/pchome-growth/mapping-backlog/auto-policy-db-apply-authorization-signing-issuer-guard`;輸出 future authorization signing issuer guard、signable request boundary、signing issuer guard contract 與 guard checks;production-derived batch=12 smoke 已達 `DB_APPLY_AUTHORIZATION_SIGNING_ISSUER_GUARD_READY`、`authorization_signing_issuer_guard_ready_count=1`、`signing_issuer_guard_check_count=12`、`signing_issuer_guard_pass_count=12`、`signing_issuer_guard_waiting_count=0`、`authorization_signing_decision_closeout_ready_count=1`、`signing_decision_closeout_check_count=12`、`signing_decision_input_requirement_count=10`、`signing_decision_rejection_reason_count=11`、`required_issuer_evidence_count=9`、`nonsecret_authorization_claim_count=8`、`permits_future_authorization_signing_issuer_lane=true`、`issues_database_apply_authorization=false`、`signs_database_apply_authorization=false`、`ready_for_database_apply_now=false`、`secret_material_included=false`、`secret_material_required_in_preview=false`、`reads_secret_in_preview=false`、`executes_script_count=0`、`executes_sql_count=0`、`executes_migration_count=0`、`writes_database_count=0`,目前仍是 signing-issuer-guard-only / signable-boundary-only / no-secret-read / no-signing / no-shell-execute / no-SQL-execute / no-DB-write preview。
|
||||
- Dashboard no-write UI 已顯示 `auto_receipt_count` 與 `manual_review_required_count`,首頁不觸發外站 GET、不 persistence。
|
||||
- production-derived evidence/source preview 目前 `task_count=6`、`tasks_with_blockers=6`、`missing_field_counts=image=6, availability=6, price=1, unit_price_or_package_basis=0`、`fetch_gate_candidate_count=6`;price 缺口樣本是 review candidate `DDABN0-A900IH795-000`。
|
||||
- AI automation 只先產生 Ollama-first read-only assist plan;preview 不呼叫 LLM、不允許 Gemini、不寫 DB。
|
||||
- 不執行 backfill POST。
|
||||
- 不寫 DB、不掛 scheduler、不派 Telegram。
|
||||
- 若版本 guard blocked,不應宣稱本地或 Gitea 是最新正式版本。
|
||||
|
||||
## 下一步
|
||||
|
||||
1. 進入 future DB apply authorization signing-issuer closeout / final signable request package:只收斂 signing issuer guard 的 signable boundary、source chain、same-run production truth、post-apply verifier、secret rejection 與 no-signing/no-write guarantees;仍不讀 secret、不在此步簽發 database apply authorization,也不直接 DB apply。
|
||||
2. 以 Google Product / Merchant listing structured data 的 `Product.image`、`Offer.availability` 為解析目標。
|
||||
3. 順手追 review candidate price payload 邊界,確認缺口是來源 payload 欄位缺失還是 summary 映射缺失。
|
||||
4. image / availability / price payload 邊界都補齊並通過 production readback 後,才進入 operator write approval / backfill POST 小批次。
|
||||
29
docs/memory/production_version_truth_20260627.md
Normal file
29
docs/memory/production_version_truth_20260627.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Production Version Truth 2026-06-27
|
||||
|
||||
## Rule
|
||||
|
||||
正式環境 `/health` 是 EwoooC 的最新版本真相。
|
||||
|
||||
Local workspace、Gitea `main`、branch、handoff 或文件只能作為 source candidate;除非 production readback 回同一個版本,否則不能宣稱已上線或最新。
|
||||
|
||||
## Current Protected Baseline
|
||||
|
||||
- Production URL: `https://mo.wooo.work/health`
|
||||
- Production readback at setup time: `status=healthy`, `database=postgresql`, `version=V10.725`
|
||||
- Clean local workspace: `/Users/ogt/codex-workspaces/ewoooc-dev`
|
||||
- Local branch at setup time: `main`
|
||||
- Local / origin HEAD at setup time: `f3e412c`
|
||||
- Clean local `config.py`: `SYSTEM_VERSION = "V10.725"`
|
||||
- Old iCloud checkout had a local-only `config.py` drift to `V10.726`; that drift is not production truth.
|
||||
|
||||
## Required Check
|
||||
|
||||
Before claiming a version, run:
|
||||
|
||||
```bash
|
||||
python scripts/ops/check_production_version_truth.py
|
||||
```
|
||||
|
||||
If the script reports `BLOCKED`, treat local work as a candidate and do not deploy, report completion, or write handoff text that says the local version is latest.
|
||||
|
||||
For an explicit release-prep branch only, `--allow-local-version-drift` may be used to inspect a local `config.py` version bump, but production `/health` still remains the latest runtime truth until deploy readback matches it.
|
||||
Reference in New Issue
Block a user