diff --git a/apps/api/src/api/v1/agents.py b/apps/api/src/api/v1/agents.py index b477cf9ed..693cc7b94 100644 --- a/apps/api/src/api/v1/agents.py +++ b/apps/api/src/api/v1/agents.py @@ -88,6 +88,9 @@ from src.services.ai_agent_redis_dry_run_gate import ( from src.services.ai_agent_report_automation_review import ( load_latest_ai_agent_report_automation_review, ) +from src.services.ai_agent_report_runtime_dry_run import ( + load_latest_ai_agent_report_runtime_dry_run, +) from src.services.ai_agent_report_runtime_readiness import ( load_latest_ai_agent_report_runtime_readiness, ) @@ -942,6 +945,34 @@ async def get_agent_report_runtime_readiness() -> dict[str, Any]: ) from exc +@router.get( + "/agent-report-runtime-dry-run", + response_model=dict[str, Any], + summary="取得 AI Agent 報表 runtime no-write dry-run 證據包", + description=( + "讀取最新已提交的 P2-403M 報表 runtime no-write dry-run、Telegram Gateway queue 草案、" + "讀報回執 redaction 與 readback verifier 草案;此端點不排程實發、不送 Telegram、" + "不寫 Gateway queue、不寫讀報回執、不啟動 AI runtime worker、不啟動中低風險 auto worker、" + "不執行 verifier live readback、不讀 secret、不回傳內部對話內容。" + ), +) +async def get_agent_report_runtime_dry_run() -> dict[str, Any]: + """Return the latest read-only AI Agent report runtime dry-run package.""" + try: + return await asyncio.to_thread(load_latest_ai_agent_report_runtime_dry_run) + 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_runtime_dry_run_invalid", error=str(exc)) + raise HTTPException( + status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, + detail="AI Agent 報表 runtime no-write dry-run 證據包無效", + ) 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_runtime_dry_run.py b/apps/api/src/services/ai_agent_report_runtime_dry_run.py new file mode 100644 index 000000000..1c78dd34c --- /dev/null +++ b/apps/api/src/services/ai_agent_report_runtime_dry_run.py @@ -0,0 +1,219 @@ +""" +AI Agent report runtime no-write dry-run snapshot. + +Loads the latest committed P2-403M report runtime dry-run contract. This +module only validates repo-committed dry-run evidence and never writes Telegram +Gateway queues, sends Telegram messages, starts AI workers, or reads secrets. +""" + +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_runtime_dry_run_*.json" +_SCHEMA_VERSION = "ai_agent_report_runtime_dry_run_v1" +_RUNTIME_AUTHORITY = "report_runtime_no_write_dry_run_only_no_gateway_write_or_delivery" + + +def load_latest_ai_agent_report_runtime_dry_run( + evaluations_dir: Path | None = None, +) -> dict[str, Any]: + """Load the newest committed AI Agent report runtime dry-run snapshot.""" + directory = evaluations_dir or _DEFAULT_EVALUATIONS_DIR + candidates = sorted(directory.glob(_SNAPSHOT_PATTERN)) + if not candidates: + raise FileNotFoundError(f"no AI Agent report runtime dry-run 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_no_write_boundaries(payload, str(latest)) + _require_artifact_contract(payload, str(latest)) + _require_gateway_draft_contract(payload, str(latest)) + _require_verifier_contract(payload, str(latest)) + _require_agent_roles(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") != _RUNTIME_AUTHORITY: + raise ValueError(f"{label}: runtime_authority must remain {_RUNTIME_AUTHORITY}") + if status.get("current_task_id") != "P2-403M": + raise ValueError(f"{label}: current_task_id must be P2-403M") + + +def _require_no_write_boundaries(payload: dict[str, Any], label: str) -> None: + truth = payload.get("dry_run_truth") or {} + required_true = { + "no_write_dry_run_package_ready", + "report_snapshot_dry_run_ready", + "telegram_gateway_queue_draft_ready", + "readback_verifier_plan_ready", + "failure_only_telegram_draft_ready", + } + missing = sorted(field for field in required_true if truth.get(field) is not True) + if missing: + raise ValueError(f"{label}: dry-run readiness flags must remain true: {missing}") + + required_false = { + "production_delivery_enabled", + "telegram_gateway_queue_write_enabled", + "telegram_bot_api_call_enabled", + "delivery_receipt_write_enabled", + "ai_runtime_worker_enabled", + "medium_low_auto_worker_enabled", + "post_action_verifier_live_readback_enabled", + "production_write_enabled", + "secret_value_read_enabled", + "work_window_transcript_display_allowed", + } + unsafe = sorted(field for field in required_false if truth.get(field) is not False) + if unsafe: + raise ValueError(f"{label}: live write/send/runtime flags must remain false: {unsafe}") + + zero_counts = { + "live_report_delivery_count_24h", + "telegram_gateway_queue_write_count_24h", + "telegram_bot_api_call_count_24h", + "delivery_receipt_write_count_24h", + "ai_runtime_worker_run_count_24h", + "medium_low_auto_execution_count_24h", + "post_action_verifier_live_readback_count_24h", + "production_write_count_24h", + } + non_zero = sorted(field for field in zero_counts if truth.get(field) != 0) + if non_zero: + raise ValueError(f"{label}: live write/send/runtime counts must remain zero: {non_zero}") + + +def _require_artifact_contract(payload: dict[str, Any], label: str) -> None: + artifacts = payload.get("dry_run_artifacts") or [] + artifact_ids = {artifact.get("artifact_id") for artifact in artifacts} + required = { + "report_run_snapshot_preview", + "telegram_digest_payload_preview", + "ai_post_report_analysis_packet", + "medium_low_auto_noop_plan", + "post_action_verifier_readback_plan", + } + if artifact_ids != required: + raise ValueError(f"{label}: dry-run artifacts must match {sorted(required)}") + + for artifact in artifacts: + artifact_id = artifact.get("artifact_id") + if artifact.get("mode") != "repo_only_no_write": + raise ValueError(f"{label}: artifact {artifact_id} mode must remain repo_only_no_write") + if artifact.get("writes_production") is not False: + raise ValueError(f"{label}: artifact {artifact_id} must not write production") + if artifact.get("contains_secret") is not False: + raise ValueError(f"{label}: artifact {artifact_id} must not contain secrets") + + +def _require_gateway_draft_contract(payload: dict[str, Any], label: str) -> None: + drafts = payload.get("telegram_gateway_queue_drafts") or [] + draft_ids = {draft.get("draft_id") for draft in drafts} + if draft_ids != {"daily_report_digest", "weekly_report_digest", "monthly_report_digest"}: + raise ValueError(f"{label}: Telegram queue drafts must cover daily, weekly, monthly") + + for draft in drafts: + draft_id = draft.get("draft_id") + if draft.get("recipient_room") != "AwoooI SRE 戰情室": + raise ValueError(f"{label}: draft {draft_id} must target AwoooI SRE 戰情室") + if draft.get("secret_ref") != "SRE_GROUP_CHAT_ID": + raise ValueError(f"{label}: draft {draft_id} must only reference SRE_GROUP_CHAT_ID") + if draft.get("gateway_queue_write_enabled") is not False: + raise ValueError(f"{label}: draft {draft_id} must not write Gateway queue") + if draft.get("telegram_send_enabled") is not False: + raise ValueError(f"{label}: draft {draft_id} must not send Telegram") + if draft.get("direct_bot_api_allowed") is not False: + raise ValueError(f"{label}: draft {draft_id} must not allow direct Bot API") + if draft.get("payload_contains_secret") is not False: + raise ValueError(f"{label}: draft {draft_id} must not contain secret payload") + + +def _require_verifier_contract(payload: dict[str, Any], label: str) -> None: + cases = payload.get("readback_verifier_cases") or [] + case_ids = {case.get("case_id") for case in cases} + required = { + "report_snapshot_readback", + "gateway_queue_preview_readback", + "receipt_redaction_readback", + "medium_low_noop_readback", + } + if case_ids != required: + raise ValueError(f"{label}: readback verifier cases must match {sorted(required)}") + + for case in cases: + case_id = case.get("case_id") + if case.get("live_readback_enabled") is not False: + raise ValueError(f"{label}: verifier case {case_id} must not run live readback") + if case.get("writes_result") is not False: + raise ValueError(f"{label}: verifier case {case_id} must not write result") + if case.get("requires_secret_value") is not False: + raise ValueError(f"{label}: verifier case {case_id} must not require secret value") + + +def _require_agent_roles(payload: dict[str, Any], label: str) -> None: + roles = payload.get("agent_dry_run_roles") or [] + agents = {role.get("agent_id") for role in roles} + if agents != {"openclaw", "hermes", "nemotron"}: + raise ValueError(f"{label}: dry-run roles must include OpenClaw, Hermes, and NemoTron") + for role in roles: + if role.get("live_action_count_24h") != 0: + raise ValueError(f"{label}: agent {role.get('agent_id')} live_action_count_24h must remain zero") + + +def _require_rollup_consistency(payload: dict[str, Any], label: str) -> None: + rollups = payload.get("rollups") or {} + truth = payload.get("dry_run_truth") or {} + artifacts = payload.get("dry_run_artifacts") or [] + drafts = payload.get("telegram_gateway_queue_drafts") or [] + cases = payload.get("readback_verifier_cases") or [] + roles = payload.get("agent_dry_run_roles") or [] + checkpoints = payload.get("operator_checkpoints") or [] + + expected = { + "dry_run_artifact_count": len(artifacts), + "gateway_queue_draft_count": len(drafts), + "readback_verifier_case_count": len(cases), + "agent_role_count": len(roles), + "operator_checkpoint_count": len(checkpoints), + "live_report_delivery_count": truth.get("live_report_delivery_count_24h"), + "telegram_gateway_queue_write_count": truth.get("telegram_gateway_queue_write_count_24h"), + "telegram_bot_api_call_count": truth.get("telegram_bot_api_call_count_24h"), + "delivery_receipt_write_count": truth.get("delivery_receipt_write_count_24h"), + "ai_runtime_worker_run_count": truth.get("ai_runtime_worker_run_count_24h"), + "medium_low_auto_execution_count": truth.get("medium_low_auto_execution_count_24h"), + "post_action_verifier_live_readback_count": truth.get("post_action_verifier_live_readback_count_24h"), + "production_write_count": truth.get("production_write_count_24h"), + } + 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( + checkpoint.get("checkpoint_id") + for checkpoint in checkpoints + if checkpoint.get("approval_required") is True + ) + if sorted(rollups.get("approval_required_checkpoint_ids") or []) != approval_required: + raise ValueError(f"{label}: approval_required_checkpoint_ids mismatch") diff --git a/apps/api/tests/test_ai_agent_report_runtime_dry_run.py b/apps/api/tests/test_ai_agent_report_runtime_dry_run.py new file mode 100644 index 000000000..b193aa2e8 --- /dev/null +++ b/apps/api/tests/test_ai_agent_report_runtime_dry_run.py @@ -0,0 +1,93 @@ +import copy +import json + +import pytest + +from src.services.ai_agent_report_runtime_dry_run import ( + load_latest_ai_agent_report_runtime_dry_run, +) + + +def _write_snapshot(tmp_path, payload): + path = tmp_path / "ai_agent_report_runtime_dry_run_2026-06-12.json" + path.write_text(json.dumps(payload), encoding="utf-8") + return path + + +def test_load_latest_ai_agent_report_runtime_dry_run(): + data = load_latest_ai_agent_report_runtime_dry_run() + + assert data["schema_version"] == "ai_agent_report_runtime_dry_run_v1" + assert data["program_status"]["current_task_id"] == "P2-403M" + assert data["program_status"]["next_task_id"] == "P2-403N" + assert data["program_status"]["overall_completion_percent"] == 91 + assert data["dry_run_truth"]["no_write_dry_run_package_ready"] is True + assert data["dry_run_truth"]["telegram_gateway_queue_draft_ready"] is True + assert data["dry_run_truth"]["readback_verifier_plan_ready"] is True + assert data["dry_run_truth"]["production_delivery_enabled"] is False + assert data["dry_run_truth"]["telegram_gateway_queue_write_enabled"] is False + assert data["dry_run_truth"]["telegram_bot_api_call_enabled"] is False + assert data["dry_run_truth"]["ai_runtime_worker_enabled"] is False + assert data["dry_run_truth"]["medium_low_auto_worker_enabled"] is False + assert data["dry_run_truth"]["post_action_verifier_live_readback_enabled"] is False + assert data["rollups"]["dry_run_artifact_count"] == 5 + assert data["rollups"]["gateway_queue_draft_count"] == 3 + assert data["rollups"]["readback_verifier_case_count"] == 4 + assert data["rollups"]["agent_role_count"] == 3 + assert data["rollups"]["operator_checkpoint_count"] == 6 + assert len(data["rollups"]["approval_required_checkpoint_ids"]) == 5 + assert data["rollups"]["live_report_delivery_count"] == 0 + assert data["rollups"]["telegram_gateway_queue_write_count"] == 0 + assert data["rollups"]["telegram_bot_api_call_count"] == 0 + assert data["rollups"]["production_write_count"] == 0 + + +def test_rejects_gateway_queue_write_enabled(tmp_path): + data = load_latest_ai_agent_report_runtime_dry_run() + bad = copy.deepcopy(data) + bad["dry_run_truth"]["telegram_gateway_queue_write_enabled"] = True + _write_snapshot(tmp_path, bad) + + with pytest.raises(ValueError, match="live write/send/runtime flags"): + load_latest_ai_agent_report_runtime_dry_run(tmp_path) + + +def test_rejects_telegram_bot_api_call_count(tmp_path): + data = load_latest_ai_agent_report_runtime_dry_run() + bad = copy.deepcopy(data) + bad["dry_run_truth"]["telegram_bot_api_call_count_24h"] = 1 + bad["rollups"]["telegram_bot_api_call_count"] = 1 + _write_snapshot(tmp_path, bad) + + with pytest.raises(ValueError, match="live write/send/runtime counts"): + load_latest_ai_agent_report_runtime_dry_run(tmp_path) + + +def test_rejects_queue_draft_secret_payload(tmp_path): + data = load_latest_ai_agent_report_runtime_dry_run() + bad = copy.deepcopy(data) + bad["telegram_gateway_queue_drafts"][0]["payload_contains_secret"] = True + _write_snapshot(tmp_path, bad) + + with pytest.raises(ValueError, match="secret payload"): + load_latest_ai_agent_report_runtime_dry_run(tmp_path) + + +def test_rejects_verifier_live_readback(tmp_path): + data = load_latest_ai_agent_report_runtime_dry_run() + bad = copy.deepcopy(data) + bad["readback_verifier_cases"][0]["live_readback_enabled"] = True + _write_snapshot(tmp_path, bad) + + with pytest.raises(ValueError, match="live readback"): + load_latest_ai_agent_report_runtime_dry_run(tmp_path) + + +def test_rejects_rollup_mismatch(tmp_path): + data = load_latest_ai_agent_report_runtime_dry_run() + bad = copy.deepcopy(data) + bad["rollups"]["dry_run_artifact_count"] = 999 + _write_snapshot(tmp_path, bad) + + with pytest.raises(ValueError, match="rollup counts"): + load_latest_ai_agent_report_runtime_dry_run(tmp_path) diff --git a/apps/api/tests/test_ai_agent_report_runtime_dry_run_api.py b/apps/api/tests/test_ai_agent_report_runtime_dry_run_api.py new file mode 100644 index 000000000..f0eb76d5e --- /dev/null +++ b/apps/api/tests/test_ai_agent_report_runtime_dry_run_api.py @@ -0,0 +1,30 @@ +from fastapi.testclient import TestClient + +from src.main import app + + +def test_get_ai_agent_report_runtime_dry_run_api(): + client = TestClient(app) + response = client.get("/api/v1/agents/agent-report-runtime-dry-run") + + assert response.status_code == 200 + data = response.json() + assert data["schema_version"] == "ai_agent_report_runtime_dry_run_v1" + assert data["program_status"]["current_task_id"] == "P2-403M" + assert data["program_status"]["next_task_id"] == "P2-403N" + assert data["program_status"]["overall_completion_percent"] == 91 + assert data["dry_run_truth"]["no_write_dry_run_package_ready"] is True + assert data["dry_run_truth"]["production_delivery_enabled"] is False + assert data["dry_run_truth"]["telegram_gateway_queue_write_enabled"] is False + assert data["dry_run_truth"]["telegram_bot_api_call_enabled"] is False + assert data["dry_run_truth"]["ai_runtime_worker_enabled"] is False + assert data["dry_run_truth"]["medium_low_auto_worker_enabled"] is False + assert data["rollups"]["dry_run_artifact_count"] == 5 + assert data["rollups"]["gateway_queue_draft_count"] == 3 + assert data["rollups"]["readback_verifier_case_count"] == 4 + assert data["rollups"]["agent_role_count"] == 3 + assert data["rollups"]["operator_checkpoint_count"] == 6 + assert data["rollups"]["live_report_delivery_count"] == 0 + assert data["rollups"]["telegram_gateway_queue_write_count"] == 0 + assert data["rollups"]["telegram_bot_api_call_count"] == 0 + assert data["rollups"]["production_write_count"] == 0 diff --git a/apps/web/messages/en.json b/apps/web/messages/en.json index af5e88657..6eeccff7a 100644 --- a/apps/web/messages/en.json +++ b/apps/web/messages/en.json @@ -4118,6 +4118,56 @@ "high": "高風險", "critical": "關鍵阻擋" } + }, + "reportRuntimeDryRun": { + "title": "P2-403M 報表 runtime no-write dry-run 證據包", + "source": "{generated} · {current} → {next}", + "truthTitle": "no-write dry-run 真相", + "queueTitle": "Gateway queue 草案", + "queueSummary": "草案收件目標是 {room};Secret 只能引用 {secret};目前 queue write {queue}、Bot API {bot}、Telegram send {send}。", + "metrics": { + "overall": "P2-403M 進度", + "artifacts": "dry-run artifacts", + "queueDrafts": "queue 草案", + "verifierCases": "verifier cases", + "approvals": "需批准", + "delivery": "實發報表", + "queueWrites": "queue writes", + "botCalls": "Bot API", + "aiRuns": "AI runs", + "verifierLive": "live verifier" + }, + "flags": { + "noWrite": "no-write package: {value}", + "queueDraft": "queue draft: {value}", + "queueWrite": "queue write: {value}", + "receipt": "receipt write: {value}", + "verifier": "verifier live: {value}", + "send": "send: {value}", + "directApi": "direct API: {value}", + "secret": "secret value: {value}" + }, + "labels": { + "owner": "owner: {value}", + "mode": "mode: {value}", + "status": "status: {value}", + "approvalRequired": "需審核: {value}", + "liveCount": "live {count}", + "blockedUntil": "blocked: {value}" + }, + "statuses": { + "ready_for_local_smoke": "可本地 smoke", + "ready_for_owner_review": "可審查", + "approval_required": "需批准", + "blocked_by_runtime_gate": "runtime 阻擋", + "ready_for_review": "可檢視" + }, + "riskTiers": { + "low": "低風險", + "medium": "中風險", + "high": "高風險", + "critical": "關鍵阻擋" + } } } }, diff --git a/apps/web/messages/zh-TW.json b/apps/web/messages/zh-TW.json index af5e88657..6eeccff7a 100644 --- a/apps/web/messages/zh-TW.json +++ b/apps/web/messages/zh-TW.json @@ -4118,6 +4118,56 @@ "high": "高風險", "critical": "關鍵阻擋" } + }, + "reportRuntimeDryRun": { + "title": "P2-403M 報表 runtime no-write dry-run 證據包", + "source": "{generated} · {current} → {next}", + "truthTitle": "no-write dry-run 真相", + "queueTitle": "Gateway queue 草案", + "queueSummary": "草案收件目標是 {room};Secret 只能引用 {secret};目前 queue write {queue}、Bot API {bot}、Telegram send {send}。", + "metrics": { + "overall": "P2-403M 進度", + "artifacts": "dry-run artifacts", + "queueDrafts": "queue 草案", + "verifierCases": "verifier cases", + "approvals": "需批准", + "delivery": "實發報表", + "queueWrites": "queue writes", + "botCalls": "Bot API", + "aiRuns": "AI runs", + "verifierLive": "live verifier" + }, + "flags": { + "noWrite": "no-write package: {value}", + "queueDraft": "queue draft: {value}", + "queueWrite": "queue write: {value}", + "receipt": "receipt write: {value}", + "verifier": "verifier live: {value}", + "send": "send: {value}", + "directApi": "direct API: {value}", + "secret": "secret value: {value}" + }, + "labels": { + "owner": "owner: {value}", + "mode": "mode: {value}", + "status": "status: {value}", + "approvalRequired": "需審核: {value}", + "liveCount": "live {count}", + "blockedUntil": "blocked: {value}" + }, + "statuses": { + "ready_for_local_smoke": "可本地 smoke", + "ready_for_owner_review": "可審查", + "approval_required": "需批准", + "blocked_by_runtime_gate": "runtime 阻擋", + "ready_for_review": "可檢視" + }, + "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 5273a42c1..a62e6898b 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 @@ -46,6 +46,7 @@ import { type AiAgentProactiveOperationsContractSnapshot, type AiAgentRedisDryRunGateSnapshot, type AiAgentReportAutomationReviewSnapshot, + type AiAgentReportRuntimeDryRunSnapshot, type AiAgentReportRuntimeReadinessSnapshot, type AiAgentReportTruthActionabilityReviewSnapshot, type AiAgentRuntimeVerifierEvidenceReviewSnapshot, @@ -340,6 +341,7 @@ export function AutomationInventoryTab() { const [runtimeVerifierEvidenceReview, setRuntimeVerifierEvidenceReview] = useState(null) const [reportAutomationReview, setReportAutomationReview] = useState(null) const [reportRuntimeReadiness, setReportRuntimeReadiness] = useState(null) + const [reportRuntimeDryRun, setReportRuntimeDryRun] = useState(null) const [reportTruthActionabilityReview, setReportTruthActionabilityReview] = useState(null) const [ownerDryRunPackage, setOwnerDryRunPackage] = useState(null) const [hostStatefulInventory, setHostStatefulInventory] = useState(null) @@ -374,6 +376,7 @@ export function AutomationInventoryTab() { apiClient.getAiAgentRuntimeVerifierEvidenceReview(), apiClient.getAiAgentReportAutomationReview(), apiClient.getAiAgentReportRuntimeReadiness(), + apiClient.getAiAgentReportRuntimeDryRun(), apiClient.getAiAgentReportTruthActionabilityReview(), apiClient.getAiAgentOwnerApprovedFixtureDryRun(), apiClient.getAiAgentHostStatefulVersionInventory(), @@ -407,6 +410,7 @@ export function AutomationInventoryTab() { runtimeVerifierEvidenceReviewResult, reportAutomationReviewResult, reportRuntimeReadinessResult, + reportRuntimeDryRunResult, reportTruthActionabilityReviewResult, ownerDryRunPackageResult, hostStatefulInventoryResult, @@ -437,6 +441,7 @@ export function AutomationInventoryTab() { setRuntimeVerifierEvidenceReview(runtimeVerifierEvidenceReviewResult.status === 'fulfilled' ? runtimeVerifierEvidenceReviewResult.value : null) setReportAutomationReview(reportAutomationReviewResult.status === 'fulfilled' ? reportAutomationReviewResult.value : null) setReportRuntimeReadiness(reportRuntimeReadinessResult.status === 'fulfilled' ? reportRuntimeReadinessResult.value : null) + setReportRuntimeDryRun(reportRuntimeDryRunResult.status === 'fulfilled' ? reportRuntimeDryRunResult.value : null) setReportTruthActionabilityReview(reportTruthActionabilityReviewResult.status === 'fulfilled' ? reportTruthActionabilityReviewResult.value : null) setOwnerDryRunPackage(ownerDryRunPackageResult.status === 'fulfilled' ? ownerDryRunPackageResult.value : null) setHostStatefulInventory(hostStatefulInventoryResult.status === 'fulfilled' ? hostStatefulInventoryResult.value : null) @@ -465,6 +470,7 @@ export function AutomationInventoryTab() { runtimeVerifierEvidenceReviewResult, reportAutomationReviewResult, reportRuntimeReadinessResult, + reportRuntimeDryRunResult, reportTruthActionabilityReviewResult, ownerDryRunPackageResult, hostStatefulInventoryResult, @@ -900,6 +906,46 @@ export function AutomationInventoryTab() { .slice(0, 7) }, [reportRuntimeReadiness]) + const visibleReportRuntimeDryRunArtifacts = useMemo(() => { + if (!reportRuntimeDryRun) return [] + const statusPriority = { blocked_by_runtime_gate: 0, approval_required: 1, ready_for_owner_review: 2, ready_for_local_smoke: 3 } as Record + return [...reportRuntimeDryRun.dry_run_artifacts] + .sort((a, b) => { + const left = statusPriority[a.status] ?? 4 + const right = statusPriority[b.status] ?? 4 + if (left !== right) return left - right + return a.artifact_id.localeCompare(b.artifact_id) + }) + .slice(0, 5) + }, [reportRuntimeDryRun]) + + const visibleReportRuntimeQueueDrafts = useMemo(() => { + if (!reportRuntimeDryRun) return [] + return [...reportRuntimeDryRun.telegram_gateway_queue_drafts] + }, [reportRuntimeDryRun]) + + const visibleReportRuntimeVerifierCases = useMemo(() => { + if (!reportRuntimeDryRun) return [] + return [...reportRuntimeDryRun.readback_verifier_cases] + }, [reportRuntimeDryRun]) + + const visibleReportRuntimeCheckpoints = useMemo(() => { + if (!reportRuntimeDryRun) return [] + const statusPriority = { approval_required: 0, blocked_by_runtime_gate: 1, ready_for_review: 2 } as Record + const riskPriority = { critical: 0, high: 1, medium: 2, low: 3 } as Record + return [...reportRuntimeDryRun.operator_checkpoints] + .sort((a, b) => { + const left = statusPriority[a.status] ?? 3 + const right = statusPriority[b.status] ?? 3 + if (left !== right) return left - right + const leftRisk = riskPriority[a.risk_tier] ?? 4 + const rightRisk = riskPriority[b.risk_tier] ?? 4 + if (leftRisk !== rightRisk) return leftRisk - rightRisk + return a.checkpoint_id.localeCompare(b.checkpoint_id) + }) + .slice(0, 6) + }, [reportRuntimeDryRun]) + const visibleReportTruthFindings = useMemo(() => { if (!reportTruthActionabilityReview) return [] const priority = { critical: 0, high: 1, medium: 2, low: 3 } as Record @@ -1119,7 +1165,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 || !reportAutomationReview || !reportRuntimeReadiness || !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 || !reportRuntimeReadiness || !reportRuntimeDryRun || !reportTruthActionabilityReview || !ownerDryRunPackage || !hostStatefulInventory || !serviceHealthGapMatrix || !serviceHealthNotificationPolicy) { return (
@@ -1278,6 +1324,17 @@ export function AutomationInventoryTab() { const reportRuntimeQueueWrites = reportRuntimeReadiness.rollups.telegram_gateway_queue_write_count const reportRuntimeAiRuns = reportRuntimeReadiness.rollups.live_ai_analysis_count const reportRuntimeMediumLowRuns = reportRuntimeReadiness.rollups.live_medium_low_auto_execution_count + const reportDryRunOverall = reportRuntimeDryRun.program_status.overall_completion_percent + const reportDryRunArtifacts = reportRuntimeDryRun.rollups.dry_run_artifact_count + const reportDryRunQueueDrafts = reportRuntimeDryRun.rollups.gateway_queue_draft_count + const reportDryRunVerifierCases = reportRuntimeDryRun.rollups.readback_verifier_case_count + const reportDryRunApprovals = reportRuntimeDryRun.rollups.approval_required_checkpoint_ids.length + const reportDryRunDelivery = reportRuntimeDryRun.rollups.live_report_delivery_count + const reportDryRunQueueWrites = reportRuntimeDryRun.rollups.telegram_gateway_queue_write_count + const reportDryRunBotCalls = reportRuntimeDryRun.rollups.telegram_bot_api_call_count + const reportDryRunAiRuns = reportRuntimeDryRun.rollups.ai_runtime_worker_run_count + const reportDryRunVerifierLive = reportRuntimeDryRun.rollups.post_action_verifier_live_readback_count + const reportDryRunPrimaryDraft = visibleReportRuntimeQueueDrafts[0] const reportTruthOverall = reportTruthActionabilityReview.program_status.overall_completion_percent const reportTruthFindings = reportTruthActionabilityReview.rollups.zero_signal_finding_count const reportTruthCritical = reportTruthActionabilityReview.rollups.critical_finding_count @@ -2169,6 +2226,184 @@ export function AutomationInventoryTab() {
+
+
+
+ + + {t('reportRuntimeDryRun.title')} + +
+ +
+ +
+ } /> + } /> + } /> + } /> + 0 ? 'danger' : 'ok'} icon={} /> + } /> + } /> + } /> + } /> + } /> +
+ +
+
+ {t('reportRuntimeDryRun.truthTitle')} + + {reportRuntimeDryRun.dry_run_truth.truth_note} + +
+ + + + +
+
+ +
+ {t('reportRuntimeDryRun.queueTitle')} + + {t('reportRuntimeDryRun.queueSummary', { + room: reportDryRunPrimaryDraft?.recipient_room ?? 'AwoooI SRE 戰情室', + secret: reportDryRunPrimaryDraft?.secret_ref ?? 'SRE_GROUP_CHAT_ID', + queue: reportDryRunQueueWrites, + bot: reportDryRunBotCalls, + send: reportDryRunDelivery, + })} + +
+ + + + +
+
+
+ +
+ {visibleReportRuntimeDryRunArtifacts.map(artifact => ( +
+
+ + {artifact.display_name} + + +
+
+ + + +
+ + {artifact.evidence_ref} + + +
+ ))} +
+ +
+ {visibleReportRuntimeQueueDrafts.map(draft => ( +
+
+ + {draft.display_name} + + +
+
+ + + + + +
+ + {draft.noise_budget} + +
+ ))} +
+ +
+ {reportRuntimeDryRun.agent_dry_run_roles.map(role => ( +
+
+ + {role.display_name} + + +
+ + {role.dry_run_responsibility} + +
+ {role.allowed_now.slice(0, 2).map(item => ( + + ))} + {role.blocked_now.slice(0, 2).map(item => ( + + ))} +
+
+ ))} +
+ +
+ {visibleReportRuntimeVerifierCases.map(verifierCase => ( +
+
+ + {verifierCase.display_name} + + +
+
+ + + +
+ + {verifierCase.expected_signal} + + +
+ ))} +
+ +
+ {visibleReportRuntimeCheckpoints.map(checkpoint => ( +
+
+ + {checkpoint.display_name} + + +
+
+ + + +
+ + {checkpoint.next_safe_step} + +
+ ))} +
+
+
diff --git a/apps/web/src/lib/api-client.ts b/apps/web/src/lib/api-client.ts index e9cd3a7b4..2d5cec6b1 100644 --- a/apps/web/src/lib/api-client.ts +++ b/apps/web/src/lib/api-client.ts @@ -332,6 +332,11 @@ export const apiClient = { return handleResponse(res) }, + async getAiAgentReportRuntimeDryRun() { + const res = await fetch(`${API_BASE_URL}/agents/agent-report-runtime-dry-run`) + return handleResponse(res) + }, + async getAiAgentOwnerApprovedFixtureDryRun() { const res = await fetch(`${API_BASE_URL}/agents/agent-owner-approved-fixture-dry-run`) return handleResponse(res) @@ -2201,6 +2206,126 @@ export interface AiAgentReportRuntimeReadinessSnapshot { } } +export interface AiAgentReportRuntimeDryRunSnapshot { + schema_version: 'ai_agent_report_runtime_dry_run_v1' + generated_at: string + program_status: { + overall_completion_percent: number + current_priority: 'P0' | 'P1' | 'P2' | 'P3' + current_task_id: 'P2-403M' + next_task_id: string + read_only_mode: true + runtime_authority: 'report_runtime_no_write_dry_run_only_no_gateway_write_or_delivery' + status_note: string + } + source_refs: string[] + dry_run_truth: { + no_write_dry_run_package_ready: true + report_snapshot_dry_run_ready: true + telegram_gateway_queue_draft_ready: true + readback_verifier_plan_ready: true + failure_only_telegram_draft_ready: true + production_delivery_enabled: false + telegram_gateway_queue_write_enabled: false + telegram_bot_api_call_enabled: false + delivery_receipt_write_enabled: false + ai_runtime_worker_enabled: false + medium_low_auto_worker_enabled: false + post_action_verifier_live_readback_enabled: false + production_write_enabled: false + secret_value_read_enabled: false + work_window_transcript_display_allowed: false + live_report_delivery_count_24h: number + telegram_gateway_queue_write_count_24h: number + telegram_bot_api_call_count_24h: number + delivery_receipt_write_count_24h: number + ai_runtime_worker_run_count_24h: number + medium_low_auto_execution_count_24h: number + post_action_verifier_live_readback_count_24h: number + production_write_count_24h: number + truth_note: string + } + dry_run_artifacts: Array<{ + artifact_id: string + display_name: string + owner_agent: 'openclaw' | 'hermes' | 'nemotron' + mode: 'repo_only_no_write' + status: 'ready_for_local_smoke' | 'ready_for_owner_review' | 'approval_required' | 'blocked_by_runtime_gate' + evidence_ref: string + hash_strategy: string + writes_production: false + contains_secret: false + blocked_until: string + }> + telegram_gateway_queue_drafts: Array<{ + draft_id: 'daily_report_digest' | 'weekly_report_digest' | 'monthly_report_digest' + display_name: string + recipient_room: 'AwoooI SRE 戰情室' + secret_ref: 'SRE_GROUP_CHAT_ID' + cadence: 'daily' | 'weekly' | 'monthly' + noise_budget: string + gateway_queue_write_enabled: false + telegram_send_enabled: false + direct_bot_api_allowed: false + payload_contains_secret: false + redaction_policy: string + }> + readback_verifier_cases: Array<{ + case_id: string + display_name: string + owner_agent: 'openclaw' | 'hermes' | 'nemotron' + readback_surface: string + expected_signal: string + live_readback_enabled: false + writes_result: false + requires_secret_value: false + blocked_until: string + }> + agent_dry_run_roles: Array<{ + agent_id: 'openclaw' | 'hermes' | 'nemotron' + display_name: string + dry_run_responsibility: string + allowed_now: string[] + blocked_now: string[] + live_action_count_24h: number + }> + operator_checkpoints: Array<{ + checkpoint_id: string + display_name: string + owner_agent: 'openclaw' | 'hermes' | 'nemotron' + risk_tier: 'low' | 'medium' | 'high' | 'critical' + approval_required: boolean + status: 'ready_for_review' | 'approval_required' | 'blocked_by_runtime_gate' + next_safe_step: string + }> + display_redaction_contract: { + redaction_required: true + raw_report_payload_display_allowed: false + raw_telegram_payload_display_allowed: false + private_reasoning_display_allowed: false + secret_value_display_allowed: false + work_window_transcript_display_allowed: false + allowed_display_fields: string[] + blocked_display_fields: string[] + } + rollups: { + dry_run_artifact_count: number + gateway_queue_draft_count: number + readback_verifier_case_count: number + agent_role_count: number + operator_checkpoint_count: number + approval_required_checkpoint_ids: string[] + live_report_delivery_count: number + telegram_gateway_queue_write_count: number + telegram_bot_api_call_count: number + delivery_receipt_write_count: number + ai_runtime_worker_run_count: number + medium_low_auto_execution_count: number + post_action_verifier_live_readback_count: number + production_write_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 e81551fee..daf5d6559 100644 --- a/docs/LOGBOOK.md +++ b/docs/LOGBOOK.md @@ -1,3 +1,36 @@ +## 2026-06-12|P2-403M 報表 runtime no-write dry-run 證據包 + +**背景**:P2-403L 已把日報 / 週報 / 月報派送、Telegram Gateway queue、讀報回執、AI 讀報後分析、中低風險自動處理與高風險審核拆成啟動前閘門;本段依序推進到 P2-403M,把真正啟動前的 no-write dry-run、SRE 戰情室 queue 草案與 readback verifier 草案固定成可審核證據。 + +**完成**: + +- 新增 `ai_agent_report_runtime_dry_run_v1` schema、committed snapshot 與 backend loader,強制 production delivery、Gateway queue write、Bot API、delivery receipt write、AI runtime worker、中低風險 auto worker、verifier live readback、production write、secret value read 與內部對話顯示全部維持 `false / 0`。 +- 新增 `GET /api/v1/agents/agent-report-runtime-dry-run` 只讀 API 與測試;API 只回傳 committed dry-run evidence,不送 Telegram、不寫 queue、不讀 secret、不啟動 worker。 +- 治理頁 `/zh-TW/governance?tab=automation-inventory` 新增 P2-403M 區塊,顯示 5 個 dry-run artifact、3 個 SRE 戰情室 queue digest 草案、4 個 readback verifier case、OpenClaw / Hermes / NemoTron dry-run 分工與 6 個 operator checkpoint。 +- 更新 `AI_AGENT_AUTOMATION_WORKLIST_2026-06-04.md`、`AI_AGENT_INTERACTION_LEARNING_PROOF_2026-06-11.md` 與 MASTER §3.2 / §5,將 P2-403M 標記為完成,下一步改為 `P2-403N` fixture smoke / queue preview readback / verifier dry-run。 + +**驗證**: + +- 本地:`python3 -m json.tool` 檢查 P2-403M snapshot / schema / `zh-TW.json` / `en.json` 通過。 +- 本地:`python3 -m py_compile apps/api/src/services/ai_agent_report_runtime_dry_run.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_runtime_dry_run.py apps/api/tests/test_ai_agent_report_runtime_dry_run_api.py`:`7 passed`。 +- 本地:報表治理相關 API 回歸測試:`30 passed`。 +- 本地:`python3 scripts/security/security-mirror-progress-guard.py --root .` 通過。 +- 本地:`python3 scripts/security/source-control-owner-response-guard.py --root .` 通過。 +- 本地:`python3 scripts/ops/doc-secrets-sanity-check.py docs .gitea`:`DOC_SECRET_SANITY_OK scanned_files=713`。 +- 本地:`cmp -s apps/web/messages/zh-TW.json apps/web/messages/en.json` 通過,兩份訊息檔維持繁體中文鏡像。 +- 本地:`pnpm --filter @awoooi/web typecheck` 通過。 +- 本地:`NEXT_PUBLIC_API_URL='https://awoooi.wooo.work' pnpm --filter @awoooi/web build` 通過;未設定 `NEXT_PUBLIC_API_URL` 的 build 會依既有前端禁令 fatal,重跑時使用公網 origin,未使用內網 IP。 +- 本地:`git diff --check` 通過。 + +**完成度同步**: + +- P2-403M:`91%`,本地 schema / snapshot / API / governance UI / tests / docs 完成;正式環境 readback 待推版後補齊。 +- P2-403N:`0%`,下一步只能做 fixture smoke、queue preview readback 與 verifier dry-run。 +- live report delivery、Gateway queue write、Telegram Bot API、delivery receipt write、AI runtime worker、中低風險 auto worker、verifier live readback、production write:全部仍為 `0`。 + +**邊界**:本段不送 Telegram、不寫 Gateway queue、不呼叫 Bot API、不寫 delivery receipt、不啟動 AI runtime worker、不啟動中低風險 auto worker、不跑 verifier live readback、不讀 secret、不顯示內部對話內容、不提供前端批准 / 執行 / 發送按鈕;不得把 dry-run 證據包解讀成 runtime loop 已運作。 + ## 2026-06-12|S4.9 owner response 基準一致性強化 **背景**:S4.9 owner response gate 的缺口稽核已能維持 `0 / false` 邊界,但文件仍有過期 `gitea/main` 基準;S4.13 rollup snapshot 也殘留 `2026-06-04` 與 `5 + 7 + 5 + 5 = 22` 的舊模板公式。這會讓下一個 Session 誤判目前收件狀態或模板總數。 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 01007b34f..675d2579a 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 主動溝通、學習與成長證據 | 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 分析建議與高 / 中 / 低風險自動化政策審查;P2-403K 已完成本地程式層 SRE 戰情室路由收斂;P2-403L 已完成報表派送、Telegram Gateway queue、讀報回執、AI 讀報後分析、中低風險自動處理與高風險審核的啟動前閘門。runtime worker、DB migration、production Redis consumer group、Telegram 實發、delivery receipt E2E、report delivery、Gateway queue write、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`、`ai_agent_report_runtime_readiness_v1`、`GET /api/v1/agents/agent-report-runtime-readiness`、`/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 分析建議與高 / 中 / 低風險自動化政策審查;P2-403K 已完成本地程式層 SRE 戰情室路由收斂;P2-403L 已完成報表派送、Telegram Gateway queue、讀報回執、AI 讀報後分析、中低風險自動處理與高風險審核的啟動前閘門;P2-403M 已完成報表 runtime no-write dry-run 證據包、SRE 戰情室 Gateway queue 草案與 readback verifier 草案。runtime worker、DB migration、production Redis consumer group、Telegram 實發、delivery receipt E2E、report delivery、Gateway queue write、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`、`ai_agent_report_runtime_readiness_v1`、`GET /api/v1/agents/agent-report-runtime-readiness`、`ai_agent_report_runtime_dry_run_v1`、`GET /api/v1/agents/agent-report-runtime-dry-run`、`/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 主動溝通、學習與成長證據目前完成度:**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 建議 / 風險自動化政策審查、P2-403K SRE 戰情室路由程式收斂,以及 P2-403L 報表派送 / Telegram queue / 讀報回執 / 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 實發與 delivery receipt E2E 仍全部為 `0`,下一步依優先順序推 `P2-403M` no-write dry-run / SRE 戰情室 Gateway queue 草案 / readback verifier,但在批准前仍不得啟動 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 建議 / 風險自動化政策審查、P2-403K SRE 戰情室路由程式收斂、P2-403L 報表派送 / Telegram queue / 讀報回執 / AI 讀報分析 / 中低風險自動處理 / 高風險審核啟動前閘門,以及 P2-403M no-write dry-run / SRE 戰情室 Gateway queue 草案 / readback verifier;目前 live AgentSession、Agent message、handoff、learning write、Telegram receipt、Gateway queue write、runtime verifier execution、report delivery、AI analysis runtime、中低風險 auto worker、Telegram 實發與 delivery receipt E2E 仍全部為 `0`,下一步依優先順序推 `P2-403N` fixture smoke / queue preview readback / verifier dry-run,但在批准前仍不得啟動 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-403L` 已先補互動、學習證據面、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 工作量、圖表化報告、風險自動化政策與報表 runtime 啟動前閘門。下一步是 `P2-403M` no-write dry-run / SRE 戰情室 Gateway queue 草案 / readback verifier,外部 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-403M` 已先補互動、學習證據面、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 工作量、圖表化報告、風險自動化政策、報表 runtime 啟動前閘門與 no-write dry-run 證據包。下一步是 `P2-403N` fixture smoke / queue preview readback / verifier dry-run,外部 registry / package source / host probe / SSH / kubectl / 工具安裝 / CI 變更 / 實際 PR creation / Telegram 實發與 learning write 仍需 gate。 完成度計算模型: @@ -970,6 +970,8 @@ UI: | 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-403K | 本地完成,正式站待驗證 | 100 | OpenClaw | AwoooI SRE 戰情室路由程式收斂;移除 Gitea / API / ops script 舊群組與 private mirror fallback | Gitea workflow 使用 `SRE_GROUP_CHAT_ID`;CD 舊相容欄位取自 SRE group;Telegram Gateway / notification matrix / jobs / ops scripts SRE-only;CI guard 擋舊 `TELEGRAM_ALERT_CHAT_ID` / `TELEGRAM_CHAT_ID` 與非 SRE direct fallback | 未讀 secret value、未發 Telegram live 測試、未改 Prometheus / Alertmanager route、未開 Gateway queue write / receipt worker / runtime gate | | P2-403L | 完成 | 86 | OpenClaw + Hermes + NemoTron | 報表派送、Telegram Gateway queue、讀報回執、AI 讀報後分析、中低風險自動處理、高風險審核與 post-action verifier 啟動前閘門 | `ai_agent_report_runtime_readiness_v1` / snapshot / 只讀 API / governance UI;7 個 runtime lane、3 個報表週期 gate、4 個風險政策、7 個 operator decision、SRE 戰情室路由 contract;live delivery / queue write / AI runtime / 中低風險執行全部 `0` | 不排程實發、不寫 Gateway queue、不呼叫 Bot API、不啟動 AI runtime worker、不啟動中低風險 auto worker、不執行生產優化、不讀 secret、不顯示內部對話內容 | +| P2-403M | 完成 | 91 | OpenClaw + Hermes + NemoTron | 報表 runtime no-write dry-run、SRE 戰情室 Gateway queue 草案、readback verifier 草案 | `ai_agent_report_runtime_dry_run_v1` / snapshot / 只讀 API / governance UI;5 個 dry-run artifact、3 個 queue digest 草案、4 個 readback verifier case、3 個 Agent dry-run role、6 個 operator checkpoint;live delivery / queue write / Bot API / receipt write / AI runtime / 中低風險 auto worker / verifier live readback 全部 `0` | 不寫 Gateway queue、不送 Telegram、不呼叫 Bot API、不寫 delivery receipt、不啟動 AI runtime worker、不啟動中低風險 auto worker、不執行 verifier live readback、不讀 secret、不顯示內部對話內容 | +| P2-403N | 待辦 | 0 | Hermes + NemoTron + OpenClaw | fixture smoke / queue preview readback / verifier dry-run | 以 P2-403M committed snapshot 產生 redacted hash 與 no-write readback evidence | 仍不得 live send / live write;中低風險自動處理與高風險審核需另行批准 | | 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 cab655be1..b7e7c8826 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,8 +1,8 @@ # 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、P2-403J 報表真相 / 日週月報 / Agent 工作量 / 風險自動化 review、P2-403L 報表派送與自動處理啟動前閘門、API 與治理頁 UI。 -> 事實邊界:本波只建立可見證據面、read model gate、報表治理 review 與 runtime readiness gate,不啟動 runtime worker、不建立 DB migration、不開 Redis consumer group、不發 Telegram、不寫 Gateway queue、不排程實發報告、不啟動中低風險 auto worker、不執行生產優化、不顯示工作視窗對話內容。 +> 文件定位: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、P2-403L 報表派送與自動處理啟動前閘門、P2-403M 報表 runtime no-write dry-run 證據包、API 與治理頁 UI。 +> 事實邊界:本波只建立可見證據面、read model gate、報表治理 review、runtime readiness gate 與 no-write dry-run 證據包,不啟動 runtime worker、不建立 DB migration、不開 Redis consumer group、不發 Telegram、不寫 Gateway queue、不寫 delivery receipt、不排程實發報告、不啟動中低風險 auto worker、不執行 verifier live readback、不執行生產優化、不顯示工作視窗對話內容。 ## 0. P2-403J 補記:報表真相、日週月報與風險自動化 Review @@ -16,9 +16,15 @@ 本段把日週月報真正送出前需要的 runtime lane 拆成 7 個 gate:報表排程器、Telegram Gateway queue、送達與讀報回執、AI 讀報後分析、中低風險自動處理 guard、高風險統帥審核、post-action verifier。政策上低 / 中風險可在 guard 通過後自動處理,但目前 live delivery、Gateway queue write、AI runtime worker、中低風險 auto worker、高風險自動執行與生產優化仍全部為 `0 / false`。 +## 0.2 P2-403M 補記:報表 runtime no-write dry-run 證據包 + +2026-06-12 已新增 P2-403M:`ai_agent_report_runtime_dry_run_v1`、`docs/evaluations/ai_agent_report_runtime_dry_run_2026-06-12.json`、`GET /api/v1/agents/agent-report-runtime-dry-run` 與治理頁區塊。 + +本段把 P2-403L 的啟動前閘門往前推到可審查 dry-run 證據:5 個 dry-run artifact、3 個 SRE 戰情室 Telegram digest queue 草案、4 個 readback verifier case、3 個 Agent dry-run role 與 6 個 operator checkpoint。OpenClaw 負責 no-write 風險裁決與中低風險 no-op plan;Hermes 負責 report snapshot preview、redacted Telegram digest 草案與 readback checklist;NemoTron 負責 fixture-only replay scoring、readback failure mode tagging 與 sanitized regression summary。本段仍不寫 Gateway queue、不送 Telegram、不呼叫 Bot API、不寫 delivery receipt、不啟動 AI runtime worker、不啟動中低風險 auto worker、不跑 verifier live readback、不讀 secret,所有 live count 仍為 `0`。 + ## 1. 結論 -已完成 P2-403A、P2-403B、P2-403C、P2-403D、P2-403E、P2-403F、P2-403G、P2-403H、P2-403I、P2-403J 與 P2-403L:讓統帥能在治理頁看到 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 工作量、圖表化報告、風險自動化政策與報表 runtime 啟動前閘門下一步要通過哪些 gate。 +已完成 P2-403A、P2-403B、P2-403C、P2-403D、P2-403E、P2-403F、P2-403G、P2-403H、P2-403I、P2-403J、P2-403L 與 P2-403M:讓統帥能在治理頁看到 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 工作量、圖表化報告、風險自動化政策、報表 runtime 啟動前閘門與 no-write dry-run 證據包下一步要通過哪些 gate。 目前真相: @@ -38,6 +44,7 @@ | Telegram digest receipts | 未啟用,數量 `0` | | Report delivery / AI analysis / auto optimization | 未啟用,數量 `0` | | Telegram Gateway queue / 中低風險 auto worker | 未啟用,數量 `0` | +| P2-403M no-write dry-run package | 已完成,正式寫入 / 發送 / worker / verifier live readback 全為 `0` | 這代表使用者現在可以看見「哪裡已準備好、哪裡仍未運作、被哪個 gate 阻擋、下一步要如何驗證」。但還不能宣稱三個 Agent 已經在 production runtime 主動互傳訊息或自主學習。 @@ -90,17 +97,20 @@ | `docs/schemas/ai_agent_report_runtime_readiness_v1.schema.json` | P2-403L 報表派送、Telegram Gateway queue、讀報回執、AI 讀報後分析、中低風險自動處理、高風險審核與 post-action verifier 啟動前閘門 schema | | `docs/evaluations/ai_agent_report_runtime_readiness_2026-06-12.json` | P2-403L committed snapshot,7 個 runtime lane、3 個報表週期 gate、4 個風險政策、7 個 operator decision;live delivery / Gateway queue write / AI runtime / 中低風險 auto worker 全為 `0` | | `GET /api/v1/agents/agent-report-runtime-readiness` | 只讀 API;不排程實發、不寫 Gateway queue、不呼叫 Bot API、不啟動 AI runtime worker、不執行生產優化 | +| `docs/schemas/ai_agent_report_runtime_dry_run_v1.schema.json` | P2-403M 報表 runtime no-write dry-run schema;強制 Gateway queue write、Telegram send、Bot API、delivery receipt、AI runtime worker、中低風險 auto worker、verifier live readback 與 production write 全部維持未授權 | +| `docs/evaluations/ai_agent_report_runtime_dry_run_2026-06-12.json` | P2-403M committed snapshot,完成度 `91%`,5 個 dry-run artifact、3 個 queue digest 草案、4 個 readback verifier case、3 個 Agent role、6 個 operator checkpoint;所有 live counts 全為 `0` | +| `GET /api/v1/agents/agent-report-runtime-dry-run` | 只讀 API;不寫 Gateway queue、不送 Telegram、不呼叫 Bot API、不寫 delivery receipt、不啟動 worker、不讀 secret | | `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、P2-403J 報表真相 / 日週月報 / Agent 工作量 / 圖表 / AI 建議、P2-403L 報表 runtime readiness、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 建議、P2-403L 報表 runtime readiness、P2-403M no-write dry-run、Agent lane、可觀測訊號、runtime gates、前端 redaction | ## 5. 後續優先順序 | 優先 | ID | 工作 | gate | |---:|---|---|---| -| 1 | P2-403M | no-write dry-run / SRE 戰情室 Gateway queue 草案 / readback verifier | report runtime dry-run | +| 1 | P2-403N | fixture smoke / queue preview readback / verifier dry-run | 仍不得 live send / live write | | 2 | P2-404 | runtime worker shadow / no-write execution evidence gate | runtime shadow evidence | ## 6. 紅線 diff --git a/docs/evaluations/ai_agent_report_runtime_dry_run_2026-06-12.json b/docs/evaluations/ai_agent_report_runtime_dry_run_2026-06-12.json new file mode 100644 index 000000000..713b0363c --- /dev/null +++ b/docs/evaluations/ai_agent_report_runtime_dry_run_2026-06-12.json @@ -0,0 +1,347 @@ +{ + "schema_version": "ai_agent_report_runtime_dry_run_v1", + "generated_at": "2026-06-12T11:55:00+08:00", + "program_status": { + "overall_completion_percent": 91, + "current_priority": "P2", + "current_task_id": "P2-403M", + "next_task_id": "P2-403N", + "read_only_mode": true, + "runtime_authority": "report_runtime_no_write_dry_run_only_no_gateway_write_or_delivery", + "status_note": "P2-403M 已建立報表 runtime no-write dry-run 證據包、Telegram Gateway queue 草案與 readback verifier 草案;目前仍未寫 Gateway queue、未送 Telegram、未寫讀報回執、未啟動 AI runtime worker 或中低風險 auto worker。" + }, + "source_refs": [ + "docs/evaluations/ai_agent_report_runtime_readiness_2026-06-12.json", + "docs/evaluations/ai_agent_report_automation_review_2026-06-12.json", + "docs/evaluations/ai_agent_telegram_receipt_approval_package_2026-06-11.json", + "docs/evaluations/ai_agent_owner_approved_fixture_dry_run_2026-06-11.json", + "docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md" + ], + "dry_run_truth": { + "no_write_dry_run_package_ready": true, + "report_snapshot_dry_run_ready": true, + "telegram_gateway_queue_draft_ready": true, + "readback_verifier_plan_ready": true, + "failure_only_telegram_draft_ready": true, + "production_delivery_enabled": false, + "telegram_gateway_queue_write_enabled": false, + "telegram_bot_api_call_enabled": false, + "delivery_receipt_write_enabled": false, + "ai_runtime_worker_enabled": false, + "medium_low_auto_worker_enabled": false, + "post_action_verifier_live_readback_enabled": false, + "production_write_enabled": false, + "secret_value_read_enabled": false, + "work_window_transcript_display_allowed": false, + "live_report_delivery_count_24h": 0, + "telegram_gateway_queue_write_count_24h": 0, + "telegram_bot_api_call_count_24h": 0, + "delivery_receipt_write_count_24h": 0, + "ai_runtime_worker_run_count_24h": 0, + "medium_low_auto_execution_count_24h": 0, + "post_action_verifier_live_readback_count_24h": 0, + "production_write_count_24h": 0, + "truth_note": "本段只建立 no-write dry-run 與 queue / verifier 草案的可審查證據;所有正式傳送、queue write、回執寫入、AI worker、auto worker 與 verifier live readback 都仍為 0。" + }, + "dry_run_artifacts": [ + { + "artifact_id": "report_run_snapshot_preview", + "display_name": "report_run snapshot preview", + "owner_agent": "hermes", + "mode": "repo_only_no_write", + "status": "ready_for_local_smoke", + "evidence_ref": "docs/evaluations/ai_agent_report_automation_review_2026-06-12.json", + "hash_strategy": "computed_during_fixture_smoke", + "writes_production": false, + "contains_secret": false, + "blocked_until": "P2-403N fixture smoke" + }, + { + "artifact_id": "telegram_digest_payload_preview", + "display_name": "Telegram digest payload preview", + "owner_agent": "hermes", + "mode": "repo_only_no_write", + "status": "ready_for_owner_review", + "evidence_ref": "docs/evaluations/ai_agent_telegram_receipt_approval_package_2026-06-11.json", + "hash_strategy": "redacted_payload_hash_at_dry_run", + "writes_production": false, + "contains_secret": false, + "blocked_until": "SRE_GROUP_CHAT_ID injection readback" + }, + { + "artifact_id": "ai_post_report_analysis_packet", + "display_name": "AI post-report analysis packet", + "owner_agent": "openclaw", + "mode": "repo_only_no_write", + "status": "ready_for_local_smoke", + "evidence_ref": "docs/evaluations/ai_agent_report_runtime_readiness_2026-06-12.json", + "hash_strategy": "sanitized_report_packet_hash", + "writes_production": false, + "contains_secret": false, + "blocked_until": "OpenClaw no-write analysis smoke" + }, + { + "artifact_id": "medium_low_auto_noop_plan", + "display_name": "中低風險 no-op plan", + "owner_agent": "openclaw", + "mode": "repo_only_no_write", + "status": "approval_required", + "evidence_ref": "docs/evaluations/ai_agent_report_runtime_readiness_2026-06-12.json", + "hash_strategy": "noop_plan_hash_after_guard", + "writes_production": false, + "contains_secret": false, + "blocked_until": "allow-list + post-action verifier" + }, + { + "artifact_id": "post_action_verifier_readback_plan", + "display_name": "post-action verifier readback plan", + "owner_agent": "nemotron", + "mode": "repo_only_no_write", + "status": "blocked_by_runtime_gate", + "evidence_ref": "docs/evaluations/ai_agent_runtime_verifier_evidence_review_2026-06-12.json", + "hash_strategy": "fixture_readback_hash", + "writes_production": false, + "contains_secret": false, + "blocked_until": "canonical target read-only inventory" + } + ], + "telegram_gateway_queue_drafts": [ + { + "draft_id": "daily_report_digest", + "display_name": "AI Agent 日報 digest 草案", + "recipient_room": "AwoooI SRE 戰情室", + "secret_ref": "SRE_GROUP_CHAT_ID", + "cadence": "daily", + "noise_budget": "failure-only immediate + daily summary", + "gateway_queue_write_enabled": false, + "telegram_send_enabled": false, + "direct_bot_api_allowed": false, + "payload_contains_secret": false, + "redaction_policy": "只保留 report_run_id、風險統計、需要審核項目與連回治理頁的 redacted ref" + }, + { + "draft_id": "weekly_report_digest", + "display_name": "AI Agent 週報 digest 草案", + "recipient_room": "AwoooI SRE 戰情室", + "secret_ref": "SRE_GROUP_CHAT_ID", + "cadence": "weekly", + "noise_budget": "weekly owner packet only", + "gateway_queue_write_enabled": false, + "telegram_send_enabled": false, + "direct_bot_api_allowed": false, + "payload_contains_secret": false, + "redaction_policy": "只保留趨勢、阻擋項、approval backlog 與 redacted evidence refs" + }, + { + "draft_id": "monthly_report_digest", + "display_name": "AI Agent 月報 digest 草案", + "recipient_room": "AwoooI SRE 戰情室", + "secret_ref": "SRE_GROUP_CHAT_ID", + "cadence": "monthly", + "noise_budget": "monthly strategy packet only", + "gateway_queue_write_enabled": false, + "telegram_send_enabled": false, + "direct_bot_api_allowed": false, + "payload_contains_secret": false, + "redaction_policy": "只保留策略摘要、成熟度、成本/風險趨勢與 redacted refs" + } + ], + "readback_verifier_cases": [ + { + "case_id": "report_snapshot_readback", + "display_name": "報表 snapshot readback", + "owner_agent": "hermes", + "readback_surface": "committed report snapshot", + "expected_signal": "schema / generated_at / workload / risk counts 可讀", + "live_readback_enabled": false, + "writes_result": false, + "requires_secret_value": false, + "blocked_until": "fixture smoke" + }, + { + "case_id": "gateway_queue_preview_readback", + "display_name": "Gateway queue preview readback", + "owner_agent": "hermes", + "readback_surface": "redacted queue preview", + "expected_signal": "recipient room、secret ref、noise budget、payload hash 可讀", + "live_readback_enabled": false, + "writes_result": false, + "requires_secret_value": false, + "blocked_until": "Gateway dry-run preview" + }, + { + "case_id": "receipt_redaction_readback", + "display_name": "讀報回執 redaction readback", + "owner_agent": "hermes", + "readback_surface": "redacted receipt contract", + "expected_signal": "不顯示 chat_id / message_id raw payload / token", + "live_readback_enabled": false, + "writes_result": false, + "requires_secret_value": false, + "blocked_until": "receipt schema approval" + }, + { + "case_id": "medium_low_noop_readback", + "display_name": "中低風險 no-op readback", + "owner_agent": "nemotron", + "readback_surface": "fixture replay + no-op plan", + "expected_signal": "能比較預期行動與 no-op 結果,不觸碰 production target", + "live_readback_enabled": false, + "writes_result": false, + "requires_secret_value": false, + "blocked_until": "canonical target inventory" + } + ], + "agent_dry_run_roles": [ + { + "agent_id": "openclaw", + "display_name": "OpenClaw", + "dry_run_responsibility": "仲裁報表後建議、決定中低風險是否只能產生 no-op plan、拒收高風險自動執行。", + "allowed_now": [ + "產生 no-write 風險裁決", + "標記需要統帥審核的候選", + "拒收不符合 guard 的自動化提案" + ], + "blocked_now": [ + "production write", + "high risk execution", + "provider route change" + ], + "live_action_count_24h": 0 + }, + { + "agent_id": "hermes", + "display_name": "Hermes", + "dry_run_responsibility": "產生 report_run snapshot preview、Telegram digest payload 草案與 redacted readback 欄位。", + "allowed_now": [ + "彙整報表 snapshot", + "產生 redacted Telegram 草案", + "建立 readback checklist" + ], + "blocked_now": [ + "Gateway queue write", + "Telegram send", + "KM canonical write" + ], + "live_action_count_24h": 0 + }, + { + "agent_id": "nemotron", + "display_name": "NemoTron", + "dry_run_responsibility": "針對 no-op plan、verifier readback 與 fixture replay 做離線 regression 標籤。", + "allowed_now": [ + "fixture-only replay scoring", + "readback failure mode tagging", + "sanitized regression summary" + ], + "blocked_now": [ + "live verifier execution", + "production route", + "paid API call" + ], + "live_action_count_24h": 0 + } + ], + "operator_checkpoints": [ + { + "checkpoint_id": "report_fixture_smoke", + "display_name": "允許 report fixture smoke", + "owner_agent": "hermes", + "risk_tier": "low", + "approval_required": false, + "status": "ready_for_review", + "next_safe_step": "以 committed snapshots 產生 report_run preview hash,不送出、不寫 DB。" + }, + { + "checkpoint_id": "gateway_queue_preview", + "display_name": "批准 Gateway queue preview", + "owner_agent": "hermes", + "risk_tier": "medium", + "approval_required": true, + "status": "approval_required", + "next_safe_step": "只產生 redacted payload preview,仍不得 XADD / queue insert / Bot API。" + }, + { + "checkpoint_id": "receipt_redaction_schema", + "display_name": "批准讀報回執 redaction schema", + "owner_agent": "hermes", + "risk_tier": "medium", + "approval_required": true, + "status": "approval_required", + "next_safe_step": "固定 redacted message ref、ack timeout 與 retry ceiling,不接 live callback。" + }, + { + "checkpoint_id": "openclaw_post_report_noop", + "display_name": "批准 OpenClaw 讀報後 no-op 分析", + "owner_agent": "openclaw", + "risk_tier": "medium", + "approval_required": true, + "status": "approval_required", + "next_safe_step": "只輸出 action proposal + no-op result,不改任何 production target。" + }, + { + "checkpoint_id": "nemotron_readback_fixture", + "display_name": "批准 NemoTron readback fixture", + "owner_agent": "nemotron", + "risk_tier": "high", + "approval_required": true, + "status": "blocked_by_runtime_gate", + "next_safe_step": "先完成 canonical target 清單與 fixture replay,不跑 live verifier。" + }, + { + "checkpoint_id": "medium_low_auto_no_write", + "display_name": "批准中低風險 no-write worker 草案", + "owner_agent": "openclaw", + "risk_tier": "high", + "approval_required": true, + "status": "blocked_by_runtime_gate", + "next_safe_step": "建立 allow-list、idempotency key、rollback/no-op evidence 與 failure-only Telegram 草案。" + } + ], + "display_redaction_contract": { + "redaction_required": true, + "raw_report_payload_display_allowed": false, + "raw_telegram_payload_display_allowed": false, + "private_reasoning_display_allowed": false, + "secret_value_display_allowed": false, + "work_window_transcript_display_allowed": false, + "allowed_display_fields": [ + "dry-run artifact summary", + "redacted queue draft metadata", + "readback verifier case status", + "Agent responsibility", + "operator checkpoint status", + "live zero counts" + ], + "blocked_display_fields": [ + "工作視窗對話內容", + "chain of thought", + "raw Telegram payload", + "chat_id / message_id raw value", + "authorization header", + "secret value" + ] + }, + "rollups": { + "dry_run_artifact_count": 5, + "gateway_queue_draft_count": 3, + "readback_verifier_case_count": 4, + "agent_role_count": 3, + "operator_checkpoint_count": 6, + "approval_required_checkpoint_ids": [ + "gateway_queue_preview", + "medium_low_auto_no_write", + "nemotron_readback_fixture", + "openclaw_post_report_noop", + "receipt_redaction_schema" + ], + "live_report_delivery_count": 0, + "telegram_gateway_queue_write_count": 0, + "telegram_bot_api_call_count": 0, + "delivery_receipt_write_count": 0, + "ai_runtime_worker_run_count": 0, + "medium_low_auto_execution_count": 0, + "post_action_verifier_live_readback_count": 0, + "production_write_count": 0 + } +} diff --git a/docs/schemas/ai_agent_report_runtime_dry_run_v1.schema.json b/docs/schemas/ai_agent_report_runtime_dry_run_v1.schema.json new file mode 100644 index 000000000..2fd87bf25 --- /dev/null +++ b/docs/schemas/ai_agent_report_runtime_dry_run_v1.schema.json @@ -0,0 +1,325 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://awoooi.wooo.work/schemas/ai_agent_report_runtime_dry_run_v1.schema.json", + "title": "AI Agent Report Runtime Dry Run v1", + "type": "object", + "required": [ + "schema_version", + "generated_at", + "program_status", + "source_refs", + "dry_run_truth", + "dry_run_artifacts", + "telegram_gateway_queue_drafts", + "readback_verifier_cases", + "agent_dry_run_roles", + "operator_checkpoints", + "display_redaction_contract", + "rollups" + ], + "properties": { + "schema_version": { "const": "ai_agent_report_runtime_dry_run_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": { "const": "P2-403M" }, + "next_task_id": { "type": "string" }, + "read_only_mode": { "const": true }, + "runtime_authority": { "const": "report_runtime_no_write_dry_run_only_no_gateway_write_or_delivery" }, + "status_note": { "type": "string" } + }, + "additionalProperties": false + }, + "source_refs": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, + "dry_run_truth": { + "type": "object", + "required": [ + "no_write_dry_run_package_ready", + "report_snapshot_dry_run_ready", + "telegram_gateway_queue_draft_ready", + "readback_verifier_plan_ready", + "failure_only_telegram_draft_ready", + "production_delivery_enabled", + "telegram_gateway_queue_write_enabled", + "telegram_bot_api_call_enabled", + "delivery_receipt_write_enabled", + "ai_runtime_worker_enabled", + "medium_low_auto_worker_enabled", + "post_action_verifier_live_readback_enabled", + "production_write_enabled", + "secret_value_read_enabled", + "work_window_transcript_display_allowed", + "live_report_delivery_count_24h", + "telegram_gateway_queue_write_count_24h", + "telegram_bot_api_call_count_24h", + "delivery_receipt_write_count_24h", + "ai_runtime_worker_run_count_24h", + "medium_low_auto_execution_count_24h", + "post_action_verifier_live_readback_count_24h", + "production_write_count_24h", + "truth_note" + ], + "properties": { + "no_write_dry_run_package_ready": { "const": true }, + "report_snapshot_dry_run_ready": { "const": true }, + "telegram_gateway_queue_draft_ready": { "const": true }, + "readback_verifier_plan_ready": { "const": true }, + "failure_only_telegram_draft_ready": { "const": true }, + "production_delivery_enabled": { "const": false }, + "telegram_gateway_queue_write_enabled": { "const": false }, + "telegram_bot_api_call_enabled": { "const": false }, + "delivery_receipt_write_enabled": { "const": false }, + "ai_runtime_worker_enabled": { "const": false }, + "medium_low_auto_worker_enabled": { "const": false }, + "post_action_verifier_live_readback_enabled": { "const": false }, + "production_write_enabled": { "const": false }, + "secret_value_read_enabled": { "const": false }, + "work_window_transcript_display_allowed": { "const": false }, + "live_report_delivery_count_24h": { "const": 0 }, + "telegram_gateway_queue_write_count_24h": { "const": 0 }, + "telegram_bot_api_call_count_24h": { "const": 0 }, + "delivery_receipt_write_count_24h": { "const": 0 }, + "ai_runtime_worker_run_count_24h": { "const": 0 }, + "medium_low_auto_execution_count_24h": { "const": 0 }, + "post_action_verifier_live_readback_count_24h": { "const": 0 }, + "production_write_count_24h": { "const": 0 }, + "truth_note": { "type": "string" } + }, + "additionalProperties": false + }, + "dry_run_artifacts": { + "type": "array", + "minItems": 5, + "items": { + "type": "object", + "required": [ + "artifact_id", + "display_name", + "owner_agent", + "mode", + "status", + "evidence_ref", + "hash_strategy", + "writes_production", + "contains_secret", + "blocked_until" + ], + "properties": { + "artifact_id": { + "enum": [ + "report_run_snapshot_preview", + "telegram_digest_payload_preview", + "ai_post_report_analysis_packet", + "medium_low_auto_noop_plan", + "post_action_verifier_readback_plan" + ] + }, + "display_name": { "type": "string" }, + "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] }, + "mode": { "const": "repo_only_no_write" }, + "status": { "enum": ["ready_for_local_smoke", "ready_for_owner_review", "approval_required", "blocked_by_runtime_gate"] }, + "evidence_ref": { "type": "string" }, + "hash_strategy": { "type": "string" }, + "writes_production": { "const": false }, + "contains_secret": { "const": false }, + "blocked_until": { "type": "string" } + }, + "additionalProperties": false + } + }, + "telegram_gateway_queue_drafts": { + "type": "array", + "minItems": 3, + "items": { + "type": "object", + "required": [ + "draft_id", + "display_name", + "recipient_room", + "secret_ref", + "cadence", + "noise_budget", + "gateway_queue_write_enabled", + "telegram_send_enabled", + "direct_bot_api_allowed", + "payload_contains_secret", + "redaction_policy" + ], + "properties": { + "draft_id": { "enum": ["daily_report_digest", "weekly_report_digest", "monthly_report_digest"] }, + "display_name": { "type": "string" }, + "recipient_room": { "const": "AwoooI SRE 戰情室" }, + "secret_ref": { "const": "SRE_GROUP_CHAT_ID" }, + "cadence": { "enum": ["daily", "weekly", "monthly"] }, + "noise_budget": { "type": "string" }, + "gateway_queue_write_enabled": { "const": false }, + "telegram_send_enabled": { "const": false }, + "direct_bot_api_allowed": { "const": false }, + "payload_contains_secret": { "const": false }, + "redaction_policy": { "type": "string" } + }, + "additionalProperties": false + } + }, + "readback_verifier_cases": { + "type": "array", + "minItems": 4, + "items": { + "type": "object", + "required": [ + "case_id", + "display_name", + "owner_agent", + "readback_surface", + "expected_signal", + "live_readback_enabled", + "writes_result", + "requires_secret_value", + "blocked_until" + ], + "properties": { + "case_id": { + "enum": [ + "report_snapshot_readback", + "gateway_queue_preview_readback", + "receipt_redaction_readback", + "medium_low_noop_readback" + ] + }, + "display_name": { "type": "string" }, + "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] }, + "readback_surface": { "type": "string" }, + "expected_signal": { "type": "string" }, + "live_readback_enabled": { "const": false }, + "writes_result": { "const": false }, + "requires_secret_value": { "const": false }, + "blocked_until": { "type": "string" } + }, + "additionalProperties": false + } + }, + "agent_dry_run_roles": { + "type": "array", + "minItems": 3, + "items": { + "type": "object", + "required": [ + "agent_id", + "display_name", + "dry_run_responsibility", + "allowed_now", + "blocked_now", + "live_action_count_24h" + ], + "properties": { + "agent_id": { "enum": ["openclaw", "hermes", "nemotron"] }, + "display_name": { "type": "string" }, + "dry_run_responsibility": { "type": "string" }, + "allowed_now": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, + "blocked_now": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, + "live_action_count_24h": { "const": 0 } + }, + "additionalProperties": false + } + }, + "operator_checkpoints": { + "type": "array", + "minItems": 6, + "items": { + "type": "object", + "required": [ + "checkpoint_id", + "display_name", + "owner_agent", + "risk_tier", + "approval_required", + "status", + "next_safe_step" + ], + "properties": { + "checkpoint_id": { "type": "string" }, + "display_name": { "type": "string" }, + "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] }, + "risk_tier": { "enum": ["low", "medium", "high", "critical"] }, + "approval_required": { "type": "boolean" }, + "status": { "enum": ["ready_for_review", "approval_required", "blocked_by_runtime_gate"] }, + "next_safe_step": { "type": "string" } + }, + "additionalProperties": false + } + }, + "display_redaction_contract": { + "type": "object", + "required": [ + "redaction_required", + "raw_report_payload_display_allowed", + "raw_telegram_payload_display_allowed", + "private_reasoning_display_allowed", + "secret_value_display_allowed", + "work_window_transcript_display_allowed", + "allowed_display_fields", + "blocked_display_fields" + ], + "properties": { + "redaction_required": { "const": true }, + "raw_report_payload_display_allowed": { "const": false }, + "raw_telegram_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_display_fields": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, + "blocked_display_fields": { "type": "array", "items": { "type": "string" }, "minItems": 1 } + }, + "additionalProperties": false + }, + "rollups": { + "type": "object", + "required": [ + "dry_run_artifact_count", + "gateway_queue_draft_count", + "readback_verifier_case_count", + "agent_role_count", + "operator_checkpoint_count", + "approval_required_checkpoint_ids", + "live_report_delivery_count", + "telegram_gateway_queue_write_count", + "telegram_bot_api_call_count", + "delivery_receipt_write_count", + "ai_runtime_worker_run_count", + "medium_low_auto_execution_count", + "post_action_verifier_live_readback_count", + "production_write_count" + ], + "properties": { + "dry_run_artifact_count": { "type": "integer", "minimum": 0 }, + "gateway_queue_draft_count": { "type": "integer", "minimum": 0 }, + "readback_verifier_case_count": { "type": "integer", "minimum": 0 }, + "agent_role_count": { "type": "integer", "minimum": 0 }, + "operator_checkpoint_count": { "type": "integer", "minimum": 0 }, + "approval_required_checkpoint_ids": { "type": "array", "items": { "type": "string" } }, + "live_report_delivery_count": { "const": 0 }, + "telegram_gateway_queue_write_count": { "const": 0 }, + "telegram_bot_api_call_count": { "const": 0 }, + "delivery_receipt_write_count": { "const": 0 }, + "ai_runtime_worker_run_count": { "const": 0 }, + "medium_low_auto_execution_count": { "const": 0 }, + "post_action_verifier_live_readback_count": { "const": 0 }, + "production_write_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 30c2b7d5e..ae16adbe7 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,8 @@ 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 / P2-403J / P2-403L 互動、接手、學習、成長、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 工作量、圖表化報告、風險自動化政策與報表 runtime readiness 證據面;目前 live session、message、handoff、learning write、Gateway queue、Telegram send、report delivery、auto optimization、verifier execution 全部 `0`,下一步 P2-403M | +| `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 / P2-403L 互動、接手、學習、成長、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 工作量、圖表化報告、風險自動化政策與報表 runtime readiness 證據面;目前 live session、message、handoff、learning write、Gateway queue、Telegram send、report delivery、auto optimization、verifier execution 全部 `0`,由 P2-403M dry-run package 承接下一步 | +| `docs/evaluations/ai_agent_report_runtime_dry_run_2026-06-12.json` + `GET /api/v1/agents/agent-report-runtime-dry-run` | P2-403M 報表 runtime no-write dry-run 證據包;建立 5 個 dry-run artifact、3 個 SRE 戰情室 queue digest 草案、4 個 readback verifier case、3 個 Agent dry-run role 與 6 個 operator checkpoint;不寫 Gateway queue、不送 Telegram、不呼叫 Bot API、不寫 delivery receipt、不啟動 worker、不跑 verifier live readback、不讀 secret,下一步 P2-403N | | `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 主動營運委派與版本生命週期契約 @@ -720,7 +721,8 @@ Repo / registry / release notes / K8s / host / observability / backup evidence 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`。 17. 建立報表真相、日報、週報、月報、Agent 工作量、圖表化報告、AI 分析建議與高 / 中 / 低風險自動化 policy review。✅ P2-403J 已完成;report delivery、Telegram queue、AI analysis runtime、中低風險 auto worker、生產優化與 route change 仍為 `0 / false`。 -18. 建立報表派送、Telegram Gateway queue、讀報回執、AI 讀報後分析、中低風險自動處理、高風險審核與 post-action verifier 啟動前閘門。✅ P2-403L 已完成;live delivery、Gateway queue write、AI runtime worker、中低風險 auto worker、高風險自動執行與 production optimization 仍為 `0 / false`。下一步 P2-403M no-write dry-run / SRE 戰情室 Gateway queue 草案 / readback verifier。 +18. 建立報表派送、Telegram Gateway queue、讀報回執、AI 讀報後分析、中低風險自動處理、高風險審核與 post-action verifier 啟動前閘門。✅ P2-403L 已完成;live delivery、Gateway queue write、AI runtime worker、中低風險 auto worker、高風險自動執行與 production optimization 仍為 `0 / false`。 +19. 建立報表 runtime no-write dry-run、SRE 戰情室 Gateway queue 草案與 readback verifier 草案。✅ P2-403M 已完成;Gateway queue write、Telegram send、Bot API、delivery receipt、AI runtime worker、中低風險 auto worker、verifier live readback、production write 與 secret value read 仍為 `0 / false`。下一步 P2-403N fixture smoke / queue preview readback / verifier dry-run。 #### 3.2.1d 2026-06-11 Agent 互動、學習與成長證據面 @@ -747,6 +749,7 @@ Repo / registry / release notes / K8s / host / observability / backup evidence | `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 | | `docs/evaluations/ai_agent_report_runtime_readiness_2026-06-12.json` + `GET /api/v1/agents/agent-report-runtime-readiness` | P2-403L 報表派送、Telegram Gateway queue、讀報回執、AI 讀報後分析、中低風險自動處理、高風險審核與 post-action verifier 啟動前閘門;不排程實發、不寫 Gateway queue、不啟動 runtime worker、不執行生產優化 | +| `docs/evaluations/ai_agent_report_runtime_dry_run_2026-06-12.json` + `GET /api/v1/agents/agent-report-runtime-dry-run` | P2-403M 報表 runtime no-write dry-run 證據包;5 個 dry-run artifact、3 個 queue digest 草案、4 個 readback verifier case、3 個 Agent dry-run role、6 個 operator checkpoint;不寫 Gateway queue、不送 Telegram、不呼叫 Bot API、不寫 delivery receipt、不啟動 worker、不跑 verifier live readback | | `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 仍需批准 | @@ -1886,6 +1889,13 @@ Phase 6 完成後 - 政策裁決:低 / 中風險可在 guard、dry-run、post-action verifier、rollback/no-op evidence 與 failure-only Telegram 草案都通過後自動處理;高 / 關鍵風險仍必須統帥或 owner 審核。 - 本波仍不排程實發報告、不寫 Telegram Gateway queue、不呼叫 Bot API、不啟動 AI runtime worker、不啟動中低風險 auto worker、不執行生產優化、不讀 secret、不回傳工作視窗對話內容;下一步 P2-403M 才進 no-write dry-run / SRE 戰情室 Gateway queue 草案 / readback verifier。 +### 2026-06-12 11:55 (台北) — §3.2 / §5 — 完成 P2-403M 報表 runtime no-write dry-run 證據包 — 把 queue / verifier 草案固定成可審核證據 + +- 新增 `ai_agent_report_runtime_dry_run_v1` schema / committed snapshot / loader / API / 測試,定義 report_run snapshot preview、Telegram digest payload preview、AI post-report analysis packet、中低風險 no-op plan、post-action verifier readback plan。 +- `apps/web/src/app/[locale]/governance/tabs/automation-inventory-tab.tsx` 接入 `GET /api/v1/agents/agent-report-runtime-dry-run`,治理頁顯示 5 個 dry-run artifact、3 個 SRE 戰情室 queue digest 草案、4 個 readback verifier case、OpenClaw / Hermes / NemoTron dry-run 分工與 6 個 operator checkpoint。 +- 政策裁決:P2-403M 只允許 repo-only no-write dry-run、redacted queue preview 與 fixture-only readback planning;任何 Gateway queue write、Telegram send、Bot API、delivery receipt、AI runtime worker、中低風險 auto worker、verifier live readback、production write 或 secret value read 都仍為 `0 / false`。 +- 本波仍不送 Telegram、不寫 Gateway queue、不呼叫 Bot API、不寫 delivery receipt、不啟動 runtime worker、不跑 verifier live readback、不讀 secret、不回傳工作視窗對話內容;下一步 P2-403N 才進 fixture smoke / queue preview readback / verifier dry-run。 + ### 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。