{
  "schema_version": "ai_agent_telegram_receipt_approval_package_v1",
  "generated_at": "2026-06-11T23:59:50+08:00",
  "program_status": {
    "overall_completion_percent": 80,
    "current_priority": "P2",
    "current_task_id": "P2-403E",
    "next_task_id": "P2-403F",
    "read_only_mode": true,
    "runtime_authority": "approval_package_only_no_telegram_send",
    "status_note": "P2-403E 已把 Telegram receipt、queue、delivery、ack、failure 與 retry 的批准包固定為只讀契約；尚未發送 Telegram、未寫 Gateway queue、未啟動 receipt worker。"
  },
  "source_refs": [
    "docs/evaluations/ai_agent_learning_writeback_approval_package_2026-06-11.json",
    "docs/evaluations/ai_agent_telegram_action_required_digest_policy_2026-06-11.json",
    "docs/superpowers/specs/2026-04-15-MASTER-ai-autonomous-flywheel-v2.md"
  ],
  "telegram_truth": {
    "telegram_send_allowed": false,
    "gateway_queue_write_allowed": false,
    "direct_bot_api_allowed": false,
    "receiver_route_change_allowed": false,
    "runtime_worker_allowed": false,
    "live_queued_receipt_count": 0,
    "live_delivered_receipt_count": 0,
    "live_acknowledged_receipt_count": 0,
    "live_failed_receipt_count": 0,
    "live_retry_count": 0,
    "truth_note": "目前只允許產生 Telegram receipt 批准包與前台只讀證據；所有 queue write、send、ack、retry 與 receiver route 變更仍為 0 / false。"
  },
  "receipt_package": {
    "required_fields": [
      "receipt_event_id",
      "incident_id",
      "source_stage",
      "channel_policy",
      "target_channel_alias",
      "message_template_id",
      "redacted_message_summary",
      "delivery_correlation_id",
      "retry_policy_ref",
      "failure_fallback_ref",
      "owner_review_required",
      "created_at"
    ],
    "forbidden_fields": [
      "telegram_bot_token",
      "telegram_chat_id_raw",
      "authorization_header",
      "secret_value",
      "raw_message_payload",
      "conversation_transcript",
      "private_reasoning",
      "raw_tool_output"
    ],
    "owner_review_required": true,
    "retry_policy_required": true,
    "delivery_receipt_required": true,
    "operator_meaning": "每個 Telegram receipt 候選都必須說清楚來源事件、要送到哪個 channel alias、使用哪個模板、如何關聯 delivery receipt、失敗怎麼補償；批准前不得寫 Gateway queue 或直接呼叫 Bot API。"
  },
  "receipt_gates": [
    {
      "gate_id": "gateway_queue_owner_gate",
      "display_name": "Gateway queue owner gate",
      "owner_agent": "openclaw",
      "status": "approval_required",
      "required_evidence": "channel policy、message template、delivery correlation id、redacted summary、owner reviewer。",
      "blocked_runtime_action": "telegram_gateway_queue_write"
    },
    {
      "gate_id": "delivery_receipt_gate",
      "display_name": "Delivery receipt gate",
      "owner_agent": "hermes",
      "status": "approval_required",
      "required_evidence": "queued / sent / delivered / acknowledged 狀態 schema、failure fallback 與 replay ref。",
      "blocked_runtime_action": "telegram_delivery_receipt_write"
    },
    {
      "gate_id": "retry_failure_gate",
      "display_name": "Retry / failure compensation gate",
      "owner_agent": "openclaw",
      "status": "approval_required",
      "required_evidence": "retry policy、dead-letter threshold、AwoooP fallback、no-success-spam proof。",
      "blocked_runtime_action": "telegram_retry_worker_start"
    },
    {
      "gate_id": "direct_bot_api_gate",
      "display_name": "Direct Bot API ban gate",
      "owner_agent": "hermes",
      "status": "contract_ready",
      "required_evidence": "direct Bot API caller 必須維持 blocked；所有通知只能走 Gateway contract。",
      "blocked_runtime_action": "telegram_direct_bot_api_call"
    }
  ],
  "receipt_lanes": [
    {
      "lane_id": "action_required_receipt",
      "display_name": "Action-required receipt",
      "target_surface": "telegram_gateway_queue",
      "status": "approval_required",
      "owner_agent": "openclaw",
      "review_owner": "sre_owner",
      "required_review": "owner 必須確認中高風險 action-required 訊息模板、去重、delivery correlation 與 fallback。"
    },
    {
      "lane_id": "approval_decision_receipt",
      "display_name": "Approval decision receipt",
      "target_surface": "awooop_operator_console",
      "status": "approval_required",
      "owner_agent": "hermes",
      "review_owner": "operator_owner",
      "required_review": "owner 必須確認批准 / 拒絕 / no-action 結果能回到 AwoooP timeline，Telegram 只保留摘要。"
    },
    {
      "lane_id": "failure_only_digest_receipt",
      "display_name": "Failure-only digest receipt",
      "target_surface": "telegram_failure_digest",
      "status": "blocked_by_runtime_gate",
      "owner_agent": "openclaw",
      "review_owner": "sre_owner",
      "required_review": "owner 必須確認成功不洗版、失敗才通知、dead-letter 可回查、retry 不重複轟炸。"
    }
  ],
  "retry_contract": {
    "retry_required": true,
    "retry_steps": [
      "每筆 receipt 必須有 delivery_correlation_id",
      "queued / delivered / acknowledged / failed 狀態必須可回查",
      "retry 必須受 dedupe key 與 dead-letter threshold 控制",
      "成功 smoke 不即時通知，避免 Telegram 洗版",
      "failure fallback 必須回寫 AwoooP timeline 的 receipt_failed 事件"
    ]
  },
  "approval_boundaries": {
    "telegram_send_allowed": false,
    "gateway_queue_write_allowed": false,
    "direct_bot_api_allowed": false,
    "receiver_route_change_allowed": false,
    "runtime_worker_allowed": false,
    "secret_plaintext_allowed": false,
    "success_spam_allowed": false
  },
  "display_redaction_contract": {
    "redaction_required": true,
    "raw_payload_display_allowed": false,
    "private_reasoning_display_allowed": false,
    "secret_value_display_allowed": false,
    "allowed_frontend_content": [
      "receipt lane",
      "target surface",
      "owner review status",
      "required evidence",
      "blocked runtime action",
      "retry requirement"
    ],
    "forbidden_frontend_content": [
      "Telegram token",
      "raw chat id",
      "authorization header",
      "未脫敏 message payload",
      "未核准內部細節",
      "raw tool output"
    ],
    "frontend_display_policy": "治理頁只顯示 receipt lane、目標 surface、owner review、阻擋 runtime action 與 retry 要求；Telegram token、raw chat id、authorization header、未脫敏 payload、未核准內部細節與 raw tool output 不進前端。"
  },
  "rollups": {
    "receipt_gate_count": 4,
    "receipt_lane_count": 3,
    "approval_required_gate_ids": [
      "gateway_queue_owner_gate",
      "delivery_receipt_gate",
      "retry_failure_gate"
    ],
    "blocked_runtime_action_count": 4,
    "required_field_count": 12,
    "forbidden_field_count": 8,
    "live_receipt_count_total": 0
  }
}
