{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://awoooi.wooo.work/schemas/ai_agent_report_live_delivery_approval_package_v1.schema.json",
  "title": "AI Agent Report Live Delivery Approval Package v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "generated_at",
    "program_status",
    "source_refs",
    "prior_report_status_board",
    "prior_runtime_review",
    "delivery_approval_truth",
    "delivery_approval_packets",
    "route_lock_gates",
    "payload_redaction_checks",
    "dry_run_delivery_receipts",
    "operator_actions",
    "display_redaction_contract",
    "rollups"
  ],
  "properties": {
    "schema_version": {
      "const": "ai_agent_report_live_delivery_approval_package_v1"
    },
    "generated_at": {
      "type": "string",
      "minLength": 1
    },
    "program_status": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "overall_completion_percent",
        "current_priority",
        "current_task_id",
        "next_task_id",
        "read_only_mode",
        "runtime_authority",
        "status_note"
      ],
      "properties": {
        "overall_completion_percent": {
          "const": 100
        },
        "current_priority": {
          "const": "P2"
        },
        "current_task_id": {
          "const": "P2-111"
        },
        "next_task_id": {
          "const": "P2-112"
        },
        "read_only_mode": {
          "const": true
        },
        "runtime_authority": {
          "const": "report_live_delivery_approval_package_only_no_live_send_or_write"
        },
        "status_note": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "source_refs": {
      "$ref": "#/$defs/string_array"
    },
    "prior_report_status_board": {
      "$ref": "#/$defs/prior_report_status_board"
    },
    "prior_runtime_review": {
      "$ref": "#/$defs/prior_runtime_review"
    },
    "delivery_approval_truth": {
      "$ref": "#/$defs/delivery_approval_truth"
    },
    "delivery_approval_packets": {
      "type": "array",
      "minItems": 5,
      "items": {
        "$ref": "#/$defs/delivery_approval_packet"
      }
    },
    "route_lock_gates": {
      "type": "array",
      "minItems": 4,
      "items": {
        "$ref": "#/$defs/route_lock_gate"
      }
    },
    "payload_redaction_checks": {
      "type": "array",
      "minItems": 5,
      "items": {
        "$ref": "#/$defs/payload_redaction_check"
      }
    },
    "dry_run_delivery_receipts": {
      "type": "array",
      "minItems": 4,
      "items": {
        "$ref": "#/$defs/dry_run_delivery_receipt"
      }
    },
    "operator_actions": {
      "type": "array",
      "minItems": 5,
      "items": {
        "$ref": "#/$defs/operator_action"
      }
    },
    "display_redaction_contract": {
      "$ref": "#/$defs/display_redaction_contract"
    },
    "rollups": {
      "$ref": "#/$defs/rollups"
    }
  },
  "$defs": {
    "string_array": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "redacted_sha256": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "owner_agent": {
      "enum": [
        "openclaw",
        "hermes",
        "nemotron"
      ]
    },
    "cadence": {
      "enum": [
        "daily",
        "weekly",
        "monthly",
        "failure_only",
        "receipt"
      ]
    },
    "prior_report_status_board": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "source_schema_version",
        "readback_at",
        "report_card_count",
        "agent_status_report_count",
        "visible_chart_count",
        "operator_answer_count",
        "work_units_total",
        "work_units_done",
        "work_units_waiting_approval",
        "live_delivery_count",
        "live_telegram_send_count_24h",
        "live_auto_optimization_count_24h",
        "readiness_note"
      ],
      "properties": {
        "source_schema_version": {
          "const": "ai_agent_report_status_board_v1"
        },
        "readback_at": {
          "type": "string",
          "minLength": 1
        },
        "report_card_count": {
          "const": 3
        },
        "agent_status_report_count": {
          "const": 3
        },
        "visible_chart_count": {
          "const": 3
        },
        "operator_answer_count": {
          "const": 4
        },
        "work_units_total": {
          "const": 91
        },
        "work_units_done": {
          "const": 79
        },
        "work_units_waiting_approval": {
          "const": 12
        },
        "live_delivery_count": {
          "const": 0
        },
        "live_telegram_send_count_24h": {
          "const": 0
        },
        "live_auto_optimization_count_24h": {
          "const": 0
        },
        "readiness_note": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "prior_runtime_review": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "approval_package_schema_version",
        "implementation_review_schema_version",
        "telegram_failure_receipt_gate_count",
        "implementation_blocker_count",
        "no_write_verifier_check_count",
        "owner_approval_received_count",
        "runtime_readback_execution_count",
        "live_query_count",
        "telegram_failure_receipt_send_count",
        "bot_api_call_count",
        "gateway_queue_write_count",
        "production_write_count",
        "readiness_note"
      ],
      "properties": {
        "approval_package_schema_version": {
          "const": "ai_agent_runtime_readback_approval_package_v1"
        },
        "implementation_review_schema_version": {
          "const": "ai_agent_runtime_readback_implementation_review_v1"
        },
        "telegram_failure_receipt_gate_count": {
          "const": 4
        },
        "implementation_blocker_count": {
          "const": 5
        },
        "no_write_verifier_check_count": {
          "const": 5
        },
        "owner_approval_received_count": {
          "const": 0
        },
        "runtime_readback_execution_count": {
          "const": 0
        },
        "live_query_count": {
          "const": 0
        },
        "telegram_failure_receipt_send_count": {
          "const": 0
        },
        "bot_api_call_count": {
          "const": 0
        },
        "gateway_queue_write_count": {
          "const": 0
        },
        "production_write_count": {
          "const": 0
        },
        "readiness_note": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "delivery_approval_truth": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "p2_108_report_status_loaded",
        "p2_109_failure_receipt_gate_loaded",
        "p2_110_implementation_review_loaded",
        "delivery_approval_package_ready",
        "daily_delivery_package_ready",
        "weekly_delivery_package_ready",
        "monthly_delivery_package_ready",
        "sre_war_room_route_locked",
        "payload_redaction_ready",
        "dry_run_receipt_ready",
        "owner_review_required_before_delivery",
        "scheduler_enabled",
        "gateway_queue_write_enabled",
        "telegram_send_enabled",
        "bot_api_call_enabled",
        "report_receipt_write_enabled",
        "ai_analysis_run_enabled",
        "medium_low_auto_optimization_enabled",
        "production_write_enabled",
        "secret_read_enabled",
        "destructive_operation_enabled",
        "owner_approval_received_count",
        "scheduled_delivery_count_24h",
        "gateway_queue_write_count_24h",
        "telegram_send_count_24h",
        "bot_api_call_count_24h",
        "report_receipt_write_count_24h",
        "ai_analysis_run_count_24h",
        "auto_optimization_count_24h",
        "production_write_count_24h",
        "secret_read_count_24h",
        "destructive_operation_count_24h",
        "truth_note"
      ],
      "properties": {
        "p2_108_report_status_loaded": {
          "const": true
        },
        "p2_109_failure_receipt_gate_loaded": {
          "const": true
        },
        "p2_110_implementation_review_loaded": {
          "const": true
        },
        "delivery_approval_package_ready": {
          "const": true
        },
        "daily_delivery_package_ready": {
          "const": true
        },
        "weekly_delivery_package_ready": {
          "const": true
        },
        "monthly_delivery_package_ready": {
          "const": true
        },
        "sre_war_room_route_locked": {
          "const": true
        },
        "payload_redaction_ready": {
          "const": true
        },
        "dry_run_receipt_ready": {
          "const": true
        },
        "owner_review_required_before_delivery": {
          "const": true
        },
        "scheduler_enabled": {
          "const": false
        },
        "gateway_queue_write_enabled": {
          "const": false
        },
        "telegram_send_enabled": {
          "const": false
        },
        "bot_api_call_enabled": {
          "const": false
        },
        "report_receipt_write_enabled": {
          "const": false
        },
        "ai_analysis_run_enabled": {
          "const": false
        },
        "medium_low_auto_optimization_enabled": {
          "const": false
        },
        "production_write_enabled": {
          "const": false
        },
        "secret_read_enabled": {
          "const": false
        },
        "destructive_operation_enabled": {
          "const": false
        },
        "owner_approval_received_count": {
          "const": 0
        },
        "scheduled_delivery_count_24h": {
          "const": 0
        },
        "gateway_queue_write_count_24h": {
          "const": 0
        },
        "telegram_send_count_24h": {
          "const": 0
        },
        "bot_api_call_count_24h": {
          "const": 0
        },
        "report_receipt_write_count_24h": {
          "const": 0
        },
        "ai_analysis_run_count_24h": {
          "const": 0
        },
        "auto_optimization_count_24h": {
          "const": 0
        },
        "production_write_count_24h": {
          "const": 0
        },
        "secret_read_count_24h": {
          "const": 0
        },
        "destructive_operation_count_24h": {
          "const": 0
        },
        "truth_note": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "delivery_approval_packet": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "packet_id",
        "display_name",
        "cadence",
        "owner_agent",
        "status",
        "risk_tier",
        "required_approval_fields",
        "blocked_runtime_actions",
        "operator_guidance",
        "approval_required",
        "no_send_mode",
        "evidence_hash"
      ],
      "properties": {
        "packet_id": {
          "type": "string",
          "minLength": 1
        },
        "display_name": {
          "type": "string",
          "minLength": 1
        },
        "cadence": {
          "$ref": "#/$defs/cadence"
        },
        "owner_agent": {
          "$ref": "#/$defs/owner_agent"
        },
        "status": {
          "enum": [
            "approval_required",
            "ready_for_owner_review",
            "blocked_by_policy"
          ]
        },
        "risk_tier": {
          "enum": [
            "medium",
            "high",
            "critical"
          ]
        },
        "required_approval_fields": {
          "$ref": "#/$defs/string_array"
        },
        "blocked_runtime_actions": {
          "$ref": "#/$defs/string_array"
        },
        "operator_guidance": {
          "type": "string",
          "minLength": 1
        },
        "approval_required": {
          "const": true
        },
        "no_send_mode": {
          "const": true
        },
        "evidence_hash": {
          "$ref": "#/$defs/redacted_sha256"
        }
      }
    },
    "route_lock_gate": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "gate_id",
        "display_name",
        "status",
        "required_evidence",
        "blocked_routes",
        "telegram_send_enabled",
        "bot_api_call_enabled",
        "gateway_queue_write_enabled",
        "evidence_hash"
      ],
      "properties": {
        "gate_id": {
          "type": "string",
          "minLength": 1
        },
        "display_name": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "enum": [
            "ready_for_owner_review",
            "approval_required",
            "blocked_by_policy"
          ]
        },
        "required_evidence": {
          "$ref": "#/$defs/string_array"
        },
        "blocked_routes": {
          "$ref": "#/$defs/string_array"
        },
        "telegram_send_enabled": {
          "const": false
        },
        "bot_api_call_enabled": {
          "const": false
        },
        "gateway_queue_write_enabled": {
          "const": false
        },
        "evidence_hash": {
          "$ref": "#/$defs/redacted_sha256"
        }
      }
    },
    "payload_redaction_check": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "check_id",
        "display_name",
        "status",
        "required_rule",
        "failure_if_missing",
        "display_allowed",
        "evidence_hash"
      ],
      "properties": {
        "check_id": {
          "type": "string",
          "minLength": 1
        },
        "display_name": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "enum": [
            "ready",
            "blocked_by_policy"
          ]
        },
        "required_rule": {
          "type": "string",
          "minLength": 1
        },
        "failure_if_missing": {
          "type": "string",
          "minLength": 1
        },
        "display_allowed": {
          "const": false
        },
        "evidence_hash": {
          "$ref": "#/$defs/redacted_sha256"
        }
      }
    },
    "dry_run_delivery_receipt": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "receipt_id",
        "display_name",
        "cadence",
        "status",
        "required_fields",
        "live_send_count",
        "receipt_write_allowed",
        "evidence_hash"
      ],
      "properties": {
        "receipt_id": {
          "type": "string",
          "minLength": 1
        },
        "display_name": {
          "type": "string",
          "minLength": 1
        },
        "cadence": {
          "$ref": "#/$defs/cadence"
        },
        "status": {
          "enum": [
            "ready_for_owner_review",
            "blocked_by_policy"
          ]
        },
        "required_fields": {
          "$ref": "#/$defs/string_array"
        },
        "live_send_count": {
          "const": 0
        },
        "receipt_write_allowed": {
          "const": false
        },
        "evidence_hash": {
          "$ref": "#/$defs/redacted_sha256"
        }
      }
    },
    "operator_action": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "action_id",
        "action_type",
        "display_name",
        "owner_agent",
        "operator_instruction",
        "live_send_allowed"
      ],
      "properties": {
        "action_id": {
          "type": "string",
          "minLength": 1
        },
        "action_type": {
          "enum": [
            "review_delivery_packet",
            "validate_sre_route",
            "validate_payload_redaction",
            "validate_zero_send_counters",
            "reject_or_promote"
          ]
        },
        "display_name": {
          "type": "string",
          "minLength": 1
        },
        "owner_agent": {
          "$ref": "#/$defs/owner_agent"
        },
        "operator_instruction": {
          "type": "string",
          "minLength": 1
        },
        "live_send_allowed": {
          "const": false
        }
      }
    },
    "display_redaction_contract": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "redaction_required",
        "frontend_display_policy",
        "raw_prompt_display_allowed",
        "private_reasoning_display_allowed",
        "secret_value_display_allowed",
        "raw_telegram_payload_display_allowed",
        "internal_collaboration_content_display_allowed"
      ],
      "properties": {
        "redaction_required": {
          "const": true
        },
        "frontend_display_policy": {
          "type": "string",
          "minLength": 1
        },
        "raw_prompt_display_allowed": {
          "const": false
        },
        "private_reasoning_display_allowed": {
          "const": false
        },
        "secret_value_display_allowed": {
          "const": false
        },
        "raw_telegram_payload_display_allowed": {
          "const": false
        },
        "internal_collaboration_content_display_allowed": {
          "const": false
        }
      }
    },
    "rollups": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "delivery_approval_packet_count",
        "route_lock_gate_count",
        "payload_redaction_check_count",
        "dry_run_delivery_receipt_count",
        "operator_action_count",
        "approval_required_packet_count",
        "blocked_packet_count",
        "blocked_route_gate_count",
        "blocked_receipt_count",
        "owner_approval_received_count",
        "scheduled_delivery_count",
        "gateway_queue_write_count",
        "telegram_send_count",
        "bot_api_call_count",
        "report_receipt_write_count",
        "ai_analysis_run_count",
        "auto_optimization_count",
        "production_write_count",
        "secret_read_count",
        "destructive_operation_count"
      ],
      "properties": {
        "delivery_approval_packet_count": {
          "const": 5
        },
        "route_lock_gate_count": {
          "const": 4
        },
        "payload_redaction_check_count": {
          "const": 5
        },
        "dry_run_delivery_receipt_count": {
          "const": 4
        },
        "operator_action_count": {
          "const": 5
        },
        "approval_required_packet_count": {
          "const": 3
        },
        "blocked_packet_count": {
          "const": 1
        },
        "blocked_route_gate_count": {
          "const": 1
        },
        "blocked_receipt_count": {
          "const": 1
        },
        "owner_approval_received_count": {
          "const": 0
        },
        "scheduled_delivery_count": {
          "const": 0
        },
        "gateway_queue_write_count": {
          "const": 0
        },
        "telegram_send_count": {
          "const": 0
        },
        "bot_api_call_count": {
          "const": 0
        },
        "report_receipt_write_count": {
          "const": 0
        },
        "ai_analysis_run_count": {
          "const": 0
        },
        "auto_optimization_count": {
          "const": 0
        },
        "production_write_count": {
          "const": 0
        },
        "secret_read_count": {
          "const": 0
        },
        "destructive_operation_count": {
          "const": 0
        }
      }
    }
  }
}
