diff --git a/config.py b/config.py index 261a3bc..ceb57b1 100644 --- a/config.py +++ b/config.py @@ -320,7 +320,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.197" +SYSTEM_VERSION = "V10.198" LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log') public_url = PUBLIC_URL # 用於模板顯示 diff --git a/docs/adr/ADR-035-cross-platform-market-campaign-intelligence.md b/docs/adr/ADR-035-cross-platform-market-campaign-intelligence.md index 39424eb..7f1447a 100644 --- a/docs/adr/ADR-035-cross-platform-market-campaign-intelligence.md +++ b/docs/adr/ADR-035-cross-platform-market-campaign-intelligence.md @@ -163,6 +163,7 @@ EwoooC 目前已有 MOMO EDM / 節慶活動資料、`promo_products`、PChome - 2026-05-18 追加 opportunity scoring plan preview:`services.market_intel.opportunity_scoring` 與 `/api/market_intel/opportunity_scoring_plan` 定義價差、折扣深度、比對可信度、活動急迫性與資料新鮮度五個 scoring dimensions、分級門檻、evidence tables 與人工升級順序。此階段不計分、不產生 sample scores、不建立 scoring job、不寫 DB、不派送 Telegram、不產生 AI 摘要。 - 2026-05-18 追加 opportunity evidence plan preview:`services.market_intel.opportunity_evidence` 與 `/api/market_intel/opportunity_evidence_plan` 定義 scoring / alert / AI 摘要必須攜帶的 campaign、market product、match review、MOMO reference、scoring trace 五段 evidence bundle contract。此階段不查 DB、不產生 sample evidence、不建立 alert candidate、不派送 Telegram、不產生 AI 摘要。 - 2026-05-18 追加 opportunity alert plan preview:`services.market_intel.opportunity_alerts` 與 `/api/market_intel/opportunity_alert_plan` 定義人工審核、每日摘要、Telegram 候選、AI 摘要候選四種 channel 的最低門檻、去重節流、payload contract 與操作順序。此階段不建立 alert queue、不派送 Telegram、不呼叫 LLM、不寫 DB;所有告警必須先有 evidence bundle、dedupe key 與人工批准。 +- 2026-05-18 追加 opportunity alert review preview:`/api/market_intel/opportunity_alert_plan` 擴充人工審核狀態與操作,定義 `draft → needs_review → approved_for_digest / approved_for_telegram / rejected / deferred` 流程、審核理由、審核者身分與派送前二次 gate。此階段不建立 review queue、不執行審核動作、不寫 approval record、不派送 Telegram、不呼叫 LLM。 ### Phase 4:Coupang / Shopee Adapter diff --git a/routes/README.md b/routes/README.md index 6e6bf60..62eb916 100644 --- a/routes/README.md +++ b/routes/README.md @@ -19,7 +19,7 @@ | `edm_routes.py` | EDM 與節慶儀表板 | `/edm`, `/festival` | | `monthly_routes.py` | 月結分析 | `/monthly_summary_analysis`, `/api/monthly_summary_data` | | `daily_sales_routes.py` | 當日業績 | `/daily_sales`, `/daily_sales/export*` | -| `market_intel_routes.py` | 市場情報 Phase 38 opportunity alert plan preview | `/market_intel`, `/market_intel/*`, `/api/market_intel/status`, `/api/market_intel/schema`, `/api/market_intel/schema_smoke`, `/api/market_intel/schema_db_probe`, `/api/market_intel/platform_seed_db_diff`, `/api/market_intel/legacy_source_bridge`, `/api/market_intel/mcp_readiness`, `/api/market_intel/mcp_tool_contract`, `/api/market_intel/mcp_deploy_preflight`, `/api/market_intel/mcp_activation_runbook`, `/api/market_intel/mcp_fetch_gate`, `/api/market_intel/scheduler_plan`, `/api/market_intel/match_review_plan`, `/api/market_intel/opportunity_plan`, `/api/market_intel/opportunity_scoring_plan`, `/api/market_intel/opportunity_evidence_plan`, `/api/market_intel/opportunity_alert_plan`, `/api/market_intel/adapters`, `/api/market_intel/dry_run_plan`, `/api/market_intel/discovery_plan`, `/api/market_intel/manual_discovery`, `/api/market_intel/candidate_preview`, `/api/market_intel/platform_seed_plan`, `/api/market_intel/platform_seed_write_guard`, `/api/market_intel/platform_seed_writer_plan`, `/api/market_intel/migration_blueprint`, `/api/market_intel/seed_writer_cli_status`, `/api/market_intel/write_approval_runbook`, `/api/market_intel/deployment_readiness` | +| `market_intel_routes.py` | 市場情報 Phase 39 opportunity alert review preview | `/market_intel`, `/market_intel/*`, `/api/market_intel/status`, `/api/market_intel/schema`, `/api/market_intel/schema_smoke`, `/api/market_intel/schema_db_probe`, `/api/market_intel/platform_seed_db_diff`, `/api/market_intel/legacy_source_bridge`, `/api/market_intel/mcp_readiness`, `/api/market_intel/mcp_tool_contract`, `/api/market_intel/mcp_deploy_preflight`, `/api/market_intel/mcp_activation_runbook`, `/api/market_intel/mcp_fetch_gate`, `/api/market_intel/scheduler_plan`, `/api/market_intel/match_review_plan`, `/api/market_intel/opportunity_plan`, `/api/market_intel/opportunity_scoring_plan`, `/api/market_intel/opportunity_evidence_plan`, `/api/market_intel/opportunity_alert_plan`, `/api/market_intel/adapters`, `/api/market_intel/dry_run_plan`, `/api/market_intel/discovery_plan`, `/api/market_intel/manual_discovery`, `/api/market_intel/candidate_preview`, `/api/market_intel/platform_seed_plan`, `/api/market_intel/platform_seed_write_guard`, `/api/market_intel/platform_seed_writer_plan`, `/api/market_intel/migration_blueprint`, `/api/market_intel/seed_writer_cli_status`, `/api/market_intel/write_approval_runbook`, `/api/market_intel/deployment_readiness` | | `api_routes.py` | 通用任務與查詢 API | `/api/run_task`, `/api/history/*` | | `export_routes.py` | 匯出功能 | `/api/export/*` | | `import_routes.py` | 匯入功能 | `/api/import_excel`, `/api/import/monthly_summary` | diff --git a/services/market_intel/opportunity_alerts.py b/services/market_intel/opportunity_alerts.py index 8505ae8..670ea7b 100644 --- a/services/market_intel/opportunity_alerts.py +++ b/services/market_intel/opportunity_alerts.py @@ -71,6 +71,72 @@ THROTTLE_POLICY = { "max_ai_briefing_items_per_digest": 20, } +REVIEW_STATES = ( + { + "key": "draft", + "label": "候選草案", + "dispatch_allowed": False, + "description": "由 scoring / evidence 形成候選,但尚未進人工審核。", + }, + { + "key": "needs_review", + "label": "待人工審核", + "dispatch_allowed": False, + "description": "資料完整但尚未批准,不得推送或產生 AI 摘要。", + }, + { + "key": "approved_for_digest", + "label": "批准進每日摘要", + "dispatch_allowed": False, + "description": "只可進每日摘要候選,仍不得直接推 Telegram。", + }, + { + "key": "approved_for_telegram", + "label": "批准進 Telegram 候選", + "dispatch_allowed": True, + "description": "仍需經 dispatch gate 與 throttle,再進下一階段。", + }, + { + "key": "rejected", + "label": "駁回", + "dispatch_allowed": False, + "description": "保留審核理由,不再升級。", + }, + { + "key": "deferred", + "label": "延後觀察", + "dispatch_allowed": False, + "description": "等待新價格快照或活動狀態更新。", + }, +) + +REVIEW_ACTIONS = ( + { + "key": "approve_digest", + "from": ["needs_review"], + "to": "approved_for_digest", + "requires_reason": True, + }, + { + "key": "approve_telegram", + "from": ["needs_review", "approved_for_digest"], + "to": "approved_for_telegram", + "requires_reason": True, + }, + { + "key": "reject", + "from": ["draft", "needs_review", "approved_for_digest"], + "to": "rejected", + "requires_reason": True, + }, + { + "key": "defer", + "from": ["needs_review", "approved_for_digest"], + "to": "deferred", + "requires_reason": True, + }, +) + def build_opportunity_alert_plan_preview( *, @@ -131,6 +197,9 @@ def build_opportunity_alert_plan_preview( "ready_for_alert_candidates": False, "alert_candidate_created": False, "alert_queue_created": False, + "review_queue_created": False, + "review_action_executed": False, + "approval_record_written": False, "telegram_dispatched": False, "ai_summary_generated": False, "llm_call_executed": False, @@ -145,9 +214,18 @@ def build_opportunity_alert_plan_preview( "channel_count": len(ALERT_CHANNELS), "channels": list(ALERT_CHANNELS), "alert_gates": list(ALERT_GATES), + "review_state_count": len(REVIEW_STATES), + "review_states": list(REVIEW_STATES), + "review_actions": list(REVIEW_ACTIONS), "throttle_policy": THROTTLE_POLICY, "gate_checks": gate_checks, "blocked_reasons": blocked_reasons, + "approval_policy": { + "manual_approval_required_for_dispatch": True, + "approval_reason_required": True, + "reviewer_identity_required": True, + "approved_candidate_still_requires_dispatch_gate": True, + }, "payload_contract": { "required_fields": [ "alert_candidate_id", diff --git a/services/market_intel/service.py b/services/market_intel/service.py index d20e54c..7751f98 100644 --- a/services/market_intel/service.py +++ b/services/market_intel/service.py @@ -80,7 +80,7 @@ class MarketIntelRuntimeStatus: class MarketIntelService: """市場情報入口服務,先集中 feature gate 與安全狀態。""" - phase = "phase_38_opportunity_alert_plan_preview" + phase = "phase_39_opportunity_alert_review_preview" def get_runtime_status(self) -> MarketIntelRuntimeStatus: return MarketIntelRuntimeStatus( @@ -618,6 +618,8 @@ class MarketIntelService: "opportunity_alert_plan_preview_safe": bool( opportunity_alert_plan["mode"] == "opportunity_alert_plan_preview" and not opportunity_alert_plan["alert_candidate_created"] + and not opportunity_alert_plan["review_action_executed"] + and not opportunity_alert_plan["approval_record_written"] and not opportunity_alert_plan["telegram_dispatched"] and not opportunity_alert_plan["database_write_executed"] and not opportunity_alert_plan["llm_call_executed"] diff --git a/templates/market_intel/disabled.html b/templates/market_intel/disabled.html index a8283e4..cc49071 100644 --- a/templates/market_intel/disabled.html +++ b/templates/market_intel/disabled.html @@ -1986,6 +1986,7 @@ `mode=${data.mode || 'unknown'}`, `ready=${data.ready_for_alert_candidates ? 'yes' : 'no'}`, `channels=${data.channel_count || 0}`, + `review=${data.review_state_count || 0}`, `telegram=${data.telegram_dispatched ? 'sent' : 'blocked'}`, `llm=${data.llm_call_executed ? 'called' : 'blocked'}` ].map(item => `${escapeHtml(item)}`).join(''); @@ -1997,6 +1998,9 @@ const channels = data.channels || []; const gates = data.alert_gates || []; const throttle = data.throttle_policy || {}; + const reviewStates = data.review_states || []; + const reviewActions = data.review_actions || []; + const approval = data.approval_policy || {}; const sequence = data.operator_sequence || []; const payload = data.payload_contract || {}; const renderCheck = ([name, passed]) => ` @@ -2014,8 +2018,24 @@ approval=${item.requires_operator_approval ? 'required' : 'not_required'} / target=${escapeHtml(item.dispatch_target)} `; + const renderReviewState = item => ` +
+
+ ${escapeHtml(item.key)} + ${escapeHtml(item.label)} / ${escapeHtml(item.description)} +
+ ${item.dispatch_allowed ? 'DISPATCH' : 'BLOCK'} +
+ `; + const renderReviewAction = item => ` +
+ ${escapeHtml(item.key)} + ${escapeHtml((item.from || []).join(' / '))} → ${escapeHtml(item.to)} + reason=${item.requires_reason ? 'required' : 'optional'} +
+ `; opportunityAlertBody.innerHTML = ` -
目前只定義告警候選 gate;不建立 alert queue、不派送 Telegram、不呼叫 LLM、不寫 DB。${blockers ? `阻擋:${escapeHtml(blockers)}` : ''}
+
目前只定義告警候選與人工審核流程;不建立 alert queue、不建立 review queue、不執行審核動作、不派送 Telegram、不呼叫 LLM、不寫 DB。${blockers ? `阻擋:${escapeHtml(blockers)}` : ''}
dedupe=${escapeHtml(throttle.dedupe_window_hours || 'n/a')}h / telegram_daily=${escapeHtml(throttle.max_telegram_candidates_per_day || 0)} / ai_digest=${escapeHtml(throttle.max_ai_briefing_items_per_digest || 0)}
@@ -2069,6 +2089,35 @@
+
+

REVIEW STATES

+
${ + reviewStates.length + ? reviewStates.map(renderReviewState).join('') + : '
尚未提供審核狀態。
' + }
+
+
+

REVIEW ACTIONS

+
${ + reviewActions.length + ? reviewActions.map(renderReviewAction).join('') + : '
尚未提供審核操作。
' + }
+
+
+

APPROVAL POLICY

+
${ + Object.entries(approval).map(([key, value]) => ` +
+
+ ${escapeHtml(key)} +
+ ${value ? 'REQUIRED' : 'BLOCK'} +
+ `).join('') + }
+

OPERATOR SEQUENCE

${ diff --git a/tests/test_market_intel_skeleton.py b/tests/test_market_intel_skeleton.py index 646c47e..a149284 100644 --- a/tests/test_market_intel_skeleton.py +++ b/tests/test_market_intel_skeleton.py @@ -475,6 +475,9 @@ def test_market_intel_preview_template_uses_safe_fetch_false_endpoint(): assert "data-market-intel-opportunity-alert-channels" in template assert "data-market-intel-opportunity-alert-escalation" in template assert "data-market-intel-opportunity-alert-payload" in template + assert "data-market-intel-opportunity-alert-review" in template + assert "data-market-intel-opportunity-alert-actions" in template + assert "data-market-intel-opportunity-alert-approval" in template assert "data-market-intel-opportunity-alert-sequence" in template assert "data-market-intel-migration" in template assert "data-market-intel-migration-tables" in template @@ -524,7 +527,7 @@ def test_legacy_source_bridge_default_is_planned_only(): bridge = MarketIntelService().build_legacy_source_bridge() assert bridge["mode"] == "legacy_source_bridge_planned" - assert bridge["phase"] == "phase_38_opportunity_alert_plan_preview" + assert bridge["phase"] == "phase_39_opportunity_alert_review_preview" assert bridge["execute_requested"] is False assert bridge["read_only_query_executed"] is False assert bridge["database_connection_opened"] is False @@ -682,7 +685,7 @@ def test_mcp_tool_contract_preview_is_read_only_and_whitelisted(): contract = MarketIntelService().build_mcp_tool_contract() assert contract["mode"] == "mcp_tool_contract_preview" - assert contract["phase"] == "phase_38_opportunity_alert_plan_preview" + assert contract["phase"] == "phase_39_opportunity_alert_review_preview" assert contract["caller"] == "market_intel" assert contract["contract_ready"] is True assert contract["blocked_reasons"] == [] @@ -815,7 +818,7 @@ def test_mcp_activation_runbook_route_is_preview_only(): assert response.status_code == 200 assert data["mode"] == "mcp_activation_runbook_preview" - assert data["phase"] == "phase_38_opportunity_alert_plan_preview" + assert data["phase"] == "phase_39_opportunity_alert_review_preview" assert data["deployment_actions_executed"] is False assert data["docker_command_executed"] is False assert data["ssh_command_executed"] is False @@ -828,7 +831,7 @@ def test_mcp_fetch_gate_default_blocks_external_fetch(): gate = MarketIntelService().build_mcp_fetch_gate(fetch_requested=True) assert gate["mode"] == "mcp_fetch_gate_planned" - assert gate["phase"] == "phase_38_opportunity_alert_plan_preview" + assert gate["phase"] == "phase_39_opportunity_alert_review_preview" assert gate["fetch_requested"] is True assert gate["manual_fetch_gate_open"] is False assert gate["network_request_allowed"] is False @@ -898,7 +901,7 @@ def test_mcp_fetch_gate_route_is_preview_only(): assert response.status_code == 200 assert data["mode"] == "mcp_fetch_gate_planned" - assert data["phase"] == "phase_38_opportunity_alert_plan_preview" + assert data["phase"] == "phase_39_opportunity_alert_review_preview" assert data["fetch_requested"] is False assert data["network_request_allowed"] is False assert data["external_network_executed"] is False @@ -910,7 +913,7 @@ def test_scheduler_plan_preview_blocks_job_attachment(): plan = MarketIntelService().build_scheduler_plan() assert plan["mode"] == "scheduler_attach_plan_preview" - assert plan["phase"] == "phase_38_opportunity_alert_plan_preview" + assert plan["phase"] == "phase_39_opportunity_alert_review_preview" assert plan["ready_to_attach_scheduler"] is False assert plan["scheduler_attached"] is False assert plan["scheduler_registration_executed"] is False @@ -948,7 +951,7 @@ def test_scheduler_plan_route_is_preview_only(): assert response.status_code == 200 assert data["mode"] == "scheduler_attach_plan_preview" - assert data["phase"] == "phase_38_opportunity_alert_plan_preview" + assert data["phase"] == "phase_39_opportunity_alert_review_preview" assert data["scheduler_registration_executed"] is False assert data["crawler_job_started"] is False assert data["external_network_executed"] is False @@ -959,7 +962,7 @@ def test_match_review_plan_preview_blocks_auto_confirm(): plan = MarketIntelService().build_match_review_plan() assert plan["mode"] == "match_review_plan_preview" - assert plan["phase"] == "phase_38_opportunity_alert_plan_preview" + assert plan["phase"] == "phase_39_opportunity_alert_review_preview" assert plan["ready_for_review_queue"] is False assert plan["review_queue_created"] is False assert plan["auto_match_executed"] is False @@ -995,7 +998,7 @@ def test_match_review_plan_route_is_preview_only(): assert response.status_code == 200 assert data["mode"] == "match_review_plan_preview" - assert data["phase"] == "phase_38_opportunity_alert_plan_preview" + assert data["phase"] == "phase_39_opportunity_alert_review_preview" assert data["review_queue_created"] is False assert data["auto_confirm_executed"] is False assert data["external_network_executed"] is False @@ -1006,7 +1009,7 @@ def test_opportunity_plan_preview_blocks_alerts_and_ai_summary(): plan = MarketIntelService().build_opportunity_plan() assert plan["mode"] == "opportunity_plan_preview" - assert plan["phase"] == "phase_38_opportunity_alert_plan_preview" + assert plan["phase"] == "phase_39_opportunity_alert_review_preview" assert plan["ready_for_opportunity_queue"] is False assert plan["opportunity_queue_created"] is False assert plan["threat_alert_dispatched"] is False @@ -1047,7 +1050,7 @@ def test_opportunity_plan_route_is_preview_only(): assert response.status_code == 200 assert data["mode"] == "opportunity_plan_preview" - assert data["phase"] == "phase_38_opportunity_alert_plan_preview" + assert data["phase"] == "phase_39_opportunity_alert_review_preview" assert data["opportunity_queue_created"] is False assert data["threat_alert_dispatched"] is False assert data["ai_summary_generated"] is False @@ -1058,7 +1061,7 @@ def test_opportunity_scoring_plan_preview_blocks_scoring_and_alerts(): plan = MarketIntelService().build_opportunity_scoring_plan() assert plan["mode"] == "opportunity_scoring_plan_preview" - assert plan["phase"] == "phase_38_opportunity_alert_plan_preview" + assert plan["phase"] == "phase_39_opportunity_alert_review_preview" assert plan["ready_for_scoring_job"] is False assert plan["scoring_job_created"] is False assert plan["score_calculation_executed"] is False @@ -1106,7 +1109,7 @@ def test_opportunity_scoring_plan_route_is_preview_only(): assert response.status_code == 200 assert data["mode"] == "opportunity_scoring_plan_preview" - assert data["phase"] == "phase_38_opportunity_alert_plan_preview" + assert data["phase"] == "phase_39_opportunity_alert_review_preview" assert data["scoring_job_created"] is False assert data["score_calculation_executed"] is False assert data["sample_scores_generated"] is False @@ -1118,7 +1121,7 @@ def test_opportunity_evidence_plan_preview_blocks_queries_and_alerts(): plan = MarketIntelService().build_opportunity_evidence_plan() assert plan["mode"] == "opportunity_evidence_plan_preview" - assert plan["phase"] == "phase_38_opportunity_alert_plan_preview" + assert plan["phase"] == "phase_39_opportunity_alert_review_preview" assert plan["ready_for_evidence_bundle"] is False assert plan["evidence_bundle_created"] is False assert plan["evidence_query_executed"] is False @@ -1164,7 +1167,7 @@ def test_opportunity_evidence_plan_route_is_preview_only(): assert response.status_code == 200 assert data["mode"] == "opportunity_evidence_plan_preview" - assert data["phase"] == "phase_38_opportunity_alert_plan_preview" + assert data["phase"] == "phase_39_opportunity_alert_review_preview" assert data["evidence_bundle_created"] is False assert data["evidence_query_executed"] is False assert data["sample_evidence_generated"] is False @@ -1177,10 +1180,13 @@ def test_opportunity_alert_plan_preview_blocks_dispatch_and_llm_calls(): plan = MarketIntelService().build_opportunity_alert_plan() assert plan["mode"] == "opportunity_alert_plan_preview" - assert plan["phase"] == "phase_38_opportunity_alert_plan_preview" + assert plan["phase"] == "phase_39_opportunity_alert_review_preview" assert plan["ready_for_alert_candidates"] is False assert plan["alert_candidate_created"] is False assert plan["alert_queue_created"] is False + assert plan["review_queue_created"] is False + assert plan["review_action_executed"] is False + assert plan["approval_record_written"] is False assert plan["telegram_dispatched"] is False assert plan["ai_summary_generated"] is False assert plan["llm_call_executed"] is False @@ -1199,6 +1205,23 @@ def test_opportunity_alert_plan_preview_blocks_dispatch_and_llm_calls(): "telegram_candidate", "ai_briefing_candidate", } + assert plan["review_state_count"] == 6 + assert {item["key"] for item in plan["review_states"]} == { + "draft", + "needs_review", + "approved_for_digest", + "approved_for_telegram", + "rejected", + "deferred", + } + assert {item["key"] for item in plan["review_actions"]} == { + "approve_digest", + "approve_telegram", + "reject", + "defer", + } + assert plan["approval_policy"]["manual_approval_required_for_dispatch"] is True + assert plan["approval_policy"]["reviewer_identity_required"] is True assert "evidence_bundle_ready" in plan["blocked_reasons"] assert "scoring_job_ready" in plan["blocked_reasons"] assert "operator_approval" in plan["blocked_reasons"] @@ -1222,9 +1245,12 @@ def test_opportunity_alert_plan_route_is_preview_only(): assert response.status_code == 200 assert data["mode"] == "opportunity_alert_plan_preview" - assert data["phase"] == "phase_38_opportunity_alert_plan_preview" + assert data["phase"] == "phase_39_opportunity_alert_review_preview" assert data["alert_candidate_created"] is False assert data["alert_queue_created"] is False + assert data["review_queue_created"] is False + assert data["review_action_executed"] is False + assert data["approval_record_written"] is False assert data["telegram_dispatched"] is False assert data["llm_call_executed"] is False assert data["database_write_executed"] is False @@ -1294,7 +1320,7 @@ def test_mcp_deploy_preflight_route_is_preview_only(): assert response.status_code == 200 assert data["mode"] == "mcp_external_deploy_preflight_preview" - assert data["phase"] == "phase_38_opportunity_alert_plan_preview" + assert data["phase"] == "phase_39_opportunity_alert_review_preview" assert data["deployment_actions_executed"] is False assert data["docker_command_executed"] is False assert data["ssh_command_executed"] is False @@ -1309,7 +1335,7 @@ def test_mcp_readiness_default_is_planned_only(monkeypatch): readiness = MarketIntelService().build_mcp_readiness() assert readiness["mode"] == "mcp_readiness_planned" - assert readiness["phase"] == "phase_38_opportunity_alert_plan_preview" + assert readiness["phase"] == "phase_39_opportunity_alert_review_preview" assert readiness["execute_requested"] is False assert readiness["router_enabled"] is False assert readiness["external_mcp_complete"] is False @@ -1762,6 +1788,8 @@ def test_deployment_readiness_reports_app_only_release_gate(): assert readiness["opportunity_evidence_plan"]["evidence_query_executed"] is False assert readiness["opportunity_evidence_plan"]["database_write_executed"] is False assert readiness["opportunity_alert_plan"]["alert_candidate_created"] is False + assert readiness["opportunity_alert_plan"]["review_action_executed"] is False + assert readiness["opportunity_alert_plan"]["approval_record_written"] is False assert readiness["opportunity_alert_plan"]["telegram_dispatched"] is False assert readiness["opportunity_alert_plan"]["llm_call_executed"] is False assert readiness["opportunity_alert_plan"]["database_write_executed"] is False