diff --git a/apps/api/src/api/v1/agents.py b/apps/api/src/api/v1/agents.py index eba01efb5..cc9d6683a 100644 --- a/apps/api/src/api/v1/agents.py +++ b/apps/api/src/api/v1/agents.py @@ -85,6 +85,9 @@ from src.services.ai_agent_proactive_operations_contract import ( from src.services.ai_agent_redis_dry_run_gate import ( load_latest_ai_agent_redis_dry_run_gate, ) +from src.services.ai_agent_report_automation_review import ( + load_latest_ai_agent_report_automation_review, +) from src.services.ai_agent_report_truth_actionability_review import ( load_latest_ai_agent_report_truth_actionability_review, ) @@ -881,6 +884,33 @@ async def get_agent_report_truth_actionability_review() -> dict[str, Any]: ) from exc +@router.get( + "/agent-report-automation-review", + response_model=dict[str, Any], + summary="取得 AI Agent 日週月報與風險自動化 review", + description=( + "讀取最新已提交的 AI Agent 日報、週報、月報、Agent 工作量、圖表化報告、" + "AI 分析建議與高/中/低風險自動化政策;此端點不排程實發、不送 Telegram、" + "不啟動中低風險自動執行器、不執行生產優化、不讀 secret、不回傳內部工作視窗對話。" + ), +) +async def get_agent_report_automation_review() -> dict[str, Any]: + """Return the latest read-only AI Agent report automation review.""" + try: + return await asyncio.to_thread(load_latest_ai_agent_report_automation_review) + except FileNotFoundError as exc: + raise HTTPException( + status_code=status.HTTP_404_NOT_FOUND, + detail=str(exc), + ) from exc + except (json.JSONDecodeError, ValueError) as exc: + logger.error("ai_agent_report_automation_review_invalid", error=str(exc)) + raise HTTPException( + status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, + detail="AI Agent 日週月報與風險自動化 review 無效", + ) from exc + + @router.get( "/agent-owner-approved-fixture-dry-run", response_model=dict[str, Any], diff --git a/apps/api/src/services/ai_agent_report_automation_review.py b/apps/api/src/services/ai_agent_report_automation_review.py new file mode 100644 index 000000000..b569ba3a2 --- /dev/null +++ b/apps/api/src/services/ai_agent_report_automation_review.py @@ -0,0 +1,154 @@ +""" +AI Agent report automation review snapshot. + +Loads the latest committed P2-403J daily / weekly / monthly report, workload, +chart, and risk-tier automation policy review. This module never schedules a +live report, sends Telegram, writes optimization changes, or starts an +automation worker. +""" + +from __future__ import annotations + +import json +from pathlib import Path +from typing import Any + +from src.services.snapshot_paths import default_evaluations_dir + +_DEFAULT_EVALUATIONS_DIR = default_evaluations_dir(Path(__file__)) +_SNAPSHOT_PATTERN = "ai_agent_report_automation_review_*.json" +_SCHEMA_VERSION = "ai_agent_report_automation_review_v1" + + +def load_latest_ai_agent_report_automation_review( + evaluations_dir: Path | None = None, +) -> dict[str, Any]: + """Load the newest committed AI Agent report automation review snapshot.""" + directory = evaluations_dir or _DEFAULT_EVALUATIONS_DIR + candidates = sorted(directory.glob(_SNAPSHOT_PATTERN)) + if not candidates: + raise FileNotFoundError(f"no AI Agent report automation review snapshots found in {directory}") + + latest = candidates[-1] + with latest.open(encoding="utf-8") as handle: + payload = json.load(handle) + + if not isinstance(payload, dict): + raise ValueError(f"{latest}: expected JSON object") + _require_schema(payload, str(latest)) + _require_report_contract(payload, str(latest)) + _require_runtime_boundaries(payload, str(latest)) + _require_rollup_consistency(payload, str(latest)) + return payload + + +def _require_schema(payload: dict[str, Any], label: str) -> None: + if payload.get("schema_version") != _SCHEMA_VERSION: + raise ValueError(f"{label}: expected schema_version={_SCHEMA_VERSION}") + status = payload.get("program_status") or {} + if status.get("read_only_mode") is not True: + raise ValueError(f"{label}: program_status.read_only_mode must be true") + if status.get("runtime_authority") != "reporting_and_risk_policy_review_only_no_live_execution": + raise ValueError( + f"{label}: runtime_authority must remain reporting_and_risk_policy_review_only_no_live_execution" + ) + + +def _require_report_contract(payload: dict[str, Any], label: str) -> None: + cadences = payload.get("report_cadences") or [] + cadence_ids = {cadence.get("cadence_id") for cadence in cadences} + if cadence_ids != {"daily", "weekly", "monthly"}: + raise ValueError(f"{label}: report cadences must include daily, weekly, monthly") + + agent_ids = {agent.get("agent_id") for agent in payload.get("agent_workload_metrics") or []} + if agent_ids != {"openclaw", "hermes", "nemotron"}: + raise ValueError(f"{label}: workload metrics must include OpenClaw, Hermes, NemoTron") + + if not payload.get("report_charts"): + raise ValueError(f"{label}: report charts must not be empty") + if not payload.get("analysis_recommendations"): + raise ValueError(f"{label}: analysis recommendations must not be empty") + + risk_ids = {tier.get("risk_id") for tier in (payload.get("risk_tier_policy") or {}).get("risk_tiers") or []} + if not {"low", "medium", "high", "critical"}.issubset(risk_ids): + raise ValueError(f"{label}: risk tier policy must include low, medium, high, critical") + + +def _require_runtime_boundaries(payload: dict[str, Any], label: str) -> None: + truth = payload.get("report_truth") or {} + if truth.get("high_risk_requires_approval") is not True: + raise ValueError(f"{label}: high risk approval gate must remain true") + if truth.get("medium_low_auto_policy_defined") is not True: + raise ValueError(f"{label}: medium / low auto policy must be defined") + + zero_counts = { + "report_delivery_count_24h", + "report_read_receipt_count_24h", + "live_auto_optimization_count_24h", + "live_medium_low_auto_execution_count_24h", + } + non_zero = sorted(key for key in zero_counts if truth.get(key) != 0) + if non_zero: + raise ValueError(f"{label}: live report / automation counts must remain zero: {non_zero}") + + false_flags = { + "report_delivery_enabled", + "ai_analysis_after_report_enabled", + "medium_low_auto_execution_enabled", + } + unsafe_truth = sorted(flag for flag in false_flags if truth.get(flag) is not False) + if unsafe_truth: + raise ValueError(f"{label}: live report automation flags must remain false: {unsafe_truth}") + + boundaries = payload.get("approval_boundaries") or {} + unsafe_boundaries = sorted( + key + for key, value in boundaries.items() + if key != "high_risk_requires_human_approval" and value is not False + ) + if unsafe_boundaries: + raise ValueError(f"{label}: approval boundaries must remain false: {unsafe_boundaries}") + if boundaries.get("high_risk_requires_human_approval") is not True: + raise ValueError(f"{label}: high_risk_requires_human_approval must remain true") + + +def _require_rollup_consistency(payload: dict[str, Any], label: str) -> None: + rollups = payload.get("rollups") or {} + workload = payload.get("agent_workload_metrics") or [] + recommendations = payload.get("analysis_recommendations") or [] + charts = payload.get("report_charts") or [] + cadences = payload.get("report_cadences") or [] + + expected = { + "report_cadence_count": len(cadences), + "agent_count": len(workload), + "chart_count": len(charts), + "recommendation_count": len(recommendations), + "workload_unit_total": sum(item.get("work_units_total", 0) for item in workload), + "workload_done_total": sum(item.get("work_units_done", 0) for item in workload), + "workload_waiting_approval_total": sum(item.get("work_units_waiting_approval", 0) for item in workload), + "live_report_delivery_count": 0, + "live_auto_optimization_count": 0, + } + for risk in ("low", "medium", "high", "critical"): + expected[f"{risk}_risk_recommendation_count"] = len( + [item for item in recommendations if item.get("risk_tier") == risk] + ) + + mismatched = { + key: {"expected": value, "actual": rollups.get(key)} + for key, value in expected.items() + if rollups.get(key) != value + } + if mismatched: + raise ValueError(f"{label}: rollup counts must match payload sections: {mismatched}") + + approval_required = sorted( + item.get("recommendation_id") + for item in recommendations + if item.get("approval_required") is True + ) + if sorted(rollups.get("approval_required_recommendation_ids") or []) != approval_required: + raise ValueError(f"{label}: approval_required_recommendation_ids mismatch") + if rollups.get("current_auto_execution_enabled_count") != 0: + raise ValueError(f"{label}: current auto execution count must remain zero") diff --git a/apps/api/tests/test_ai_agent_interaction_learning_proof.py b/apps/api/tests/test_ai_agent_interaction_learning_proof.py index 9963a814c..96d8f8781 100644 --- a/apps/api/tests/test_ai_agent_interaction_learning_proof.py +++ b/apps/api/tests/test_ai_agent_interaction_learning_proof.py @@ -13,7 +13,7 @@ def test_load_latest_ai_agent_interaction_learning_proof_reads_committed_snapsho data = load_latest_ai_agent_interaction_learning_proof() assert data["schema_version"] == "ai_agent_interaction_learning_proof_v1" - assert data["program_status"]["overall_completion_percent"] == 99 + assert data["program_status"]["overall_completion_percent"] == 100 assert data["program_status"]["current_task_id"] == "P2-403J" assert data["program_status"]["next_task_id"] == "P2-403K" assert data["program_status"]["read_only_mode"] is True @@ -26,10 +26,10 @@ def test_load_latest_ai_agent_interaction_learning_proof_reads_committed_snapsho assert data["frontend_redaction"]["raw_prompt_display_allowed"] is False assert data["approval_boundaries"]["runtime_worker_allowed"] is False assert data["approval_boundaries"]["telegram_direct_send_allowed"] is False - assert data["rollups"]["proof_level_count"] == len(data["proof_ladder"]) == 8 - assert data["rollups"]["signal_count"] == len(data["proof_signals"]) == 10 + assert data["rollups"]["proof_level_count"] == len(data["proof_ladder"]) == 9 + assert data["rollups"]["signal_count"] == len(data["proof_signals"]) == 11 assert data["rollups"]["operator_surface_count"] == len(data["operator_surfaces"]) == 5 - assert data["rollups"]["runtime_gate_count"] == len(data["runtime_gates"]) == 6 + assert data["rollups"]["runtime_gate_count"] == len(data["runtime_gates"]) == 7 assert data["rollups"]["live_signal_count"] == 0 assert data["rollups"]["live_pending_level_ids"] == [] assert {lane["agent_id"] for lane in data["agent_lanes"]} == { diff --git a/apps/api/tests/test_ai_agent_interaction_learning_proof_api.py b/apps/api/tests/test_ai_agent_interaction_learning_proof_api.py index 8554d5c1a..a3a210cc6 100644 --- a/apps/api/tests/test_ai_agent_interaction_learning_proof_api.py +++ b/apps/api/tests/test_ai_agent_interaction_learning_proof_api.py @@ -16,7 +16,7 @@ def test_ai_agent_interaction_learning_proof_endpoint_returns_committed_snapshot assert response.status_code == 200 data = response.json() assert data["schema_version"] == "ai_agent_interaction_learning_proof_v1" - assert data["program_status"]["overall_completion_percent"] == 99 + assert data["program_status"]["overall_completion_percent"] == 100 assert data["program_status"]["current_task_id"] == "P2-403J" assert data["program_status"]["next_task_id"] == "P2-403K" assert data["program_status"]["read_only_mode"] is True @@ -26,9 +26,9 @@ def test_ai_agent_interaction_learning_proof_endpoint_returns_committed_snapshot assert data["frontend_redaction"]["operator_conversation_display_allowed"] is False assert data["approval_boundaries"]["conversation_transcript_display_allowed"] is False assert data["approval_boundaries"]["telegram_direct_send_allowed"] is False - assert data["rollups"]["proof_level_count"] == 8 - assert data["rollups"]["contract_ready_level_count"] == 6 - assert data["rollups"]["signal_count"] == 10 + assert data["rollups"]["proof_level_count"] == 9 + assert data["rollups"]["contract_ready_level_count"] == 7 + assert data["rollups"]["signal_count"] == 11 assert data["rollups"]["live_signal_count"] == 0 assert data["rollups"]["operator_surface_count"] == 5 assert any(lane["agent_id"] == "openclaw" for lane in data["agent_lanes"]) diff --git a/apps/api/tests/test_ai_agent_report_automation_review.py b/apps/api/tests/test_ai_agent_report_automation_review.py new file mode 100644 index 000000000..a021e97ca --- /dev/null +++ b/apps/api/tests/test_ai_agent_report_automation_review.py @@ -0,0 +1,91 @@ +import copy +import json + +import pytest + +from src.services.ai_agent_report_automation_review import ( + load_latest_ai_agent_report_automation_review, +) + + +def _write_snapshot(tmp_path, payload): + path = tmp_path / "ai_agent_report_automation_review_2026-06-12.json" + path.write_text(json.dumps(payload), encoding="utf-8") + return path + + +def test_load_latest_ai_agent_report_automation_review(): + data = load_latest_ai_agent_report_automation_review() + + assert data["schema_version"] == "ai_agent_report_automation_review_v1" + assert data["program_status"]["current_task_id"] == "P2-403J" + assert data["program_status"]["next_task_id"] == "P2-403K" + assert data["program_status"]["overall_completion_percent"] == 100 + assert data["report_truth"]["daily_report_ready"] is True + assert data["report_truth"]["weekly_report_ready"] is True + assert data["report_truth"]["monthly_report_ready"] is True + assert data["report_truth"]["medium_low_auto_policy_defined"] is True + assert data["report_truth"]["medium_low_auto_execution_enabled"] is False + assert data["report_truth"]["high_risk_requires_approval"] is True + assert data["report_truth"]["live_auto_optimization_count_24h"] == 0 + assert data["rollups"]["report_cadence_count"] == 3 + assert data["rollups"]["agent_count"] == 3 + assert data["rollups"]["chart_count"] == 4 + assert data["rollups"]["recommendation_count"] == 5 + assert data["rollups"]["workload_unit_total"] == 91 + assert data["rollups"]["current_auto_execution_enabled_count"] == 0 + assert data["rollups"]["live_report_delivery_count"] == 0 + assert data["rollups"]["live_auto_optimization_count"] == 0 + + +def test_rejects_missing_monthly_report(tmp_path): + data = load_latest_ai_agent_report_automation_review() + bad = copy.deepcopy(data) + bad["report_cadences"] = [ + cadence for cadence in bad["report_cadences"] if cadence["cadence_id"] != "monthly" + ] + bad["rollups"]["report_cadence_count"] = len(bad["report_cadences"]) + _write_snapshot(tmp_path, bad) + + with pytest.raises(ValueError, match="daily, weekly, monthly"): + load_latest_ai_agent_report_automation_review(tmp_path) + + +def test_rejects_medium_low_auto_execution_enabled(tmp_path): + data = load_latest_ai_agent_report_automation_review() + bad = copy.deepcopy(data) + bad["report_truth"]["medium_low_auto_execution_enabled"] = True + _write_snapshot(tmp_path, bad) + + with pytest.raises(ValueError, match="live report automation flags"): + load_latest_ai_agent_report_automation_review(tmp_path) + + +def test_rejects_high_risk_approval_disabled(tmp_path): + data = load_latest_ai_agent_report_automation_review() + bad = copy.deepcopy(data) + bad["report_truth"]["high_risk_requires_approval"] = False + _write_snapshot(tmp_path, bad) + + with pytest.raises(ValueError, match="high risk approval gate"): + load_latest_ai_agent_report_automation_review(tmp_path) + + +def test_rejects_report_delivery_count(tmp_path): + data = load_latest_ai_agent_report_automation_review() + bad = copy.deepcopy(data) + bad["report_truth"]["report_delivery_count_24h"] = 1 + _write_snapshot(tmp_path, bad) + + with pytest.raises(ValueError, match="live report / automation counts"): + load_latest_ai_agent_report_automation_review(tmp_path) + + +def test_rejects_rollup_mismatch(tmp_path): + data = load_latest_ai_agent_report_automation_review() + bad = copy.deepcopy(data) + bad["rollups"]["workload_unit_total"] = 999 + _write_snapshot(tmp_path, bad) + + with pytest.raises(ValueError, match="rollup counts"): + load_latest_ai_agent_report_automation_review(tmp_path) diff --git a/apps/api/tests/test_ai_agent_report_automation_review_api.py b/apps/api/tests/test_ai_agent_report_automation_review_api.py new file mode 100644 index 000000000..357812596 --- /dev/null +++ b/apps/api/tests/test_ai_agent_report_automation_review_api.py @@ -0,0 +1,28 @@ +from fastapi.testclient import TestClient + +from src.main import app + + +def test_get_ai_agent_report_automation_review_api(): + client = TestClient(app) + response = client.get("/api/v1/agents/agent-report-automation-review") + + assert response.status_code == 200 + data = response.json() + assert data["schema_version"] == "ai_agent_report_automation_review_v1" + assert data["program_status"]["current_task_id"] == "P2-403J" + assert data["program_status"]["next_task_id"] == "P2-403K" + assert data["program_status"]["overall_completion_percent"] == 100 + assert data["report_truth"]["daily_report_ready"] is True + assert data["report_truth"]["weekly_report_ready"] is True + assert data["report_truth"]["monthly_report_ready"] is True + assert data["report_truth"]["medium_low_auto_policy_defined"] is True + assert data["report_truth"]["medium_low_auto_execution_enabled"] is False + assert data["report_truth"]["high_risk_requires_approval"] is True + assert data["rollups"]["report_cadence_count"] == 3 + assert data["rollups"]["agent_count"] == 3 + assert data["rollups"]["chart_count"] == 4 + assert data["rollups"]["recommendation_count"] == 5 + assert data["rollups"]["workload_unit_total"] == 91 + assert data["rollups"]["current_auto_execution_enabled_count"] == 0 + assert data["rollups"]["live_auto_optimization_count"] == 0 diff --git a/apps/web/messages/en.json b/apps/web/messages/en.json index b10a3d5e6..d1b434fe9 100644 --- a/apps/web/messages/en.json +++ b/apps/web/messages/en.json @@ -4025,6 +4025,50 @@ "canonicalRoom": "唯一戰情室: {room}", "legacyRoutesDetail": "direct send / legacy chat / multi bot 必須收斂" } + }, + "reportAutomationReview": { + "title": "P2-403J 日週月報與風險自動化 Review", + "source": "{generated} · {current} → {next}", + "truthTitle": "目前報告真相", + "policyTitle": "風險自動化政策", + "workloadTitle": "每個 Agent 工作量", + "metrics": { + "overall": "P2-403J 進度", + "cadences": "報表週期", + "agents": "Agent 數", + "workload": "工作量", + "done": "已完成", + "recommendations": "AI 建議", + "approval": "需審核", + "autoEnabled": "自動執行" + }, + "flags": { + "daily": "日報: {value}", + "weekly": "週報: {value}", + "monthly": "月報: {value}", + "delivery": "live delivery: {value}", + "optimization": "live optimization: {value}", + "highApproval": "高風險審核: {value}", + "mediumLowPolicy": "中低風險政策: {value}", + "mediumLowExecution": "中低風險執行: {value}" + }, + "labels": { + "sections": "章節 {count}", + "liveDelivery": "實發 {count}", + "workUnits": "work units {count}", + "doneRatio": "完成比例", + "doneDetail": "{done}/{total} 已完成;{approval} 待審核", + "targets": "佈建 {count}", + "capabilities": "能力 {count}", + "liveRuntime": "live runtime {count}", + "approvalRequired": "需審核: {value}" + }, + "riskTiers": { + "low": "低風險", + "medium": "中風險", + "high": "高風險", + "critical": "關鍵阻擋" + } } } }, diff --git a/apps/web/messages/zh-TW.json b/apps/web/messages/zh-TW.json index b10a3d5e6..d1b434fe9 100644 --- a/apps/web/messages/zh-TW.json +++ b/apps/web/messages/zh-TW.json @@ -4025,6 +4025,50 @@ "canonicalRoom": "唯一戰情室: {room}", "legacyRoutesDetail": "direct send / legacy chat / multi bot 必須收斂" } + }, + "reportAutomationReview": { + "title": "P2-403J 日週月報與風險自動化 Review", + "source": "{generated} · {current} → {next}", + "truthTitle": "目前報告真相", + "policyTitle": "風險自動化政策", + "workloadTitle": "每個 Agent 工作量", + "metrics": { + "overall": "P2-403J 進度", + "cadences": "報表週期", + "agents": "Agent 數", + "workload": "工作量", + "done": "已完成", + "recommendations": "AI 建議", + "approval": "需審核", + "autoEnabled": "自動執行" + }, + "flags": { + "daily": "日報: {value}", + "weekly": "週報: {value}", + "monthly": "月報: {value}", + "delivery": "live delivery: {value}", + "optimization": "live optimization: {value}", + "highApproval": "高風險審核: {value}", + "mediumLowPolicy": "中低風險政策: {value}", + "mediumLowExecution": "中低風險執行: {value}" + }, + "labels": { + "sections": "章節 {count}", + "liveDelivery": "實發 {count}", + "workUnits": "work units {count}", + "doneRatio": "完成比例", + "doneDetail": "{done}/{total} 已完成;{approval} 待審核", + "targets": "佈建 {count}", + "capabilities": "能力 {count}", + "liveRuntime": "live runtime {count}", + "approvalRequired": "需審核: {value}" + }, + "riskTiers": { + "low": "低風險", + "medium": "中風險", + "high": "高風險", + "critical": "關鍵阻擋" + } } } }, diff --git a/apps/web/src/app/[locale]/governance/tabs/automation-inventory-tab.tsx b/apps/web/src/app/[locale]/governance/tabs/automation-inventory-tab.tsx index 9ddbb6e2e..aa22fe418 100644 --- a/apps/web/src/app/[locale]/governance/tabs/automation-inventory-tab.tsx +++ b/apps/web/src/app/[locale]/governance/tabs/automation-inventory-tab.tsx @@ -45,6 +45,7 @@ import { type AiAgentPostWriteVerifierPackageSnapshot, type AiAgentProactiveOperationsContractSnapshot, type AiAgentRedisDryRunGateSnapshot, + type AiAgentReportAutomationReviewSnapshot, type AiAgentReportTruthActionabilityReviewSnapshot, type AiAgentRuntimeVerifierEvidenceReviewSnapshot, type AiAgentRuntimeWriteGateReviewSnapshot, @@ -336,6 +337,7 @@ export function AutomationInventoryTab() { const [runtimeWriteGateReview, setRuntimeWriteGateReview] = useState(null) const [postWriteVerifierPackage, setPostWriteVerifierPackage] = useState(null) const [runtimeVerifierEvidenceReview, setRuntimeVerifierEvidenceReview] = useState(null) + const [reportAutomationReview, setReportAutomationReview] = useState(null) const [reportTruthActionabilityReview, setReportTruthActionabilityReview] = useState(null) const [ownerDryRunPackage, setOwnerDryRunPackage] = useState(null) const [hostStatefulInventory, setHostStatefulInventory] = useState(null) @@ -368,6 +370,7 @@ export function AutomationInventoryTab() { apiClient.getAiAgentRuntimeWriteGateReview(), apiClient.getAiAgentPostWriteVerifierPackage(), apiClient.getAiAgentRuntimeVerifierEvidenceReview(), + apiClient.getAiAgentReportAutomationReview(), apiClient.getAiAgentReportTruthActionabilityReview(), apiClient.getAiAgentOwnerApprovedFixtureDryRun(), apiClient.getAiAgentHostStatefulVersionInventory(), @@ -399,6 +402,7 @@ export function AutomationInventoryTab() { runtimeWriteGateReviewResult, postWriteVerifierPackageResult, runtimeVerifierEvidenceReviewResult, + reportAutomationReviewResult, reportTruthActionabilityReviewResult, ownerDryRunPackageResult, hostStatefulInventoryResult, @@ -427,6 +431,7 @@ export function AutomationInventoryTab() { setRuntimeWriteGateReview(runtimeWriteGateReviewResult.status === 'fulfilled' ? runtimeWriteGateReviewResult.value : null) setPostWriteVerifierPackage(postWriteVerifierPackageResult.status === 'fulfilled' ? postWriteVerifierPackageResult.value : null) setRuntimeVerifierEvidenceReview(runtimeVerifierEvidenceReviewResult.status === 'fulfilled' ? runtimeVerifierEvidenceReviewResult.value : null) + setReportAutomationReview(reportAutomationReviewResult.status === 'fulfilled' ? reportAutomationReviewResult.value : null) setReportTruthActionabilityReview(reportTruthActionabilityReviewResult.status === 'fulfilled' ? reportTruthActionabilityReviewResult.value : null) setOwnerDryRunPackage(ownerDryRunPackageResult.status === 'fulfilled' ? ownerDryRunPackageResult.value : null) setHostStatefulInventory(hostStatefulInventoryResult.status === 'fulfilled' ? hostStatefulInventoryResult.value : null) @@ -453,6 +458,7 @@ export function AutomationInventoryTab() { runtimeWriteGateReviewResult, postWriteVerifierPackageResult, runtimeVerifierEvidenceReviewResult, + reportAutomationReviewResult, reportTruthActionabilityReviewResult, ownerDryRunPackageResult, hostStatefulInventoryResult, @@ -840,6 +846,24 @@ export function AutomationInventoryTab() { }) }, [runtimeVerifierEvidenceReview]) + const visibleReportCharts = useMemo(() => { + if (!reportAutomationReview) return [] + return reportAutomationReview.report_charts.slice(0, 4) + }, [reportAutomationReview]) + + const visibleReportRecommendations = useMemo(() => { + if (!reportAutomationReview) return [] + const priority = { critical: 0, high: 0, medium: 1, low: 2 } as Record + return [...reportAutomationReview.analysis_recommendations] + .sort((a, b) => { + const left = priority[a.risk_tier] ?? 3 + const right = priority[b.risk_tier] ?? 3 + if (left !== right) return left - right + return Number(b.approval_required) - Number(a.approval_required) + }) + .slice(0, 5) + }, [reportAutomationReview]) + const visibleReportTruthFindings = useMemo(() => { if (!reportTruthActionabilityReview) return [] const priority = { critical: 0, high: 1, medium: 2, low: 3 } as Record @@ -1059,7 +1083,7 @@ export function AutomationInventoryTab() { ) } - if (error || !snapshot || !backlog || !backupTargets || !backupReadiness || !backupPolicy || !offsiteEscrow || !giteaHealth || !observabilityMatrix || !providerRouteMatrix || !deploymentLayout || !proactiveOperations || !interactionLearningProof || !liveReadModelGate || !redisDryRunGate || !learningWritebackPackage || !telegramReceiptPackage || !ownerApprovedLearningDryRun || !runtimeWriteGateReview || !postWriteVerifierPackage || !runtimeVerifierEvidenceReview || !reportTruthActionabilityReview || !ownerDryRunPackage || !hostStatefulInventory || !serviceHealthGapMatrix || !serviceHealthNotificationPolicy) { + if (error || !snapshot || !backlog || !backupTargets || !backupReadiness || !backupPolicy || !offsiteEscrow || !giteaHealth || !observabilityMatrix || !providerRouteMatrix || !deploymentLayout || !proactiveOperations || !interactionLearningProof || !liveReadModelGate || !redisDryRunGate || !learningWritebackPackage || !telegramReceiptPackage || !ownerApprovedLearningDryRun || !runtimeWriteGateReview || !postWriteVerifierPackage || !runtimeVerifierEvidenceReview || !reportAutomationReview || !reportTruthActionabilityReview || !ownerDryRunPackage || !hostStatefulInventory || !serviceHealthGapMatrix || !serviceHealthNotificationPolicy) { return (
@@ -1198,6 +1222,16 @@ export function AutomationInventoryTab() { const runtimeVerifierApprovals = runtimeVerifierEvidenceReview.rollups.approval_required_action_ids.length const runtimeVerifierBlockedActions = runtimeVerifierEvidenceReview.rollups.blocked_runtime_action_count const runtimeVerifierLiveTotal = runtimeVerifierEvidenceReview.rollups.live_verifier_execution_count + const reportAutomationOverall = reportAutomationReview.program_status.overall_completion_percent + const reportCadenceCount = reportAutomationReview.rollups.report_cadence_count + const reportAgentCount = reportAutomationReview.rollups.agent_count + const reportWorkloadTotal = reportAutomationReview.rollups.workload_unit_total + const reportWorkloadDone = reportAutomationReview.rollups.workload_done_total + const reportRecommendations = reportAutomationReview.rollups.recommendation_count + const reportApprovalRecommendations = reportAutomationReview.rollups.approval_required_recommendation_ids.length + const reportAutoEnabled = reportAutomationReview.rollups.current_auto_execution_enabled_count + const reportLiveDelivery = reportAutomationReview.rollups.live_report_delivery_count + const reportLiveOptimization = reportAutomationReview.rollups.live_auto_optimization_count const reportTruthOverall = reportTruthActionabilityReview.program_status.overall_completion_percent const reportTruthFindings = reportTruthActionabilityReview.rollups.zero_signal_finding_count const reportTruthCritical = reportTruthActionabilityReview.rollups.critical_finding_count @@ -1793,6 +1827,176 @@ export function AutomationInventoryTab() {
+
+
+
+ + + {t('reportAutomationReview.title')} + +
+ +
+ +
+ } /> + } /> + } /> + } /> + } /> + } /> + 0 ? 'danger' : 'ok'} icon={} /> + } /> +
+ +
+
+
+ {t('reportAutomationReview.truthTitle')} + + {reportAutomationReview.report_truth.truth_note} + +
+ + + + + +
+
+ +
+ {t('reportAutomationReview.policyTitle')} + + {reportAutomationReview.risk_tier_policy.policy_summary} + +
+ + + +
+
+ +
+ {reportAutomationReview.report_cadences.map(cadence => ( +
+
+ + {cadence.display_name} + + +
+ + {cadence.schedule} + +
+ + +
+
+ ))} +
+
+ +
+ {t('reportAutomationReview.workloadTitle')} + {reportAutomationReview.agent_workload_metrics.map(agent => { + const progress = agent.work_units_total > 0 ? Math.round((agent.work_units_done / agent.work_units_total) * 100) : 0 + return ( +
+
+ + {agent.display_name} + + +
+ = 85 ? 'ok' : 'warn'} + /> +
+ + + +
+
+ ) + })} +
+
+ +
+ {visibleReportCharts.map(chart => { + const maxValue = Math.max(...chart.series.map(item => item.value), 1) + return ( +
+
+ + {chart.display_name} + + +
+ + {chart.operator_question} + +
+ {chart.series.map(item => ( +
+ + {item.label} + +
+
+
+ + {item.value} + +
+ ))} +
+
+ ) + })} +
+ +
+ {visibleReportRecommendations.map(recommendation => { + const tone = recommendation.risk_tier === 'high' || recommendation.risk_tier === 'critical' ? 'danger' : recommendation.risk_tier === 'medium' ? 'warn' : 'ok' + return ( +
+
+ + {recommendation.display_name} + + +
+
+ + +
+ + {recommendation.proposed_solution} + + +
+ ) + })} +
+
+
diff --git a/apps/web/src/lib/api-client.ts b/apps/web/src/lib/api-client.ts index 67bd99b02..37471df96 100644 --- a/apps/web/src/lib/api-client.ts +++ b/apps/web/src/lib/api-client.ts @@ -322,6 +322,11 @@ export const apiClient = { return handleResponse(res) }, + async getAiAgentReportAutomationReview() { + const res = await fetch(`${API_BASE_URL}/agents/agent-report-automation-review`) + return handleResponse(res) + }, + async getAiAgentOwnerApprovedFixtureDryRun() { const res = await fetch(`${API_BASE_URL}/agents/agent-owner-approved-fixture-dry-run`) return handleResponse(res) @@ -1948,6 +1953,127 @@ export interface AiAgentReportTruthActionabilityReviewSnapshot { } } +export interface AiAgentReportAutomationReviewSnapshot { + schema_version: 'ai_agent_report_automation_review_v1' + generated_at: string + program_status: { + overall_completion_percent: number + current_priority: 'P0' | 'P1' | 'P2' | 'P3' + current_task_id: string + next_task_id: string + read_only_mode: true + runtime_authority: 'reporting_and_risk_policy_review_only_no_live_execution' + status_note: string + } + source_refs: string[] + report_truth: { + daily_report_ready: true + weekly_report_ready: true + monthly_report_ready: true + per_agent_workload_ready: true + chart_package_ready: true + report_delivery_enabled: false + report_delivery_count_24h: number + report_read_receipt_count_24h: number + ai_analysis_after_report_enabled: false + medium_low_auto_policy_defined: true + medium_low_auto_execution_enabled: false + live_medium_low_auto_execution_count_24h: number + high_risk_requires_approval: true + live_auto_optimization_count_24h: number + truth_note: string + } + report_cadences: Array<{ + cadence_id: 'daily' | 'weekly' | 'monthly' + display_name: string + owner_agent: 'openclaw' | 'hermes' | 'nemotron' + schedule: string + sections: string[] + chart_ids: string[] + delivery_channel: string + status: string + live_delivery_count: number + }> + agent_workload_metrics: Array<{ + agent_id: 'openclaw' | 'hermes' | 'nemotron' + display_name: string + primary_role: string + deployment_targets: number + delegable_capabilities: number + report_owned_sections: number + analysis_owned_recommendations: number + work_units_total: number + work_units_done: number + work_units_waiting_approval: number + live_runtime_work_units_24h: number + workload_note: string + }> + report_charts: Array<{ + chart_id: string + display_name: string + chart_type: string + unit: string + series: Array<{ + label: string + value: number + tone: 'ok' | 'warn' | 'danger' | 'neutral' + }> + operator_question: string + }> + risk_tier_policy: { + policy_summary: string + risk_tiers: Array<{ + risk_id: 'low' | 'medium' | 'high' | 'critical' + display_name: string + approval_required: boolean + auto_action_policy: string + current_execution_enabled: false + required_before_enable: string[] + }> + } + analysis_recommendations: Array<{ + recommendation_id: string + display_name: string + owner_agent: 'openclaw' | 'hermes' | 'nemotron' + risk_tier: 'low' | 'medium' | 'high' | 'critical' + approval_required: boolean + current_auto_execution_enabled: false + problem: string + proposed_solution: string + expected_report_signal: string + blocked_runtime_action: string + }> + approval_boundaries: Record + display_redaction_contract: { + redaction_required: true + raw_report_payload_display_allowed: false + private_reasoning_display_allowed: false + secret_value_display_allowed: false + work_window_transcript_display_allowed: false + allowed_frontend_content: string[] + forbidden_frontend_content: string[] + frontend_display_policy: string + } + rollups: { + report_cadence_count: number + agent_count: number + chart_count: number + recommendation_count: number + workload_unit_total: number + workload_done_total: number + workload_waiting_approval_total: number + low_risk_recommendation_count: number + medium_risk_recommendation_count: number + high_risk_recommendation_count: number + critical_risk_recommendation_count: number + approval_required_recommendation_ids: string[] + medium_low_auto_policy_count: number + current_auto_execution_enabled_count: number + live_report_delivery_count: number + live_auto_optimization_count: number + } +} + export interface AiAgentOwnerApprovedFixtureDryRunSnapshot { schema_version: 'ai_agent_owner_approved_fixture_dry_run_v1' generated_at: string diff --git a/docs/LOGBOOK.md b/docs/LOGBOOK.md index 3215064c6..7606850d0 100644 --- a/docs/LOGBOOK.md +++ b/docs/LOGBOOK.md @@ -1,3 +1,38 @@ +## 2026-06-12|P2-403J 日週月報與風險自動化 Review + +**背景**:統帥要求 AI Agent 產生日報、週報、月報,能看到每個 AI Agent 做了哪些工作與工作量,並以數據化、圖表化報告呈現;Agent 看過報告後要能自動分析評估並提出解決方案,高風險需統帥審核,中 / 低風險則朝自動處理並告警回報前進。本段先建立只讀 review、API、治理頁與測試,不直接開啟 runtime 執行。 + +**完成**: + +- 新增 `ai_agent_report_automation_review_v1` schema、committed snapshot、只讀 loader、API route 與測試。 +- 新增 `GET /api/v1/agents/agent-report-automation-review`:回傳日報 / 週報 / 月報、每個 Agent 工作量、圖表化 report package、AI 分析建議、高 / 中 / 低風險自動化 policy、前端 redaction boundary 與 rollup;不排程實發、不送 Telegram、不啟動中低風險 auto worker、不執行生產優化、不讀 secret、不回傳工作視窗對話。 +- Snapshot 固定 `3` 個報表週期、`3` 個 Agent 工作量、`4` 個 chart package、`5` 個 AI recommendation、總工作量 `91`、已完成 `79`、待審核 `12`、需要人工審核的高風險建議 `2`;live report delivery 與 live auto optimization 全部 `0`。 +- Governance automation inventory 頁新增 P2-403J「日週月報與風險自動化 Review」區塊,顯示報表週期、Agent workload、圖表、AI 建議與高 / 中 / 低風險 policy;仍不提供批准、執行、發送或優化按鈕。 +- 與上一段 `ai_agent_report_truth_actionability_review_v1` 合併成 P2-403J 報表治理口徑:先判斷報表真相與 Telegram actionability,再看 Agent 工作量、圖表與自動化建議。 +- `agent-interaction-learning-proof` 與 `agent-proactive-operations-contract` 已同步 current / next:`P2-403J -> P2-403K`;三 Agent 主動溝通、學習與成長證據完成度 `99% -> 100%`。 +- MASTER §3.2.1b / §3.2.1c / §3.2.1d、AI Agent 自動化工作清單、互動學習證據報告與主動營運報告已同步 P2-403J;下一步為 `P2-403K` unified report truth service / 中低風險 runtime guard / SRE 戰情室路由遷移批准包。 + +**本地驗證**: + +- JSON parse:P2-403J report automation schema / snapshot、report truth snapshot、interaction snapshot、proactive snapshot、`zh-TW.json`、`en.json` 通過。 +- `cmp -s apps/web/messages/zh-TW.json apps/web/messages/en.json`:通過。 +- `python3 -m py_compile apps/api/src/services/ai_agent_report_automation_review.py apps/api/src/services/ai_agent_report_truth_actionability_review.py apps/api/src/api/v1/agents.py`:通過。 +- `DATABASE_URL='postgresql+asyncpg://test:test@localhost/test' PYTHONPATH=apps/api pytest -q apps/api/tests/test_ai_agent_report_automation_review.py apps/api/tests/test_ai_agent_report_automation_review_api.py apps/api/tests/test_ai_agent_report_truth_actionability_review.py apps/api/tests/test_ai_agent_report_truth_actionability_review_api.py apps/api/tests/test_ai_agent_interaction_learning_proof.py apps/api/tests/test_ai_agent_interaction_learning_proof_api.py apps/api/tests/test_ai_agent_proactive_operations_contract.py apps/api/tests/test_ai_agent_proactive_operations_contract_api.py`:`26 passed`。 +- `pnpm --filter @awoooi/web typecheck`:通過;驗證產生的 `apps/web/tsconfig.tsbuildinfo` 暫態變更已排除。 +- `NEXT_PUBLIC_API_URL=https://awoooi.wooo.work NEXT_PRIVATE_BUILD_WORKER_COUNT=1 SENTRY_SUPPRESS_GLOBAL_ERROR_HANDLER_FILE_WARNING=1 pnpm --filter @awoooi/web build`:通過;Webpack cache 曾出現 `ENOSPC` 快取寫入 warning,但 build exit code `0`。 +- `python3 scripts/security/security-mirror-progress-guard.py --root .`:`SECURITY_MIRROR_PROGRESS_GUARD_OK`。 +- `python3 scripts/security/source-control-owner-response-guard.py --root .`:`SOURCE_CONTROL_OWNER_RESPONSE_GUARD_OK`。 +- `python3 scripts/ops/doc-secrets-sanity-check.py docs .gitea`:`DOC_SECRET_SANITY_OK scanned_files=709`。 +- `git diff --check` / `git diff --cached --check`:通過。 + +**完成度同步**: + +- P2-403J 日週月報與風險自動化 Review:本地契約 / API / UI 接線完成,正式站驗證待推版。 +- 三 Agent 主動溝通、學習與成長證據:`100%`,但 live AgentSession、Agent message、handoff、learning write、Telegram receipt、report delivery、AI analysis runtime、中低風險 auto worker、runtime verifier execution、Telegram route change 與 Telegram send 仍全部為 `0`。 +- IwoooS 整體仍維持 `64%`;active runtime gate 仍 `0`。 + +**邊界**:本段尚未排程實發報告、未送 Telegram、未寫 Gateway queue、未啟動 AI analysis runtime、未啟動中低風險 auto worker、未執行生產優化、未改 Telegram route / receiver、未讀 secret value、未寫 work item / KM / PlayBook trust、未啟動 runtime worker、未 SSH、未 active scan、未把工作視窗對話內容放到前端。 + ## 2026-06-12|P2-403J 報表真相與告警有效性審查 **背景**:統帥指出 AWOOOI 週報告警、AI 效能、K3s、開發活動與 AI 成本全為 `0`,這種報表沒有營運價值,也可能代表資料來源失效而非系統健康;同時本產品所有告警必須集中到 **AwoooI SRE 戰情室**,不得散到其他 TG Bot 或群組。 diff --git a/docs/ai/AI_AGENT_AUTOMATION_WORKLIST_2026-06-04.md b/docs/ai/AI_AGENT_AUTOMATION_WORKLIST_2026-06-04.md index 8050234b9..dba052204 100644 --- a/docs/ai/AI_AGENT_AUTOMATION_WORKLIST_2026-06-04.md +++ b/docs/ai/AI_AGENT_AUTOMATION_WORKLIST_2026-06-04.md @@ -12,7 +12,7 @@ | Nemotron 實際整合應用 | 30% | 完整回放前仍被關卡擋下 | `blocked_needs_evidence`,下一關是 `refresh_source_evidence_then_5_record_smoke_only` | | 工具 / 服務 / 套件 AI 自動化 | 92% | P0 已完成;P1 服務 / runtime / 監控 / provider / service health / 備份 / DR / 套件與供應鏈只讀基線已完成;P1-007 失敗限定通知合約與前端 redaction 合約已完成;下一主線是 P2-004 依賴 / 供應鏈漂移監控 | 狀態分類、盤點 schema、權限矩陣、靜態盤點種子、只讀 API、UI 骨架、驗證、自動化待辦 schema / 快照 / API / 分組 UI、Backup / DR 目標盤點、準備度矩陣、備份通知政策、Backup / DR 證據 UI、復原演練批准包模板、異地 / escrow 準備度狀態、任務批准邊界、確定性進度彙總、Python 套件 / 供應鏈只讀基線、JS pnpm/npm 只讀基線、Docker build surface 只讀基線、CVE / license / drift 嚴重度政策、定期依賴漂移與外部資料來源檢查設計、依賴升級批准包模板、runtime_surface_inventory_v1 schema / snapshot / API / UI、gitea_workflow_runner_health_v1 schema / snapshot / API / UI、observability_contract_matrix_v1 schema / snapshot / API / UI、ai_provider_route_matrix_v1 schema / snapshot / API / UI、service_health_gap_matrix_v1 schema / snapshot / API / UI、service health evidence cards UI、service_health_failure_notification_policy_v1 schema / snapshot / API / UI 已完成 | | OpenClaw / Hermes / NemoTron 佈建布局 | 45% | P1-401 / P1-402 已完成;仍是只讀 layout 與治理頁顯示,不是 runtime deploy | `ai_agent_deployment_layout_v1` schema、`ai_agent_deployment_layout_2026-06-11.json`、`GET /api/v1/agents/agent-deployment-layout`、治理頁自動化盤點 UI、`AI_AGENT_DEPLOYMENT_LAYOUT_2026-06-11.md` | -| OpenClaw / Hermes / NemoTron 主動溝通、學習與成長證據 | 99% | P2-401A 已完成只讀 contract;P2-403A 已完成互動 / 接手 / 學習 / 成長證據面板;P2-403B 已完成 AgentSession / Redis Streams live read model gate;P2-403C 已完成 Redis Streams consumer group dry-run、handoff envelope、ack / dead-letter / replay gate;P2-403D 已完成 learning writeback approval package;P2-403E 已完成 Telegram receipt approval package;P2-403F 已完成 owner-approved learning dry-run preview、人工操作選項與 fixture-only dry-run 總包;P2-403G 已完成 runtime write gate review,固定雙重批准、dry-run hash、post-write verifier 與 redaction 欄位;P2-403H 已完成 post-write verifier implementation package、rollback lane、failure lane 與人工操作選項;P2-403I 已完成 runtime verifier evidence implementation review;P2-403J 已完成報表真相與告警有效性審查,將全 0 週報視為低可信可處置異常,並要求本產品正式 TG 告警收斂到 AwoooI SRE 戰情室。runtime worker、DB migration、production Redis consumer group、Telegram 實發、Telegram route change、KM / PlayBook trust / timeline / replay score 寫入、SDK / 付費服務仍未開 gate | `ai_agent_communication_learning_contract_v1`、`ai_agent_interaction_learning_proof_v1`、`ai_agent_live_read_model_gate_v1`、`ai_agent_redis_dry_run_gate_v1`、`ai_agent_learning_writeback_approval_package_v1`、`ai_agent_telegram_receipt_approval_package_v1`、`ai_agent_owner_approved_learning_dry_run_v1`、`ai_agent_owner_approved_fixture_dry_run_v1`、`GET /api/v1/agents/agent-communication-learning-contract`、`GET /api/v1/agents/agent-interaction-learning-proof`、`GET /api/v1/agents/agent-live-read-model-gate`、`GET /api/v1/agents/agent-redis-dry-run-gate`、`GET /api/v1/agents/agent-learning-writeback-approval-package`、`GET /api/v1/agents/agent-telegram-receipt-approval-package`、`GET /api/v1/agents/agent-owner-approved-learning-dry-run`、`GET /api/v1/agents/agent-owner-approved-fixture-dry-run`、`ai_agent_runtime_write_gate_review_v1`、`GET /api/v1/agents/agent-runtime-write-gate-review`、`ai_agent_post_write_verifier_package_v1`、`GET /api/v1/agents/agent-post-write-verifier-package`、`ai_agent_runtime_verifier_evidence_review_v1`、`GET /api/v1/agents/agent-runtime-verifier-evidence-review`、`ai_agent_report_truth_actionability_review_v1`、`GET /api/v1/agents/agent-report-truth-actionability-review`、`/zh-TW/governance?tab=automation-inventory`、MASTER §3.2.1b / §3.2.1d / §3.4.3 | +| OpenClaw / Hermes / NemoTron 主動溝通、學習與成長證據 | 100% | P2-401A 已完成只讀 contract;P2-403A 已完成互動 / 接手 / 學習 / 成長證據面板;P2-403B 已完成 AgentSession / Redis Streams live read model gate;P2-403C 已完成 Redis Streams consumer group dry-run、handoff envelope、ack / dead-letter / replay gate;P2-403D 已完成 learning writeback approval package;P2-403E 已完成 Telegram receipt approval package;P2-403F 已完成 owner-approved learning dry-run preview、人工操作選項與 fixture-only dry-run 總包;P2-403G 已完成 runtime write gate review,固定雙重批准、dry-run hash、post-write verifier 與 redaction 欄位;P2-403H 已完成 post-write verifier implementation package、rollback lane、failure lane 與人工操作選項;P2-403I 已完成 runtime verifier evidence implementation review;P2-403J 已完成報表真相、告警有效性、日報、週報、月報、每個 Agent 工作量、圖表化報告、AI 分析建議與高 / 中 / 低風險自動化政策審查。runtime worker、DB migration、production Redis consumer group、Telegram 實發、Telegram route change、report delivery、AI analysis runtime、中低風險 auto worker、KM / PlayBook trust / timeline / replay score 寫入、SDK / 付費服務仍未開 gate | `ai_agent_communication_learning_contract_v1`、`ai_agent_interaction_learning_proof_v1`、`ai_agent_live_read_model_gate_v1`、`ai_agent_redis_dry_run_gate_v1`、`ai_agent_learning_writeback_approval_package_v1`、`ai_agent_telegram_receipt_approval_package_v1`、`ai_agent_owner_approved_learning_dry_run_v1`、`ai_agent_owner_approved_fixture_dry_run_v1`、`GET /api/v1/agents/agent-communication-learning-contract`、`GET /api/v1/agents/agent-interaction-learning-proof`、`GET /api/v1/agents/agent-live-read-model-gate`、`GET /api/v1/agents/agent-redis-dry-run-gate`、`GET /api/v1/agents/agent-learning-writeback-approval-package`、`GET /api/v1/agents/agent-telegram-receipt-approval-package`、`GET /api/v1/agents/agent-owner-approved-learning-dry-run`、`GET /api/v1/agents/agent-owner-approved-fixture-dry-run`、`ai_agent_runtime_write_gate_review_v1`、`GET /api/v1/agents/agent-runtime-write-gate-review`、`ai_agent_post_write_verifier_package_v1`、`GET /api/v1/agents/agent-post-write-verifier-package`、`ai_agent_runtime_verifier_evidence_review_v1`、`GET /api/v1/agents/agent-runtime-verifier-evidence-review`、`ai_agent_report_truth_actionability_review_v1`、`GET /api/v1/agents/agent-report-truth-actionability-review`、`ai_agent_report_automation_review_v1`、`GET /api/v1/agents/agent-report-automation-review`、`/zh-TW/governance?tab=automation-inventory`、MASTER §3.2.1b / §3.2.1d / §3.4.3 | | AI Agent 主動營運委派與版本生命週期 | 100% | P2-402A / P2-402B / P2-402C / P2-402D / P2-402E / P2-402F / P2-402G 已完成;已建立 repo-only 版本新鮮度快照、工具採用批准包、Telegram action-required digest policy、Gitea PR 草案 lane、host / K3s / stateful 版本只讀盤點、API 與 governance UI。定期排程、外部版本查詢、工具安裝、CI 變更、套件升級、主機更新、container pull、實際 PR creation、auto merge、Telegram 實發、SSH、kubectl、重啟仍未開 gate | `ai_agent_proactive_operations_contract_v1`、`ai_agent_version_freshness_snapshot_v1`、`ai_agent_tool_adoption_approval_package_v1`、`ai_agent_telegram_action_required_digest_policy_v1`、`ai_agent_gitea_pr_draft_lane_v1`、`ai_agent_host_stateful_version_inventory_v1`、`GET /api/v1/agents/agent-proactive-operations-contract`、`GET /api/v1/agents/agent-version-freshness-snapshot`、`GET /api/v1/agents/agent-tool-adoption-approval-package`、`GET /api/v1/agents/agent-telegram-action-required-digest-policy`、`GET /api/v1/agents/agent-gitea-pr-draft-lane`、`GET /api/v1/agents/agent-host-stateful-version-inventory`、`/zh-TW/governance?tab=automation-inventory`、MASTER §3.2.1c | | 本工作清單與分析報告 | 100% | 已完成 | 本 MD 文件 | @@ -20,9 +20,9 @@ AI Agent 自動化工作包目前完成度:**92%**。本工作清單文件本 三 Agent 佈建布局目前完成度:**45%**。第一波已完成只讀 schema / snapshot / API / 測試 / 報告,第二波已接入治理頁自動化盤點 UI;正式 runtime 佈署、Telegram E2E 發送與 AgentSession 工作流仍需逐項 gate。 -三 Agent 主動溝通、學習與成長證據目前完成度:**99%**。已完成只讀契約、互動 / 接手 / 學習 / 成長證據面板、P2-403B live read model gate、P2-403C Redis dry-run gate、P2-403D learning writeback approval package、P2-403E Telegram receipt approval package、P2-403F owner-approved learning dry-run preview、人工操作選項與 fixture-only dry-run 總包、P2-403G runtime write gate review、P2-403H post-write verifier implementation package、P2-403I runtime verifier evidence implementation review、P2-403J 報表真相與告警有效性審查、API、治理頁顯示、測試與 MASTER 同步;目前 live AgentSession、Agent message、handoff、learning write、Telegram receipt、Gateway queue write、runtime verifier execution、Telegram route change 與 Telegram send 仍全部為 `0`,下一步依優先順序推 `P2-403K` unified report truth service / SRE 戰情室路由遷移批准包,但在批准前仍不得啟動 runtime loop。 +三 Agent 主動溝通、學習與成長證據目前完成度:**100%**。已完成只讀契約、互動 / 接手 / 學習 / 成長證據面板、P2-403B live read model gate、P2-403C Redis dry-run gate、P2-403D learning writeback approval package、P2-403E Telegram receipt approval package、P2-403F owner-approved learning dry-run preview、人工操作選項與 fixture-only dry-run 總包、P2-403G runtime write gate review、P2-403H post-write verifier implementation package、P2-403I runtime verifier evidence implementation review、P2-403J 報表真相 / 告警有效性 / 日週月報 / Agent 工作量 / 圖表化報告 / AI 建議 / 風險自動化政策審查、API、治理頁顯示、測試與 MASTER 同步;目前 live AgentSession、Agent message、handoff、learning write、Telegram receipt、Gateway queue write、runtime verifier execution、report delivery、AI analysis runtime、中低風險 auto worker、Telegram route change 與 Telegram send 仍全部為 `0`,下一步依優先順序推 `P2-403K` unified report truth service / 中低風險 runtime guard / SRE 戰情室路由遷移批准包,但在批准前仍不得啟動 runtime loop。 -AI Agent 主動營運委派與版本生命週期目前完成度:**100%**。已完成 12 類版本 domain、24 類可委派能力、5 種 cadence、8 類 MCP、4 類 RAG memory、只讀 API、`P2-402B` repo-only daily version freshness snapshot、`P2-402C` Renovate / OSV-Scanner / Trivy / Syft / Grype 工具採用批准包、`P2-402D` Telegram action-required digest policy、`P2-402E` Gitea PR 草案 lane、`P2-402F` host OS / K3s / stateful services 版本只讀盤點,以及 `P2-402G` governance UI 顯示可委派能力;`P2-403A`、`P2-403B`、`P2-403C`、`P2-403D`、`P2-403E`、`P2-403F` 、`P2-403G`、`P2-403H`、`P2-403I` 與 `P2-403J` 已先補互動、學習證據面、live read model gate、Redis dry-run gate、learning writeback approval package、Telegram receipt approval package、owner-approved learning dry-run preview、runtime write gate review、post-write verifier package、runtime verifier evidence review、報表真相與 TG 戰情室收斂審查。下一步是 `P2-403K` unified report truth service / SRE 戰情室路由遷移批准包,外部 registry / package source / host probe / SSH / kubectl / 工具安裝 / CI 變更 / 實際 PR creation / Telegram 實發與 learning write 仍需 gate。 +AI Agent 主動營運委派與版本生命週期目前完成度:**100%**。已完成 12 類版本 domain、24 類可委派能力、5 種 cadence、8 類 MCP、4 類 RAG memory、只讀 API、`P2-402B` repo-only daily version freshness snapshot、`P2-402C` Renovate / OSV-Scanner / Trivy / Syft / Grype 工具採用批准包、`P2-402D` Telegram action-required digest policy、`P2-402E` Gitea PR 草案 lane、`P2-402F` host OS / K3s / stateful services 版本只讀盤點,以及 `P2-402G` governance UI 顯示可委派能力;`P2-403A`、`P2-403B`、`P2-403C`、`P2-403D`、`P2-403E`、`P2-403F` 、`P2-403G`、`P2-403H`、`P2-403I` 與 `P2-403J` 已先補互動、學習證據面、live read model gate、Redis dry-run gate、learning writeback approval package、Telegram receipt approval package、owner-approved learning dry-run preview、runtime write gate review、post-write verifier package、runtime verifier evidence review、報表真相、TG 戰情室收斂、日週月報、Agent 工作量、圖表化報告與風險自動化政策審查。下一步是 `P2-403K` unified report truth service / 中低風險 runtime guard / SRE 戰情室路由遷移批准包,外部 registry / package source / host probe / SSH / kubectl / 工具安裝 / CI 變更 / 實際 PR creation / Telegram 實發與 learning write 仍需 gate。 完成度計算模型: @@ -967,7 +967,7 @@ UI: | P2-403F | 完成 | 100 | Hermes + OpenClaw | Owner-approved learning dry-run preview、人工操作選項與驗證 / rollback gate | `ai_agent_owner_approved_learning_dry_run_v1` / snapshot / 只讀 API / governance UI;dry-run preview 欄位、operator actions、evidence gate、rollback / verification contract | 不產生 live preview、不寫 KM、不更新 PlayBook trust、不寫 timeline / replay score、不發 Telegram | | P2-403G | 完成 | 100 | OpenClaw | Runtime write gate review、雙重批准、dry-run hash、post-write verifier 與 redaction gate | `ai_agent_runtime_write_gate_review_v1` / snapshot / 只讀 API / governance UI;4 個 write target、4 個 approval gate、9 個必填欄位與 live write total `0` | 不寫 KM、不更新 PlayBook trust、不寫 timeline / replay score、不發 Telegram;runtime write 仍未授權 | | P2-403H | 完成 | 100 | OpenClaw | Post-write verifier implementation package、rollback lane、failure lane 與人工操作選項 | `ai_agent_post_write_verifier_package_v1` / snapshot / 只讀 API / governance UI;4 個 verification target、3 個 failure lane、4 個 operator action 與 live verifier execution `0` | 不讀 canonical target、不寫 rollback work item、不發 Telegram、不寫 KM / PlayBook trust / timeline / replay score;runtime verifier 仍未授權 | -| P2-403J | 完成 | 100 | OpenClaw | 報表真相與告警有效性審查;全 0 週報判為異常;本產品所有 TG 告警收斂至 AwoooI SRE 戰情室 | `ai_agent_report_truth_actionability_review_v1` / snapshot / 只讀 API / governance UI;5 個真相缺口、3 個日週月契約、4 個 actionability lane、4 條 TG 旁路風險、5 個 operator action | 不發 Telegram、不改 CronJob、不改 Prometheus / Alertmanager、不改 route / receiver、不讀 secret、不寫 work item / KM / PlayBook trust、不開 runtime worker | +| P2-403J | 完成 | 100 | Hermes + OpenClaw | 報表真相、告警有效性、日週月報、每個 Agent 工作量、圖表化報告、AI 分析建議與風險自動化政策審查;高風險需審核,中低風險目前只定義 policy | `ai_agent_report_truth_actionability_review_v1` + `ai_agent_report_automation_review_v1` / snapshot / 只讀 API / governance UI;5 個真相缺口、3 個日週月契約、4 個 actionability lane、4 條 TG 旁路風險、3 個報表週期、3 個 Agent 工作量、4 個 chart package、5 個 recommendation | 不發 Telegram、不改 CronJob、不改 Prometheus / Alertmanager、不改 route / receiver、不讀 secret、不寫 work item / KM / PlayBook trust、不開 runtime worker、不排程實發、不啟動中低風險 auto worker、不執行生產優化 | | P2-101 | 待辦 | 0 | OpenClaw | 定義操作類別權限模型 | 操作政策 schema | HITL 關卡 | | P2-102 | 待辦 | 0 | OpenClaw | 所有候選操作都要有 dry-run 證據 | dry-run 合約 | 不直接 apply | | P2-103 | 待辦 | 0 | Hermes | 把任務結果接回 KM / LOGBOOK / 稽核軌跡 | 證據寫入器 | 不洩漏 secret | diff --git a/docs/ai/AI_AGENT_INTERACTION_LEARNING_PROOF_2026-06-11.md b/docs/ai/AI_AGENT_INTERACTION_LEARNING_PROOF_2026-06-11.md index 97279a765..e17293fb5 100644 --- a/docs/ai/AI_AGENT_INTERACTION_LEARNING_PROOF_2026-06-11.md +++ b/docs/ai/AI_AGENT_INTERACTION_LEARNING_PROOF_2026-06-11.md @@ -1,18 +1,18 @@ # AI Agent 互動、溝通、學習與成長證據報告 > 日期:2026-06-11(台北時間) -> 文件定位:P2-403A 證據面 + P2-403B AgentSession / Redis Streams live read model gate + P2-403C Redis dry-run gate + P2-403D learning writeback approval package + P2-403E Telegram receipt approval package + P2-403F owner-approved learning dry-run / fixture dry-run、P2-403G runtime write gate review、P2-403H post-write verifier package、P2-403I runtime verifier evidence implementation review、API 與治理頁 UI。 -> 事實邊界:本波只建立可見證據面與 read model gate,不啟動 runtime worker、不建立 DB migration、不開 Redis consumer group、不發 Telegram、不顯示工作視窗對話內容。 +> 文件定位:P2-403A 證據面 + P2-403B AgentSession / Redis Streams live read model gate + P2-403C Redis dry-run gate + P2-403D learning writeback approval package + P2-403E Telegram receipt approval package + P2-403F owner-approved learning dry-run / fixture dry-run、P2-403G runtime write gate review、P2-403H post-write verifier package、P2-403I runtime verifier evidence implementation review、P2-403J 報表真相 / 日週月報 / Agent 工作量 / 風險自動化 review、API 與治理頁 UI。 +> 事實邊界:本波只建立可見證據面、read model gate 與報表治理 review,不啟動 runtime worker、不建立 DB migration、不開 Redis consumer group、不發 Telegram、不排程實發報告、不啟動中低風險 auto worker、不執行生產優化、不顯示工作視窗對話內容。 -## 0. P2-403J 補記:報表真相與 AwoooI SRE 戰情室收斂 +## 0. P2-403J 補記:報表真相、日週月報與風險自動化 Review -2026-06-12 已新增 P2-403J:`ai_agent_report_truth_actionability_review_v1`、`docs/evaluations/ai_agent_report_truth_actionability_review_2026-06-12.json`、`GET /api/v1/agents/agent-report-truth-actionability-review` 與治理頁區塊。 +2026-06-12 已新增 P2-403J:`ai_agent_report_truth_actionability_review_v1`、`ai_agent_report_automation_review_v1`、`docs/evaluations/ai_agent_report_truth_actionability_review_2026-06-12.json`、`docs/evaluations/ai_agent_report_automation_review_2026-06-12.json`、`GET /api/v1/agents/agent-report-truth-actionability-review`、`GET /api/v1/agents/agent-report-automation-review` 與治理頁區塊。 -本段把週報全 0 固定為「低可信可處置異常」,不是健康訊號;同時把本產品正式 Telegram 告警目標固定為 **AwoooI SRE 戰情室**(`SRE_GROUP_CHAT_ID`),其他 TG Bot / 群組 / direct Telegram API 路徑都列為待收斂旁路風險。此段仍只讀,不發 Telegram、不改 CronJob、不改 Alertmanager / Prometheus、不改 route / receiver、不讀 secret、不寫 work item / KM / PlayBook trust、不開 runtime worker。 +本段把週報全 0 固定為「低可信可處置異常」,不是健康訊號;同時把本產品正式 Telegram 告警目標固定為 **AwoooI SRE 戰情室**(`SRE_GROUP_CHAT_ID`),其他 TG Bot / 群組 / direct Telegram API 路徑都列為待收斂旁路風險。P2-403J 同步新增日報 / 週報 / 月報、每個 Agent 工作量、圖表化報告、AI 分析建議與高 / 中 / 低風險 policy review。此段仍只讀,不發 Telegram、不改 CronJob、不改 Alertmanager / Prometheus、不改 route / receiver、不讀 secret、不寫 work item / KM / PlayBook trust、不開 runtime worker、不排程實發報告、不啟動中低風險 auto worker。 ## 1. 結論 -已完成 P2-403A、P2-403B、P2-403C、P2-403D、P2-403E、P2-403F、P2-403G、P2-403H 與 P2-403I:讓統帥能在治理頁看到 OpenClaw / Hermes / NemoTron 的互動、接手、學習與成長是否真的有證據,並看到 live read model、Redis dry-run、handoff envelope、ack / dead-letter / replay、learning writeback approval、Telegram receipt approval、fixture dry-run、runtime write gate review、post-write verifier package 與 runtime verifier evidence review 下一步要通過哪些 gate。 +已完成 P2-403A、P2-403B、P2-403C、P2-403D、P2-403E、P2-403F、P2-403G、P2-403H、P2-403I 與 P2-403J:讓統帥能在治理頁看到 OpenClaw / Hermes / NemoTron 的互動、接手、學習與成長是否真的有證據,並看到 live read model、Redis dry-run、handoff envelope、ack / dead-letter / replay、learning writeback approval、Telegram receipt approval、fixture dry-run、runtime write gate review、post-write verifier package、runtime verifier evidence review、報表真相、日週月報、Agent 工作量、圖表化報告與風險自動化政策下一步要通過哪些 gate。 目前真相: @@ -30,6 +30,7 @@ | Agent message / handoff receipts | 未啟用,數量 `0` | | learning writeback | 未啟用,數量 `0` | | Telegram digest receipts | 未啟用,數量 `0` | +| Report delivery / AI analysis / auto optimization | 未啟用,數量 `0` | 這代表使用者現在可以看見「哪裡已準備好、哪裡仍未運作、被哪個 gate 阻擋、下一步要如何驗證」。但還不能宣稱三個 Agent 已經在 production runtime 主動互傳訊息或自主學習。 @@ -58,7 +59,7 @@ | 產物 | 內容 | |---|---| | `docs/schemas/ai_agent_interaction_learning_proof_v1.schema.json` | 強制 live flags / counts / Telegram / transcript / 私有推理維持安全邊界 | -| `docs/evaluations/ai_agent_interaction_learning_proof_2026-06-11.json` | P2-403A + P2-403B + P2-403C + P2-403D + P2-403E + P2-403F + P2-403G + P2-403H + P2-403I committed snapshot,完成度 `99%`,live count 全為 `0` | +| `docs/evaluations/ai_agent_interaction_learning_proof_2026-06-11.json` | P2-403A + P2-403B + P2-403C + P2-403D + P2-403E + P2-403F + P2-403G + P2-403H + P2-403I + P2-403J committed snapshot,完成度 `100%`,live count 全為 `0` | | `docs/schemas/ai_agent_live_read_model_gate_v1.schema.json` | 強制 DB / Redis / worker / Telegram / learning writeback gate 維持未批准 | | `docs/evaluations/ai_agent_live_read_model_gate_2026-06-11.json` | P2-403B committed snapshot,完成度 `55%`,live count 全為 `0` | | `docs/evaluations/ai_agent_redis_dry_run_gate_2026-06-11.json` | P2-403C committed snapshot,完成度 `65%`,live count 全為 `0` | @@ -73,17 +74,23 @@ | `docs/schemas/ai_agent_runtime_verifier_evidence_review_v1.schema.json` | P2-403I runtime verifier evidence review schema;強制 verifier implementation、canonical readback、rollback work item、Telegram failure receipt 與 live verifier execution 全部維持未授權 | | `docs/evaluations/ai_agent_runtime_verifier_evidence_review_2026-06-12.json` | P2-403I committed snapshot,完成度 `99%`,5 個 evidence check、4 個 implementation review lane、4 個 operator action 與 live verifier execution `0` | | `GET /api/v1/agents/agent-runtime-verifier-evidence-review` | 只讀 API;不實作或執行 verifier、不讀 canonical target、不寫 rollback work item、不發 Telegram | +| `docs/schemas/ai_agent_report_truth_actionability_review_v1.schema.json` | P2-403J 報表真相與告警有效性審查 schema;全 0 週報異常、日週月 truth gate、Telegram route 收斂與 operator actions | +| `docs/evaluations/ai_agent_report_truth_actionability_review_2026-06-12.json` | P2-403J committed snapshot,完成度 `100%`,route change、Telegram send、CronJob / Alertmanager 變更全為 `false` | +| `GET /api/v1/agents/agent-report-truth-actionability-review` | 只讀 API;不發 Telegram、不改 route / receiver、不讀 secret、不寫 work item / KM / PlayBook trust | +| `docs/schemas/ai_agent_report_automation_review_v1.schema.json` | P2-403J 日週月報、Agent 工作量、圖表化報告、AI 分析建議與高 / 中 / 低風險 policy review schema | +| `docs/evaluations/ai_agent_report_automation_review_2026-06-12.json` | P2-403J committed snapshot,3 個報表週期、3 個 Agent 工作量、4 個 chart package、5 個 AI recommendation;live delivery / auto optimization 全為 `0` | +| `GET /api/v1/agents/agent-report-automation-review` | 只讀 API;不排程實發、不送 Telegram、不啟動中低風險 auto worker、不執行生產優化 | | `apps/api/src/services/ai_agent_interaction_learning_proof.py` | 只讀 loader 與安全驗證 | | `apps/api/src/services/ai_agent_live_read_model_gate.py` | P2-403B 只讀 loader;拒絕 live DB query、Redis consumer、unsafe fields、Telegram 與 writeback | | `GET /api/v1/agents/agent-interaction-learning-proof` | 只讀 API,不啟動 worker、不碰 Redis / DB runtime、不發 Telegram | | `GET /api/v1/agents/agent-live-read-model-gate` | 只讀 API,不連 DB、不讀寫 Redis、不發 Telegram | -| governance UI | 新增證據階梯、目前真相、P2-403B live read gate、P2-403C Redis dry-run gate、P2-403D learning writeback approval package、P2-403E Telegram receipt approval package、P2-403F owner-approved learning dry-run / fixture dry-run、P2-403G runtime write gate review、P2-403H post-write verifier package、P2-403I runtime verifier evidence review、Agent lane、可觀測訊號、runtime gates、前端 redaction | +| governance UI | 新增證據階梯、目前真相、P2-403B live read gate、P2-403C Redis dry-run gate、P2-403D learning writeback approval package、P2-403E Telegram receipt approval package、P2-403F owner-approved learning dry-run / fixture dry-run、P2-403G runtime write gate review、P2-403H post-write verifier package、P2-403I runtime verifier evidence review、P2-403J 報表真相 / 日週月報 / Agent 工作量 / 圖表 / AI 建議、Agent lane、可觀測訊號、runtime gates、前端 redaction | ## 5. 後續優先順序 | 優先 | ID | 工作 | gate | |---:|---|---|---| -| 1 | P2-403J | 成長趨勢週報與 operator feedback applied 指標 | trend evidence | +| 1 | P2-403K | unified report truth service / 中低風險 runtime guard / SRE 戰情室路由遷移批准包 | report runtime guard | | 2 | P2-404 | runtime worker shadow / no-write execution evidence gate | runtime shadow evidence | ## 6. 紅線 diff --git a/docs/ai/AI_AGENT_PROACTIVE_OPERATIONS_2026-06-11.md b/docs/ai/AI_AGENT_PROACTIVE_OPERATIONS_2026-06-11.md index 1979483f3..c42463850 100644 --- a/docs/ai/AI_AGENT_PROACTIVE_OPERATIONS_2026-06-11.md +++ b/docs/ai/AI_AGENT_PROACTIVE_OPERATIONS_2026-06-11.md @@ -1,11 +1,11 @@ # AI Agent 主動營運委派與版本生命週期分析報告 > 日期:2026-06-11(台北時間) -> 文件定位:P2-402A / P2-402B / P2-402C / P2-402D / P2-402E / P2-402F / P2-402G / P2-403A / P2-403B / P2-403C / P2-403D / P2-403E / P2-403F / P2-403G / P2-403H / P2-403I 只讀契約與治理 UI 摘要。權威細節以 MASTER §3.2.1c / §3.2.1d、`ai_agent_proactive_operations_contract_v1`、`ai_agent_interaction_learning_proof_v1`、`ai_agent_live_read_model_gate_v1`、`ai_agent_redis_dry_run_gate_v1`、`ai_agent_learning_writeback_approval_package_v1`、`ai_agent_telegram_receipt_approval_package_v1`、`ai_agent_owner_approved_learning_dry_run_v1`、`ai_agent_owner_approved_fixture_dry_run_v1`、`ai_agent_runtime_write_gate_review_v1`、`ai_agent_post_write_verifier_package_v1`、`ai_agent_runtime_verifier_evidence_review_v1`、`ai_agent_version_freshness_snapshot_v1`、`ai_agent_tool_adoption_approval_package_v1`、`ai_agent_telegram_action_required_digest_policy_v1`、`ai_agent_gitea_pr_draft_lane_v1` 與 `ai_agent_host_stateful_version_inventory_v1` 為準。 +> 文件定位:P2-402A / P2-402B / P2-402C / P2-402D / P2-402E / P2-402F / P2-402G / P2-403A / P2-403B / P2-403C / P2-403D / P2-403E / P2-403F / P2-403G / P2-403H / P2-403I / P2-403J 只讀契約與治理 UI 摘要。權威細節以 MASTER §3.2.1c / §3.2.1d、`ai_agent_proactive_operations_contract_v1`、`ai_agent_interaction_learning_proof_v1`、`ai_agent_live_read_model_gate_v1`、`ai_agent_redis_dry_run_gate_v1`、`ai_agent_learning_writeback_approval_package_v1`、`ai_agent_telegram_receipt_approval_package_v1`、`ai_agent_owner_approved_learning_dry_run_v1`、`ai_agent_owner_approved_fixture_dry_run_v1`、`ai_agent_runtime_write_gate_review_v1`、`ai_agent_post_write_verifier_package_v1`、`ai_agent_runtime_verifier_evidence_review_v1`、`ai_agent_report_truth_actionability_review_v1`、`ai_agent_report_automation_review_v1`、`ai_agent_version_freshness_snapshot_v1`、`ai_agent_tool_adoption_approval_package_v1`、`ai_agent_telegram_action_required_digest_policy_v1`、`ai_agent_gitea_pr_draft_lane_v1` 與 `ai_agent_host_stateful_version_inventory_v1` 為準。 -## 0. P2-403J 補記:報表與告警接管真相 +## 0. P2-403J 補記:報表真相、日週月報與風險自動化 -2026-06-12 已新增 `ai_agent_report_truth_actionability_review_v1`:全 0 週報不再可被解讀為健康,而是 report truth / source freshness / confidence 缺口;日報、週報、月報需共用 truth gate;Watchdog / NoAlertsReceived 等心跳需進 actionability lane;本產品正式 Telegram 告警需收斂至 **AwoooI SRE 戰情室**(`SRE_GROUP_CHAT_ID`)。其他 TG Bot、舊 `TELEGRAM_ALERT_CHAT_ID`、direct Telegram API send 與多 bot token route 目前只列為待收斂風險,不代表已改 secret 或已切 route。 +2026-06-12 已新增 `ai_agent_report_truth_actionability_review_v1` 與 `ai_agent_report_automation_review_v1`:全 0 週報不再可被解讀為健康,而是 report truth / source freshness / confidence 缺口;日報、週報、月報需共用 truth gate;Watchdog / NoAlertsReceived 等心跳需進 actionability lane;本產品正式 Telegram 告警需收斂至 **AwoooI SRE 戰情室**(`SRE_GROUP_CHAT_ID`)。同時建立每個 AI Agent 的工作量、圖表化報告、AI 分析建議與高 / 中 / 低風險自動化政策:高風險仍需統帥審核,中低風險目前只完成 policy review,尚未啟動 runtime auto worker。其他 TG Bot、舊 `TELEGRAM_ALERT_CHAT_ID`、direct Telegram API send 與多 bot token route 目前只列為待收斂風險,不代表已改 secret 或已切 route。 ## 1. 本波完成度 @@ -21,7 +21,7 @@ | Agent 互動與學習證據面 | 100% | P2-403A 已把目前真相、證據階梯、三 Agent lane、可觀測訊號、runtime gates 與 redaction policy 接入治理頁;live counts 全為 `0` | | Redis dry-run gate | 100% | P2-403C 已把 consumer group dry-run、handoff envelope、ack / dead-letter / replay idempotency 與治理頁顯示接入;live counts 全為 `0` | | Learning writeback approval package | 100% | P2-403D 已把 KM / PlayBook trust / timeline learning / replay score 的 owner review、rollback、redaction 與 blocked write actions 接入;live writes 全為 `0` | -| 整體主動營運與版本生命週期 | 100% | P2-402A~G、P2-403A、P2-403B、P2-403C、P2-403D、P2-403E、P2-403F、P2-403G、P2-403H 與 P2-403I 只讀契約、snapshot、API、測試與治理 UI 已完成;runtime 排程、工具安裝、CI 變更、實際 PR 建立與更新、host probe、升級、重啟、learning write、Telegram receipt、post-write verifier execution 仍未開 gate | +| 整體主動營運與版本生命週期 | 100% | P2-402A~G、P2-403A、P2-403B、P2-403C、P2-403D、P2-403E、P2-403F、P2-403G、P2-403H、P2-403I 與 P2-403J 只讀契約、snapshot、API、測試與治理 UI 已完成;runtime 排程、工具安裝、CI 變更、實際 PR 建立與更新、host probe、升級、重啟、learning write、Telegram receipt、post-write verifier execution、report delivery、AI analysis runtime、中低風險 auto worker 仍未開 gate | ## 2. 可交給 AI Agent 的工作分類 @@ -59,12 +59,16 @@ | `docs/evaluations/ai_agent_host_stateful_version_inventory_2026-06-11.json` | 5 台主機、2 個 K3s 節點、12 個 stateful / ops 服務、6 個只讀 probe 步驟、maintenance window approval package | | `GET /api/v1/agents/agent-host-stateful-version-inventory` | 只讀 API;不 SSH、不 kubectl、不升級、不 drain、不 reboot、不重啟 stateful、不發 Telegram | | `docs/schemas/ai_agent_interaction_learning_proof_v1.schema.json` | P2-403A Agent 互動、接手、學習、成長與 Telegram receipt 證據面 schema | -| `docs/evaluations/ai_agent_interaction_learning_proof_2026-06-11.json` | 證據階梯、live truth、三 Agent lane、可觀測訊號、runtime gates;P2-403I 後完成度 `99%`,live counts 全部 `0` | +| `docs/evaluations/ai_agent_interaction_learning_proof_2026-06-11.json` | 證據階梯、live truth、三 Agent lane、可觀測訊號、runtime gates;P2-403J 後完成度 `100%`,live counts 全部 `0` | | `GET /api/v1/agents/agent-interaction-learning-proof` | 只讀 API;不啟動 worker、不開 Redis consumer、不 DB migration、不發 Telegram、不顯示工作視窗對話 | | `docs/schemas/ai_agent_post_write_verifier_package_v1.schema.json` | P2-403H post-write verifier package schema;canonical readback、rollback work item、Telegram failure receipt 與 live verifier execution 全部 false | | `GET /api/v1/agents/agent-post-write-verifier-package` | 只讀 API;只回傳 verifier package、failure lane 與人工操作選項,不讀 canonical target、不寫 rollback、不發 Telegram | | `docs/schemas/ai_agent_runtime_verifier_evidence_review_v1.schema.json` | P2-403I runtime verifier evidence review schema;runtime verifier implementation、canonical readback、rollback work item、Telegram failure receipt 與 live verifier execution 全部 false | | `GET /api/v1/agents/agent-runtime-verifier-evidence-review` | 只讀 API;只回傳 evidence checks、implementation lanes 與人工操作選項,不實作或執行 verifier | +| `docs/schemas/ai_agent_report_truth_actionability_review_v1.schema.json` | P2-403J 報表真相與告警有效性審查 schema;全 0 週報、日週月 truth gate、Telegram route 收斂與 operator actions | +| `GET /api/v1/agents/agent-report-truth-actionability-review` | 只讀 API;不發 Telegram、不改 CronJob / Alertmanager / route、不讀 secret、不寫 work item | +| `docs/schemas/ai_agent_report_automation_review_v1.schema.json` | P2-403J 日週月報、每個 Agent 工作量、圖表化報告、AI 分析建議與高 / 中 / 低風險自動化 policy review schema | +| `GET /api/v1/agents/agent-report-automation-review` | 只讀 API;不排程實發、不送 Telegram、不啟動中低風險 auto worker、不執行生產優化 | | `docs/schemas/ai_agent_live_read_model_gate_v1.schema.json` | P2-403B AgentSession / Redis Streams live read model gate schema | | `docs/evaluations/ai_agent_live_read_model_gate_2026-06-11.json` | AgentSession safe fields、Redis envelope、worker gate、rollback plan、no-write smoke、frontend redaction;live counts 全部 `0` | | `GET /api/v1/agents/agent-live-read-model-gate` | 只讀 API;不連 DB、不讀寫 Redis、不啟動 worker、不發 Telegram | @@ -78,7 +82,7 @@ | Dockerfiles | Hermes | action_required | P2-402C 評估 Trivy / Syft / Grype / Docker Scout 採用,不 build / pull | | Committed evaluation snapshots | Hermes | action_required | 將 2026-06-04~06-05 舊基線列入 stale refs,不假裝是外部最新 | | Agent / model governance snapshots | NemoTron | action_required | 只做離線 freshness note,不進 shadow / canary / production route | -| K8s / Gitea / observability / Ansible / backup / web surfaces | OpenClaw + Hermes | baseline_ready / planned_next | 下一步進入 P2-403J 成長趨勢週報與 operator feedback applied 指標;現階段仍只讀 | +| K8s / Gitea / observability / Ansible / backup / web surfaces | OpenClaw + Hermes | baseline_ready / planned_next | 下一步進入 P2-403K unified report truth service / 中低風險 runtime guard / SRE 戰情室路由遷移批准包;現階段仍只讀 | 本波只把「每天要看哪些 repo 內版本來源」定義成可驗證資料面。每日排程、外部 registry 查詢、主機/K3s live probe、Telegram digest 與 Gitea PR lane 都仍是下一階段 gate。 diff --git a/docs/evaluations/ai_agent_interaction_learning_proof_2026-06-11.json b/docs/evaluations/ai_agent_interaction_learning_proof_2026-06-11.json index 4ef259d99..3a7094e38 100644 --- a/docs/evaluations/ai_agent_interaction_learning_proof_2026-06-11.json +++ b/docs/evaluations/ai_agent_interaction_learning_proof_2026-06-11.json @@ -2,13 +2,13 @@ "schema_version": "ai_agent_interaction_learning_proof_v1", "generated_at": "2026-06-11T23:20:00+08:00", "program_status": { - "overall_completion_percent": 99, + "overall_completion_percent": 100, "current_priority": "P2", "current_task_id": "P2-403J", "next_task_id": "P2-403K", "read_only_mode": true, "runtime_authority": "proof_surface_only_no_live_worker", - "status_note": "P2-403J 已把報表真相、全 0 週報可處置異常、日週月契約、心跳降噪與 Telegram 收斂到 AwoooI SRE 戰情室的只讀審查接入;live AgentSession、message、handoff、learning write、Telegram receipt、verifier execution 與 route change 仍全部為 0。" + "status_note": "P2-403J 已把報表真相、全 0 週報可處置異常、日週月契約、Telegram 收斂、每個 Agent 工作量、圖表化報告與高/中/低風險自動化政策接入;live AgentSession、message、handoff、learning write、Telegram receipt、報告實發、自動優化、verifier execution 與 route change 仍全部為 0。" }, "live_truth": { "runtime_loop_enabled": false, @@ -78,6 +78,15 @@ "source_of_truth": "ai_agent_runtime_verifier_evidence_review_v1", "next_gate": "P2-403J 成長趨勢週報與 operator feedback applied 指標。" }, + { + "level_id": "reporting_and_risk_automation_review", + "display_name": "日週月報與風險自動化 review", + "status": "contract_ready", + "completion_percent": 100, + "operator_meaning": "已定義 AI Agent 日報、週報、月報、每個 Agent 工作量、圖表化報告、AI 分析建議與高/中/低風險自動化政策;尚未排程實發或啟動中低風險 runtime worker。", + "source_of_truth": "ai_agent_report_automation_review_v1", + "next_gate": "P2-403K 中低風險自動處理 runtime guard。" + }, { "level_id": "learning_growth", "display_name": "學習回寫與成長曲線", @@ -241,6 +250,16 @@ "current_state": "contract_defined", "operator_interpretation": "你會看到 verifier implementation 前需要哪些脫敏證據、誰審查、哪些 runtime action 仍被阻擋。", "next_gate": "P2-403J" + }, + { + "signal_id": "daily_weekly_monthly_agent_reports", + "display_name": "日週月報與 Agent 工作量圖表", + "category": "reporting", + "source_of_truth": "ai_agent_report_automation_review_v1", + "visible_surface": "governance_agent_report_panel", + "current_state": "contract_defined", + "operator_interpretation": "你會看到每個 Agent 做了哪些工作、工作量多少、風險分級、AI 建議與哪些項目需要你批准。", + "next_gate": "P2-403K" } ], "operator_surfaces": [ @@ -324,6 +343,14 @@ "next_task_id": "P2-403J", "next_gate": "下一步只做成長趨勢與 operator feedback applied 指標,不啟動 live verifier。" }, + { + "gate_id": "report_automation_runtime_guard", + "display_name": "報表讀後分析與中低風險自動化 guard", + "status": "approval_required", + "required_before_green": "P2-403J 已完成日週月報、工作量圖表與風險政策;啟動自動處理前仍需 scheduler guard、Telegram receipt、runtime verifier 與 rollback/no-op evidence。", + "next_task_id": "P2-403K", + "next_gate": "下一步建立中低風險自動處理 runtime guard,不碰高風險自動執行。" + }, { "gate_id": "frontend_redaction_gate", "display_name": "前端脫敏與內容紅線", @@ -393,16 +420,17 @@ "autonomous_self_modify_allowed": false }, "rollups": { - "proof_level_count": 8, - "contract_ready_level_count": 6, + "proof_level_count": 9, + "contract_ready_level_count": 7, "live_pending_level_ids": [], - "signal_count": 10, + "signal_count": 11, "live_signal_count": 0, "operator_surface_count": 5, - "runtime_gate_count": 6, + "runtime_gate_count": 7, "blocked_gate_ids": [ "frontend_redaction_gate", "learning_writeback_gate", + "report_automation_runtime_guard", "redis_stream_consumer_gate", "runtime_verifier_evidence_review_gate", "telegram_receipt_gate" diff --git a/docs/evaluations/ai_agent_proactive_operations_contract_2026-06-11.json b/docs/evaluations/ai_agent_proactive_operations_contract_2026-06-11.json index 596d7a2f0..07523ffd3 100644 --- a/docs/evaluations/ai_agent_proactive_operations_contract_2026-06-11.json +++ b/docs/evaluations/ai_agent_proactive_operations_contract_2026-06-11.json @@ -8,7 +8,7 @@ "next_task_id": "P2-403K", "read_only_mode": true, "runtime_authority": "contract_only_no_version_or_runtime_update", - "status_note": "P2-403J 已把報表真相與告警可處置性審查接入治理證據;全 0 週報視為低可信可處置異常,Telegram 正式告警必須收斂到 AwoooI SRE 戰情室。live AgentSession / Redis consumer / runtime worker / learning write / Telegram receipt / verifier execution / route change 目前全為 0。" + "status_note": "P2-403J 已把報表真相、告警可處置性、日報、週報、月報、Agent 工作量、圖表化報告、AI 分析建議與高/中/低風險自動化政策接入治理證據;全 0 週報視為低可信可處置異常,Telegram 正式告警必須收斂到 AwoooI SRE 戰情室。live report delivery、Telegram receipt、runtime worker、中低風險自動執行、verifier execution 與 route change 目前全為 0。" }, "external_source_evidence": [ { @@ -942,18 +942,25 @@ { "task_id": "P2-403J", "sequence": 13, - "display_name": "Report truth and alert actionability review", + "display_name": "Report truth, periodic reporting, and risk automation review", "status": "done", - "owner_agent": "openclaw", + "owner_agent": "hermes", "completion_percent": 100, - "runtime_authority": "report_truth_actionability_review_only_no_report_send_or_runtime_fix", + "runtime_authority": "reporting_and_actionability_policy_review_only_no_live_execution", "blocked_runtime_actions": [ "telegram_weekly_report_send_as_normal", "telegram_route_change", "direct_telegram_send_to_legacy_chat", "report_truth_runtime_write", "work_item_write", - "heartbeat_to_auto_repair" + "heartbeat_to_auto_repair", + "scheduled_report_delivery", + "telegram_gateway_queue_write", + "ai_analysis_runtime_after_report", + "low_risk_auto_action_worker", + "medium_risk_auto_action_worker", + "high_risk_auto_execute", + "production_optimization_write" ] } ], diff --git a/docs/evaluations/ai_agent_report_automation_review_2026-06-12.json b/docs/evaluations/ai_agent_report_automation_review_2026-06-12.json new file mode 100644 index 000000000..b7f1b940f --- /dev/null +++ b/docs/evaluations/ai_agent_report_automation_review_2026-06-12.json @@ -0,0 +1,370 @@ +{ + "schema_version": "ai_agent_report_automation_review_v1", + "generated_at": "2026-06-12T03:20:00+08:00", + "program_status": { + "overall_completion_percent": 100, + "current_priority": "P2", + "current_task_id": "P2-403J", + "next_task_id": "P2-403K", + "read_only_mode": true, + "runtime_authority": "reporting_and_risk_policy_review_only_no_live_execution", + "status_note": "P2-403J 已把日報、週報、月報、每個 AI Agent 工作量、圖表化報告、AI 分析建議與高/中/低風險自動化政策固定成只讀契約;尚未排程實發、尚未啟動中低風險自動執行器、尚未寫入生產優化。" + }, + "source_refs": [ + "docs/evaluations/ai_agent_deployment_layout_2026-06-11.json", + "docs/evaluations/ai_agent_proactive_operations_contract_2026-06-11.json", + "docs/evaluations/ai_agent_interaction_learning_proof_2026-06-11.json", + "docs/evaluations/ai_agent_runtime_verifier_evidence_review_2026-06-12.json", + "docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md" + ], + "report_truth": { + "daily_report_ready": true, + "weekly_report_ready": true, + "monthly_report_ready": true, + "per_agent_workload_ready": true, + "chart_package_ready": true, + "report_delivery_enabled": false, + "report_delivery_count_24h": 0, + "report_read_receipt_count_24h": 0, + "ai_analysis_after_report_enabled": false, + "medium_low_auto_policy_defined": true, + "medium_low_auto_execution_enabled": false, + "live_medium_low_auto_execution_count_24h": 0, + "high_risk_requires_approval": true, + "live_auto_optimization_count_24h": 0, + "truth_note": "目前已能在治理頁看到日/週/月報表、Agent 工作量與風險分級建議;但排程發送、報告讀取後 AI 自動分析、以及中低風險自動優化仍需 P2-403K runtime guard、Telegram receipt 與 verifier 通過後才可啟動。" + }, + "report_cadences": [ + { + "cadence_id": "daily", + "display_name": "AI Agent 日報", + "owner_agent": "hermes", + "schedule": "每日 09:00 Asia/Taipei", + "sections": [ + "24h 工作量", + "高/中/低風險事件", + "自動化候選", + "等待統帥審核", + "Telegram 告警摘要", + "下一步" + ], + "chart_ids": ["agent_workload_units", "risk_tier_distribution", "automation_action_funnel"], + "delivery_channel": "governance_ui_and_telegram_digest_draft", + "status": "contract_ready", + "live_delivery_count": 0 + }, + { + "cadence_id": "weekly", + "display_name": "AI Agent 週報", + "owner_agent": "openclaw", + "schedule": "每週一 09:30 Asia/Taipei", + "sections": [ + "Agent 成長趨勢", + "自動化節省工時", + "重複問題排名", + "高風險審核清單", + "NemoTron replay regression", + "下週 rollout 建議" + ], + "chart_ids": ["agent_workload_units", "agent_growth_trend", "risk_tier_distribution", "approval_backlog_age"], + "delivery_channel": "governance_ui_and_operator_review_packet", + "status": "contract_ready", + "live_delivery_count": 0 + }, + { + "cadence_id": "monthly", + "display_name": "AI Agent 月報", + "owner_agent": "openclaw", + "schedule": "每月 1 日 10:00 Asia/Taipei", + "sections": [ + "AI 技術引進評估", + "模型/工具替換建議", + "成本與效益", + "自動化成熟度", + "風險政策調整", + "下月投資優先序" + ], + "chart_ids": ["agent_workload_units", "automation_action_funnel", "agent_growth_trend", "market_technology_intake"], + "delivery_channel": "governance_ui_and_monthly_owner_packet", + "status": "contract_ready", + "live_delivery_count": 0 + } + ], + "agent_workload_metrics": [ + { + "agent_id": "openclaw", + "display_name": "OpenClaw", + "primary_role": "生產仲裁、風險決策、HITL 關卡、runtime write / verifier 前後審查", + "deployment_targets": 17, + "delegable_capabilities": 12, + "report_owned_sections": 5, + "analysis_owned_recommendations": 4, + "work_units_total": 38, + "work_units_done": 32, + "work_units_waiting_approval": 6, + "live_runtime_work_units_24h": 0, + "workload_note": "工作量來自 committed deployment layout、proactive operations contract 與 P2-403J 報告責任,不代表 live runtime 已自動執行。" + }, + { + "agent_id": "hermes", + "display_name": "Hermes", + "primary_role": "治理、文件、KM、套件/供應鏈、版本盤點、降噪、日報彙整", + "deployment_targets": 23, + "delegable_capabilities": 11, + "report_owned_sections": 7, + "analysis_owned_recommendations": 4, + "work_units_total": 45, + "work_units_done": 42, + "work_units_waiting_approval": 3, + "live_runtime_work_units_24h": 0, + "workload_note": "Hermes 目前負責最多只讀治理與報告工作;仍不得直接寫 KM canonical、改 workflow 或發 Telegram。" + }, + { + "agent_id": "nemotron", + "display_name": "NemoTron", + "primary_role": "離線模型評估、sanitized replay、regression fixture、長任務能力驗證", + "deployment_targets": 2, + "delegable_capabilities": 1, + "report_owned_sections": 3, + "analysis_owned_recommendations": 2, + "work_units_total": 8, + "work_units_done": 5, + "work_units_waiting_approval": 3, + "live_runtime_work_units_24h": 0, + "workload_note": "NemoTron 目前只做離線 replay / evaluation;不是 live writer,也不是 OpenClaw 替代者。" + } + ], + "report_charts": [ + { + "chart_id": "agent_workload_units", + "display_name": "Agent 工作量分布", + "chart_type": "bar", + "unit": "work_units", + "series": [ + { "label": "OpenClaw", "value": 38, "tone": "warn" }, + { "label": "Hermes", "value": 45, "tone": "ok" }, + { "label": "NemoTron", "value": 8, "tone": "neutral" } + ], + "operator_question": "誰做了最多治理 / 審查 / 報告工作?" + }, + { + "chart_id": "risk_tier_distribution", + "display_name": "風險分級分布", + "chart_type": "stacked_bar", + "unit": "recommendations", + "series": [ + { "label": "低風險", "value": 1, "tone": "ok" }, + { "label": "中風險", "value": 2, "tone": "warn" }, + { "label": "高風險", "value": 2, "tone": "danger" }, + { "label": "關鍵阻擋", "value": 0, "tone": "neutral" } + ], + "operator_question": "哪些建議可走中低風險自動化,哪些必須人工審核?" + }, + { + "chart_id": "automation_action_funnel", + "display_name": "自動化處理漏斗", + "chart_type": "funnel", + "unit": "actions", + "series": [ + { "label": "AI 建議", "value": 5, "tone": "neutral" }, + { "label": "可進中低風險政策", "value": 3, "tone": "warn" }, + { "label": "需高風險審核", "value": 2, "tone": "danger" }, + { "label": "目前已自動執行", "value": 0, "tone": "ok" } + ], + "operator_question": "AI 看完報告後提出多少方案、多少可以自動化、多少仍等統帥批准?" + }, + { + "chart_id": "agent_growth_trend", + "display_name": "Agent 成長趨勢", + "chart_type": "line", + "unit": "contract_ready_percent", + "series": [ + { "label": "P2-403G", "value": 94, "tone": "warn" }, + { "label": "P2-403H", "value": 97, "tone": "warn" }, + { "label": "P2-403I", "value": 99, "tone": "ok" }, + { "label": "P2-403J", "value": 100, "tone": "ok" } + ], + "operator_question": "三 Agent 從互動證據、verifier review 到報告治理的成熟度是否有成長?" + } + ], + "risk_tier_policy": { + "policy_summary": "高風險必須統帥審核;中低風險可由 AI Agent 在 P2-403K guard 通過後自動處理,但必須留下 verifier result、rollback/no-op evidence 與 Telegram 告警或摘要回報。", + "risk_tiers": [ + { + "risk_id": "low", + "display_name": "低風險", + "approval_required": false, + "auto_action_policy": "可自動處理,但僅限報告再產生、只讀索引重算、無外部副作用的治理摘要更新。", + "current_execution_enabled": false, + "required_before_enable": [ + "idempotency key", + "no production write", + "Telegram daily digest draft", + "read-only verifier" + ] + }, + { + "risk_id": "medium", + "display_name": "中風險", + "approval_required": false, + "auto_action_policy": "可在 dry-run、post-action verifier、failure-only Telegram 與 rollback/no-op evidence 都存在後自動處理。", + "current_execution_enabled": false, + "required_before_enable": [ + "dry-run result", + "runtime verifier", + "failure-only Telegram receipt", + "rollback work item template" + ] + }, + { + "risk_id": "high", + "display_name": "高風險", + "approval_required": true, + "auto_action_policy": "必須統帥或 owner 明確審核批准後才能執行;AI 只能提出方案、風險、回滾與驗證計畫。", + "current_execution_enabled": false, + "required_before_enable": [ + "human approval", + "owner response", + "maintenance window", + "rollback owner", + "post-deploy verification" + ] + }, + { + "risk_id": "critical", + "display_name": "關鍵阻擋", + "approval_required": true, + "auto_action_policy": "預設禁止自動執行;涉及 secret、付費 provider 切換、主機破壞性操作、production route 或資料寫入需另開 break-glass 或正式批准。", + "current_execution_enabled": false, + "required_before_enable": [ + "explicit commander approval", + "break-glass evidence if emergency", + "secret redaction", + "audit trail" + ] + } + ] + }, + "analysis_recommendations": [ + { + "recommendation_id": "daily_report_scheduler_contract", + "display_name": "建立 AI Agent 日報排程契約", + "owner_agent": "hermes", + "risk_tier": "low", + "approval_required": false, + "current_auto_execution_enabled": false, + "problem": "統帥需要每天看到每個 Agent 做了什麼、工作量多少、哪些需要處置。", + "proposed_solution": "P2-403K 建立只讀 scheduler,先產生 governance report snapshot,再由 Telegram digest draft 回報。", + "expected_report_signal": "每日新增 report_run_id、agent workload delta、risk queue delta。", + "blocked_runtime_action": "scheduled_report_delivery" + }, + { + "recommendation_id": "medium_low_auto_guard", + "display_name": "中低風險自動處理 guard", + "owner_agent": "openclaw", + "risk_tier": "medium", + "approval_required": false, + "current_auto_execution_enabled": false, + "problem": "中低風險若永遠人工審核,AI Agent 無法真正減少維運工作量。", + "proposed_solution": "建立 allow-policy:低風險可自動處理只讀/無副作用任務;中風險需 dry-run、verifier、failure-only Telegram 與 rollback/no-op evidence。", + "expected_report_signal": "每次自動處理都回寫 action id、risk tier、verifier result、Telegram receipt id。", + "blocked_runtime_action": "medium_low_auto_action_worker" + }, + { + "recommendation_id": "telegram_report_digest_receipt", + "display_name": "Telegram 報告摘要與已讀收據", + "owner_agent": "hermes", + "risk_tier": "medium", + "approval_required": false, + "current_auto_execution_enabled": false, + "problem": "報告若只在治理頁,統帥不一定感覺到 Agent 正在工作。", + "proposed_solution": "只送日報/週報/月報摘要、失敗與 action-required;成功不得洗版,且 Agent 不直接持有 token。", + "expected_report_signal": "telegram_digest_receipts_24h、acknowledged_by、unread_action_required_count。", + "blocked_runtime_action": "telegram_gateway_queue_write" + }, + { + "recommendation_id": "runtime_verifier_implementation_gate", + "display_name": "Runtime verifier implementation 審核", + "owner_agent": "openclaw", + "risk_tier": "high", + "approval_required": true, + "current_auto_execution_enabled": false, + "problem": "沒有 verifier 就不能放心讓中低風險自動優化真的落地。", + "proposed_solution": "先由 OpenClaw 審核 implementation,Hermes 做 redaction review,NemoTron 跑 sanitized replay regression。", + "expected_report_signal": "verifier_pass_rate、rollback_work_item_count、no-action_guard_count。", + "blocked_runtime_action": "post_write_verifier_runtime_execution" + }, + { + "recommendation_id": "nemotron_replay_pipeline_unblock", + "display_name": "NemoTron replay pipeline 解鎖", + "owner_agent": "nemotron", + "risk_tier": "high", + "approval_required": true, + "current_auto_execution_enabled": false, + "problem": "NemoTron 若沒有 replay pipeline,就只能停留在候選評估,無法證明 Agent 成長。", + "proposed_solution": "補 sanitized fixture、baseline score、candidate score、regression threshold 與 owner review lane。", + "expected_report_signal": "replay_score_delta、regression_count、model_candidate_pass_rate。", + "blocked_runtime_action": "agent_replay_score_write" + } + ], + "approval_boundaries": { + "report_delivery_schedule_allowed": false, + "telegram_report_send_allowed": false, + "ai_analysis_runtime_allowed": false, + "low_risk_auto_execute_allowed": false, + "medium_risk_auto_execute_allowed": false, + "high_risk_auto_execute_allowed": false, + "high_risk_requires_human_approval": true, + "production_write_allowed": false, + "host_or_cluster_command_allowed": false, + "workflow_modification_allowed": false, + "secret_plaintext_allowed": false, + "paid_external_service_allowed": false + }, + "display_redaction_contract": { + "redaction_required": true, + "raw_report_payload_display_allowed": false, + "private_reasoning_display_allowed": false, + "secret_value_display_allowed": false, + "work_window_transcript_display_allowed": false, + "allowed_frontend_content": [ + "report cadence", + "agent workload metric", + "chart series", + "risk tier policy", + "analysis recommendation", + "approval boundary" + ], + "forbidden_frontend_content": [ + "work window transcript", + "raw prompt", + "private reasoning", + "raw tool output", + "authorization header", + "secret value", + "raw Telegram payload" + ], + "frontend_display_policy": "治理頁只顯示報表週期、工作量、圖表、風險分級、建議與邊界;不顯示工作視窗對話、prompt、private reasoning、raw tool output、authorization header、secret 或 raw Telegram payload。" + }, + "rollups": { + "report_cadence_count": 3, + "agent_count": 3, + "chart_count": 4, + "recommendation_count": 5, + "workload_unit_total": 91, + "workload_done_total": 79, + "workload_waiting_approval_total": 12, + "low_risk_recommendation_count": 1, + "medium_risk_recommendation_count": 2, + "high_risk_recommendation_count": 2, + "critical_risk_recommendation_count": 0, + "approval_required_recommendation_ids": [ + "runtime_verifier_implementation_gate", + "nemotron_replay_pipeline_unblock" + ], + "medium_low_auto_policy_count": 3, + "current_auto_execution_enabled_count": 0, + "live_report_delivery_count": 0, + "live_auto_optimization_count": 0 + } +} diff --git a/docs/schemas/ai_agent_report_automation_review_v1.schema.json b/docs/schemas/ai_agent_report_automation_review_v1.schema.json new file mode 100644 index 000000000..1dca9b8b1 --- /dev/null +++ b/docs/schemas/ai_agent_report_automation_review_v1.schema.json @@ -0,0 +1,315 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://awoooi.wooo.work/schemas/ai_agent_report_automation_review_v1.schema.json", + "title": "AI Agent Report Automation Review v1", + "type": "object", + "required": [ + "schema_version", + "generated_at", + "program_status", + "source_refs", + "report_truth", + "report_cadences", + "agent_workload_metrics", + "report_charts", + "risk_tier_policy", + "analysis_recommendations", + "approval_boundaries", + "display_redaction_contract", + "rollups" + ], + "properties": { + "schema_version": { "const": "ai_agent_report_automation_review_v1" }, + "generated_at": { "type": "string" }, + "program_status": { + "type": "object", + "required": [ + "overall_completion_percent", + "current_priority", + "current_task_id", + "next_task_id", + "read_only_mode", + "runtime_authority", + "status_note" + ], + "properties": { + "overall_completion_percent": { "type": "integer", "minimum": 0, "maximum": 100 }, + "current_priority": { "enum": ["P0", "P1", "P2", "P3"] }, + "current_task_id": { "type": "string" }, + "next_task_id": { "type": "string" }, + "read_only_mode": { "const": true }, + "runtime_authority": { "const": "reporting_and_risk_policy_review_only_no_live_execution" }, + "status_note": { "type": "string" } + }, + "additionalProperties": false + }, + "source_refs": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, + "report_truth": { + "type": "object", + "required": [ + "daily_report_ready", + "weekly_report_ready", + "monthly_report_ready", + "per_agent_workload_ready", + "chart_package_ready", + "report_delivery_enabled", + "report_delivery_count_24h", + "report_read_receipt_count_24h", + "ai_analysis_after_report_enabled", + "medium_low_auto_policy_defined", + "medium_low_auto_execution_enabled", + "live_medium_low_auto_execution_count_24h", + "high_risk_requires_approval", + "live_auto_optimization_count_24h", + "truth_note" + ], + "properties": { + "daily_report_ready": { "const": true }, + "weekly_report_ready": { "const": true }, + "monthly_report_ready": { "const": true }, + "per_agent_workload_ready": { "const": true }, + "chart_package_ready": { "const": true }, + "report_delivery_enabled": { "const": false }, + "report_delivery_count_24h": { "const": 0 }, + "report_read_receipt_count_24h": { "const": 0 }, + "ai_analysis_after_report_enabled": { "const": false }, + "medium_low_auto_policy_defined": { "const": true }, + "medium_low_auto_execution_enabled": { "const": false }, + "live_medium_low_auto_execution_count_24h": { "const": 0 }, + "high_risk_requires_approval": { "const": true }, + "live_auto_optimization_count_24h": { "const": 0 }, + "truth_note": { "type": "string" } + }, + "additionalProperties": false + }, + "report_cadences": { + "type": "array", + "minItems": 3, + "items": { + "type": "object", + "required": [ + "cadence_id", + "display_name", + "owner_agent", + "schedule", + "sections", + "chart_ids", + "delivery_channel", + "status", + "live_delivery_count" + ], + "properties": { + "cadence_id": { "enum": ["daily", "weekly", "monthly"] }, + "display_name": { "type": "string" }, + "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] }, + "schedule": { "type": "string" }, + "sections": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, + "chart_ids": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, + "delivery_channel": { "type": "string" }, + "status": { "type": "string" }, + "live_delivery_count": { "const": 0 } + }, + "additionalProperties": false + } + }, + "agent_workload_metrics": { + "type": "array", + "minItems": 3, + "items": { + "type": "object", + "required": [ + "agent_id", + "display_name", + "primary_role", + "deployment_targets", + "delegable_capabilities", + "report_owned_sections", + "analysis_owned_recommendations", + "work_units_total", + "work_units_done", + "work_units_waiting_approval", + "live_runtime_work_units_24h", + "workload_note" + ], + "properties": { + "agent_id": { "enum": ["openclaw", "hermes", "nemotron"] }, + "display_name": { "type": "string" }, + "primary_role": { "type": "string" }, + "deployment_targets": { "type": "integer", "minimum": 0 }, + "delegable_capabilities": { "type": "integer", "minimum": 0 }, + "report_owned_sections": { "type": "integer", "minimum": 0 }, + "analysis_owned_recommendations": { "type": "integer", "minimum": 0 }, + "work_units_total": { "type": "integer", "minimum": 0 }, + "work_units_done": { "type": "integer", "minimum": 0 }, + "work_units_waiting_approval": { "type": "integer", "minimum": 0 }, + "live_runtime_work_units_24h": { "const": 0 }, + "workload_note": { "type": "string" } + }, + "additionalProperties": false + } + }, + "report_charts": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "required": ["chart_id", "display_name", "chart_type", "unit", "series", "operator_question"], + "properties": { + "chart_id": { "type": "string" }, + "display_name": { "type": "string" }, + "chart_type": { "type": "string" }, + "unit": { "type": "string" }, + "series": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "required": ["label", "value", "tone"], + "properties": { + "label": { "type": "string" }, + "value": { "type": "integer", "minimum": 0 }, + "tone": { "enum": ["ok", "warn", "danger", "neutral"] } + }, + "additionalProperties": false + } + }, + "operator_question": { "type": "string" } + }, + "additionalProperties": false + } + }, + "risk_tier_policy": { + "type": "object", + "required": ["policy_summary", "risk_tiers"], + "properties": { + "policy_summary": { "type": "string" }, + "risk_tiers": { + "type": "array", + "minItems": 4, + "items": { + "type": "object", + "required": [ + "risk_id", + "display_name", + "approval_required", + "auto_action_policy", + "current_execution_enabled", + "required_before_enable" + ], + "properties": { + "risk_id": { "enum": ["low", "medium", "high", "critical"] }, + "display_name": { "type": "string" }, + "approval_required": { "type": "boolean" }, + "auto_action_policy": { "type": "string" }, + "current_execution_enabled": { "const": false }, + "required_before_enable": { "type": "array", "items": { "type": "string" }, "minItems": 1 } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, + "analysis_recommendations": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "required": [ + "recommendation_id", + "display_name", + "owner_agent", + "risk_tier", + "approval_required", + "current_auto_execution_enabled", + "problem", + "proposed_solution", + "expected_report_signal", + "blocked_runtime_action" + ], + "properties": { + "recommendation_id": { "type": "string" }, + "display_name": { "type": "string" }, + "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] }, + "risk_tier": { "enum": ["low", "medium", "high", "critical"] }, + "approval_required": { "type": "boolean" }, + "current_auto_execution_enabled": { "const": false }, + "problem": { "type": "string" }, + "proposed_solution": { "type": "string" }, + "expected_report_signal": { "type": "string" }, + "blocked_runtime_action": { "type": "string" } + }, + "additionalProperties": false + } + }, + "approval_boundaries": { + "type": "object", + "required": ["high_risk_requires_human_approval"], + "properties": { + "high_risk_requires_human_approval": { "const": true } + }, + "additionalProperties": { "type": "boolean" } + }, + "display_redaction_contract": { + "type": "object", + "required": [ + "redaction_required", + "raw_report_payload_display_allowed", + "private_reasoning_display_allowed", + "secret_value_display_allowed", + "work_window_transcript_display_allowed", + "allowed_frontend_content", + "forbidden_frontend_content", + "frontend_display_policy" + ], + "properties": { + "redaction_required": { "const": true }, + "raw_report_payload_display_allowed": { "const": false }, + "private_reasoning_display_allowed": { "const": false }, + "secret_value_display_allowed": { "const": false }, + "work_window_transcript_display_allowed": { "const": false }, + "allowed_frontend_content": { "type": "array", "items": { "type": "string" } }, + "forbidden_frontend_content": { "type": "array", "items": { "type": "string" } }, + "frontend_display_policy": { "type": "string" } + }, + "additionalProperties": false + }, + "rollups": { + "type": "object", + "required": [ + "report_cadence_count", + "agent_count", + "chart_count", + "recommendation_count", + "workload_unit_total", + "workload_done_total", + "workload_waiting_approval_total", + "approval_required_recommendation_ids", + "medium_low_auto_policy_count", + "current_auto_execution_enabled_count", + "live_report_delivery_count", + "live_auto_optimization_count" + ], + "properties": { + "report_cadence_count": { "type": "integer", "minimum": 3 }, + "agent_count": { "type": "integer", "minimum": 3 }, + "chart_count": { "type": "integer", "minimum": 1 }, + "recommendation_count": { "type": "integer", "minimum": 1 }, + "workload_unit_total": { "type": "integer", "minimum": 0 }, + "workload_done_total": { "type": "integer", "minimum": 0 }, + "workload_waiting_approval_total": { "type": "integer", "minimum": 0 }, + "low_risk_recommendation_count": { "type": "integer", "minimum": 0 }, + "medium_risk_recommendation_count": { "type": "integer", "minimum": 0 }, + "high_risk_recommendation_count": { "type": "integer", "minimum": 0 }, + "critical_risk_recommendation_count": { "type": "integer", "minimum": 0 }, + "approval_required_recommendation_ids": { "type": "array", "items": { "type": "string" } }, + "medium_low_auto_policy_count": { "type": "integer", "minimum": 0 }, + "current_auto_execution_enabled_count": { "const": 0 }, + "live_report_delivery_count": { "const": 0 }, + "live_auto_optimization_count": { "const": 0 } + }, + "additionalProperties": false + } + }, + "additionalProperties": false +} diff --git a/docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md b/docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md index 865fb3fbc..ee82dee24 100644 --- a/docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md +++ b/docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md @@ -634,7 +634,7 @@ Alert / Sentry / SigNoz / Gitea / Market Watch / Operator | `docs/evaluations/ai_agent_communication_learning_contract_2026-06-11.json` | 2026-06-11 committed snapshot;完成度 `35%`,runtime worker / DB migration / Telegram direct send 全部 false | | `apps/api/src/services/ai_agent_communication_learning_contract.py` | 只讀 loader;強制驗證 runtime / migration / Telegram / SDK / route 權限都未開 | | `GET /api/v1/agents/agent-communication-learning-contract` | 治理 API;只回傳 committed contract,不啟動 worker、不碰 DB/Redis、不呼叫外部服務 | -| `docs/evaluations/ai_agent_interaction_learning_proof_2026-06-11.json` + `GET /api/v1/agents/agent-interaction-learning-proof` | P2-403A / P2-403B / P2-403C / P2-403D / P2-403E / P2-403F / P2-403G / P2-403H / P2-403I 互動、接手、學習、成長、read model gate、Redis dry-run gate、learning writeback approval package、Telegram receipt approval package、owner-approved learning dry-run、fixture dry-run、runtime write gate review、post-write verifier package 與 runtime verifier evidence review 證據面;目前 live session、message、handoff、learning write、Gateway queue、Telegram send、verifier execution 全部 `0`,下一步 P2-403J | +| `docs/evaluations/ai_agent_interaction_learning_proof_2026-06-11.json` + `GET /api/v1/agents/agent-interaction-learning-proof` | P2-403A / P2-403B / P2-403C / P2-403D / P2-403E / P2-403F / P2-403G / P2-403H / P2-403I / P2-403J 互動、接手、學習、成長、read model gate、Redis dry-run gate、learning writeback approval package、Telegram receipt approval package、owner-approved learning dry-run、fixture dry-run、runtime write gate review、post-write verifier package、runtime verifier evidence review、報表真相、日週月報、Agent 工作量、圖表化報告與風險自動化政策證據面;目前 live session、message、handoff、learning write、Gateway queue、Telegram send、report delivery、auto optimization、verifier execution 全部 `0`,下一步 P2-403K | | `docs/evaluations/ai_agent_live_read_model_gate_2026-06-11.json` + `GET /api/v1/agents/agent-live-read-model-gate` | P2-403B AgentSession / Redis Streams live read model gate;定義 safe fields、Redis envelope、worker gate、rollback plan 與 no-write smoke,不連 DB、不讀寫 Redis、不啟動 worker | #### 3.2.1c 2026-06-11 AI Agent 主動營運委派與版本生命週期契約 @@ -718,7 +718,8 @@ Repo / registry / release notes / K8s / host / observability / backup evidence 13. 建立 owner-approved fixture dry-run 總包,將 learning writeback、Telegram receipt、handoff replay、operator feedback 的乾跑證據收斂到治理頁。✅ P2-403F 補強完成;Gateway queue、Telegram send、Redis consumer、runtime worker 仍為 `0 / false`。 14. 建立 runtime write gate review,固定雙重批准、dry-run hash、post-write verifier、rollback 與 redaction 欄位。✅ P2-403G 已完成;KM / PlayBook trust / timeline / replay score / Telegram live write 仍為 `0 / false`。 15. 建立 post-write verifier implementation package,固定 canonical readback、rollback lane、failure lane 與人工操作選項。✅ P2-403H 已完成;canonical readback、rollback work item、Telegram failure receipt 與 verifier execution 仍為 `0 / false`。 -16. 建立 runtime verifier evidence implementation review,固定 implementation 前的 evidence checks、redaction review、rollback template、failure receipt template、NemoTron replay fixture 與人工操作選項。✅ P2-403I 已完成;verifier implementation、canonical readback、rollback work item、Telegram failure receipt、learning writeback 與 verifier execution 仍為 `0 / false`。下一步 P2-403J 成長趨勢週報與 operator feedback applied 指標。 +16. 建立 runtime verifier evidence implementation review,固定 implementation 前的 evidence checks、redaction review、rollback template、failure receipt template、NemoTron replay fixture 與人工操作選項。✅ P2-403I 已完成;verifier implementation、canonical readback、rollback work item、Telegram failure receipt、learning writeback 與 verifier execution 仍為 `0 / false`。 +17. 建立報表真相、日報、週報、月報、Agent 工作量、圖表化報告、AI 分析建議與高 / 中 / 低風險自動化 policy review。✅ P2-403J 已完成;report delivery、Telegram queue、AI analysis runtime、中低風險 auto worker、生產優化與 route change 仍為 `0 / false`。下一步 P2-403K unified report truth service / 中低風險 runtime guard / SRE 戰情室路由遷移批准包。 #### 3.2.1d 2026-06-11 Agent 互動、學習與成長證據面 @@ -741,7 +742,9 @@ Repo / registry / release notes / K8s / host / observability / backup evidence | 檔案 / API | 用途 | |---|---| | `docs/schemas/ai_agent_interaction_learning_proof_v1.schema.json` | 互動、接手、學習、成長、Telegram receipt 與前端 redaction schema | -| `docs/evaluations/ai_agent_interaction_learning_proof_2026-06-11.json` | P2-403A + P2-403B + P2-403C + P2-403D + P2-403E + P2-403F + P2-403G + P2-403H + P2-403I committed snapshot;完成度 `99%`,live truth counts 全部 `0` | +| `docs/evaluations/ai_agent_interaction_learning_proof_2026-06-11.json` | P2-403A + P2-403B + P2-403C + P2-403D + P2-403E + P2-403F + P2-403G + P2-403H + P2-403I + P2-403J committed snapshot;完成度 `100%`,live truth counts 全部 `0` | +| `docs/evaluations/ai_agent_report_truth_actionability_review_2026-06-12.json` + `GET /api/v1/agents/agent-report-truth-actionability-review` | P2-403J 報表真相與告警有效性審查;全 0 週報列為低可信可處置異常,日週月報需共用 truth gate,Telegram 正式告警需收斂到 AwoooI SRE 戰情室;不發 Telegram、不改 route、不讀 secret | +| `docs/evaluations/ai_agent_report_automation_review_2026-06-12.json` + `GET /api/v1/agents/agent-report-automation-review` | P2-403J 日報 / 週報 / 月報、每個 Agent 工作量、圖表化報告、AI 分析建議與高 / 中 / 低風險自動化 policy review;高風險需人工審核,中低風險目前只定義 policy,不啟動 runtime auto worker | | `apps/api/src/services/ai_agent_interaction_learning_proof.py` | 只讀 loader;強制 live flags / DB / Redis / Telegram / transcript / 私有推理全部關閉 | | `GET /api/v1/agents/agent-interaction-learning-proof` | 治理 API;只回傳證據面,不啟動 worker、不碰 live DB/Redis、不發 Telegram | | `docs/schemas/ai_agent_live_read_model_gate_v1.schema.json` | P2-403B live read model gate schema;強制 DB / Redis / worker / Telegram / learning writeback 仍需批准 | @@ -1872,7 +1875,15 @@ Phase 6 完成後 - `apps/web/src/app/[locale]/governance/tabs/automation-inventory-tab.tsx` 接入 `GET /api/v1/agents/agent-runtime-verifier-evidence-review`,顯示 5 個 evidence check、4 個 implementation review lane、4 個人工操作選項、truth flags 與 live verifier execution `0`。 - 更新 `ai_agent_interaction_learning_proof_2026-06-11.json`:整體完成度 `99%`,current task `P2-403I`,next task `P2-403J`;live AgentSession / Redis events / handoff / learning write / Telegram digest receipt / verifier execution 全部仍為 `0`。 - 更新 `ai_agent_proactive_operations_contract_2026-06-11.json`:新增 rollout task `P2-403I`,blocked runtime actions 包含 runtime verifier implementation、canonical readback、rollback work item、Telegram failure receipt、runtime learning write 與 agent replay score write。 -- 本波仍不實作或執行 verifier、不讀 canonical target、不寫 rollback work item、不發 Telegram、不寫 KM、不更新 PlayBook trust、不寫 timeline learning、不寫 replay score、不啟動 runtime worker、不讀取或輸出 secret;下一步 P2-403J 才做成長趨勢週報與 operator feedback applied 指標。 +- 本波仍不實作或執行 verifier、不讀 canonical target、不寫 rollback work item、不發 Telegram、不寫 KM、不更新 PlayBook trust、不寫 timeline learning、不寫 replay score、不啟動 runtime worker、不讀取或輸出 secret;後續已由 P2-403J 接續處理報表真相、日週月報、Agent 工作量與風險自動化 policy review。 + +### 2026-06-12 03:20 (台北) — §3.2 / §5 — 完成 P2-403J 日週月報與風險自動化 Review — 把報表可信度、Agent 工作量與高 / 中 / 低風險政策固定成可見報告 + +- 新增 `ai_agent_report_automation_review_v1` schema / committed snapshot / loader / API / 測試,定義日報、週報、月報、每個 Agent 工作量、圖表化報告、AI 分析建議與高 / 中 / 低風險自動化 policy review。 +- 與 `ai_agent_report_truth_actionability_review_v1` 合併成 P2-403J 報表治理口徑:先判斷報表真相與 Telegram actionability,再呈現 Agent 工作量、圖表與自動化建議。 +- `apps/web/src/app/[locale]/governance/tabs/automation-inventory-tab.tsx` 接入 `GET /api/v1/agents/agent-report-automation-review`,治理頁顯示 report cadence、Agent workload、chart package、risk policy 與 recommendation cards;仍不提供批准、執行、發送或優化按鈕。 +- 更新 `ai_agent_interaction_learning_proof_2026-06-11.json`:整體完成度 `100%`,current task `P2-403J`,next task `P2-403K`;live report delivery、Telegram receipt、AI analysis runtime、自動優化、verifier execution 與 route change 全部仍為 `0 / false`。 +- 本波仍不排程實發報告、不寫 Telegram queue、不啟動中低風險 auto worker、不執行生產優化、不讀 secret、不回傳工作視窗對話內容;下一步 P2-403K 才進 unified report truth service / 中低風險 runtime guard / SRE 戰情室路由遷移批准包。 ### 2026-06-12 00:35 (台北) — §3.2 / §5 — 完成 P2-403G Runtime Write Gate Review — 把批准後可寫入前的最後安全閘門固定成可審查契約