{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://awoooi.local/schemas/ai_agent_report_truth_actionability_review_v1.schema.json",
  "title": "AI Agent Report Truth Actionability Review",
  "type": "object",
  "required": [
    "schema_version",
    "generated_at",
    "program_status",
    "source_refs",
    "report_truth",
    "source_freshness_gates",
    "source_confidence_gates",
    "report_actionability_scores",
    "zero_signal_work_items",
    "zero_signal_findings",
    "report_cadence_contracts",
    "alert_actionability_lanes",
    "telegram_routing_consolidation",
    "telegram_route_findings",
    "operator_actions",
    "approval_boundaries",
    "rollups"
  ],
  "properties": {
    "schema_version": { "const": "ai_agent_report_truth_actionability_review_v1" },
    "generated_at": { "type": "string" },
    "program_status": {
      "type": "object",
      "required": ["overall_completion_percent", "current_priority", "current_task_id", "next_task_id", "read_only_mode", "runtime_authority", "status_note"],
      "properties": {
        "overall_completion_percent": { "const": 100 },
        "current_priority": { "enum": ["P0", "P1", "P2", "P3"] },
        "current_task_id": { "const": "P2-403K" },
        "next_task_id": { "const": "P2-403L" },
        "read_only_mode": { "const": true },
        "runtime_authority": { "const": "report_truth_actionability_review_only_no_report_send_or_runtime_fix" },
        "status_note": { "type": "string" }
      },
      "additionalProperties": false
    },
    "source_refs": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
    "report_truth": {
      "type": "object",
      "required": [
        "report_truth_packet_ready",
        "all_zero_weekly_report_is_actionable_anomaly",
        "daily_report_contract_present",
        "weekly_report_contract_present",
        "monthly_report_contract_present",
        "freshness_gate_implemented",
        "source_confidence_gate_implemented",
        "actionability_score_implemented",
        "ai_agent_runtime_control_allowed",
        "telegram_report_send_allowed",
        "cronjob_change_allowed",
        "truth_note"
      ],
      "properties": {
        "report_truth_packet_ready": { "const": true },
        "all_zero_weekly_report_is_actionable_anomaly": { "const": true },
        "daily_report_contract_present": { "type": "boolean" },
        "weekly_report_contract_present": { "type": "boolean" },
        "monthly_report_contract_present": { "const": false },
        "freshness_gate_implemented": { "const": true },
        "source_confidence_gate_implemented": { "const": true },
        "actionability_score_implemented": { "const": true },
        "ai_agent_runtime_control_allowed": { "const": false },
        "telegram_report_send_allowed": { "const": false },
        "cronjob_change_allowed": { "const": false },
        "truth_note": { "type": "string" }
      },
      "additionalProperties": false
    },
    "source_freshness_gates": {
      "type": "array",
      "minItems": 6,
      "items": {
        "type": "object",
        "required": ["gate_id", "display_name", "freshness_state", "last_success_at", "required_ttl", "evidence_ref", "operator_impact", "ai_next_action", "owner_agent", "work_item_required"],
        "properties": {
          "gate_id": { "type": "string" },
          "display_name": { "type": "string" },
          "freshness_state": { "type": "string" },
          "last_success_at": { "type": "string" },
          "required_ttl": { "type": "string" },
          "evidence_ref": { "type": "string" },
          "operator_impact": { "type": "string" },
          "ai_next_action": { "type": "string" },
          "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] },
          "work_item_required": { "const": true }
        },
        "additionalProperties": false
      }
    },
    "source_confidence_gates": {
      "type": "array",
      "minItems": 5,
      "items": {
        "type": "object",
        "required": ["confidence_id", "display_name", "confidence", "score", "reason", "display_policy", "blocked_green_badge", "owner_agent"],
        "properties": {
          "confidence_id": { "type": "string" },
          "display_name": { "type": "string" },
          "confidence": { "const": "low" },
          "score": { "type": "integer", "minimum": 0, "maximum": 100 },
          "reason": { "type": "string" },
          "display_policy": { "type": "string" },
          "blocked_green_badge": { "const": true },
          "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] }
        },
        "additionalProperties": false
      }
    },
    "report_actionability_scores": {
      "type": "array",
      "minItems": 4,
      "items": {
        "type": "object",
        "required": ["report_id", "display_name", "score", "lane", "send_policy", "next_action", "owner_agent"],
        "properties": {
          "report_id": { "type": "string" },
          "display_name": { "type": "string" },
          "score": { "type": "integer", "minimum": 0, "maximum": 100 },
          "lane": { "type": "string" },
          "send_policy": { "type": "string" },
          "next_action": { "type": "string" },
          "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] }
        },
        "additionalProperties": false
      }
    },
    "zero_signal_work_items": {
      "type": "array",
      "minItems": 5,
      "items": {
        "type": "object",
        "required": ["work_item_id", "asset_type", "status", "source_gate_id", "required_assets"],
        "properties": {
          "work_item_id": { "type": "string" },
          "asset_type": { "type": "string" },
          "status": { "const": "draft_required" },
          "source_gate_id": { "type": "string" },
          "required_assets": { "type": "array", "items": { "type": "string" }, "minItems": 1 }
        },
        "additionalProperties": false
      }
    },
    "zero_signal_findings": { "type": "array", "minItems": 1 },
    "report_cadence_contracts": { "type": "array", "minItems": 3 },
    "alert_actionability_lanes": { "type": "array", "minItems": 1 },
    "telegram_routing_consolidation": {
      "type": "object",
      "required": [
        "canonical_room_name",
        "canonical_room_env",
        "product_alerts_must_route_to_canonical_room",
        "other_bot_or_group_alerts_allowed",
        "direct_telegram_api_send_allowed",
        "secret_value_read_allowed",
        "route_change_allowed",
        "routing_note"
      ],
      "properties": {
        "canonical_room_name": { "const": "AwoooI SRE 戰情室" },
        "canonical_room_env": { "const": "SRE_GROUP_CHAT_ID" },
        "product_alerts_must_route_to_canonical_room": { "const": true },
        "other_bot_or_group_alerts_allowed": { "const": false },
        "direct_telegram_api_send_allowed": { "const": false },
        "secret_value_read_allowed": { "const": false },
        "route_change_allowed": { "const": false },
        "routing_note": { "type": "string" }
      },
      "additionalProperties": false
    },
    "telegram_route_findings": { "type": "array", "minItems": 1 },
    "operator_actions": { "type": "array", "minItems": 1 },
    "approval_boundaries": { "type": "object", "additionalProperties": { "const": false } },
    "rollups": {
      "type": "object",
      "required": [
        "zero_signal_finding_count",
        "source_freshness_gate_count",
        "stale_or_untrusted_source_count",
        "source_confidence_gate_count",
        "low_confidence_gate_count",
        "report_actionability_score_count",
        "actionability_score_ready_count",
        "zero_signal_work_item_count",
        "work_item_required_count",
        "critical_finding_count",
        "high_finding_count",
        "cadence_contract_count",
        "missing_cadence_contract_count",
        "actionability_lane_count",
        "telegram_route_finding_count",
        "legacy_or_direct_route_count",
        "operator_action_count",
        "approval_required_action_ids",
        "blocked_runtime_action_count",
        "all_zero_weekly_report_confidence",
        "all_zero_weekly_report_actionability_score"
      ],
      "properties": {
        "zero_signal_finding_count": { "type": "integer", "minimum": 1 },
        "source_freshness_gate_count": { "type": "integer", "minimum": 6 },
        "stale_or_untrusted_source_count": { "type": "integer", "minimum": 1 },
        "source_confidence_gate_count": { "type": "integer", "minimum": 5 },
        "low_confidence_gate_count": { "type": "integer", "minimum": 1 },
        "report_actionability_score_count": { "type": "integer", "minimum": 4 },
        "actionability_score_ready_count": { "type": "integer", "minimum": 4 },
        "zero_signal_work_item_count": { "type": "integer", "minimum": 5 },
        "work_item_required_count": { "type": "integer", "minimum": 1 },
        "critical_finding_count": { "type": "integer", "minimum": 1 },
        "high_finding_count": { "type": "integer", "minimum": 1 },
        "cadence_contract_count": { "type": "integer", "minimum": 3 },
        "missing_cadence_contract_count": { "type": "integer", "minimum": 1 },
        "actionability_lane_count": { "type": "integer", "minimum": 1 },
        "telegram_route_finding_count": { "type": "integer", "minimum": 1 },
        "legacy_or_direct_route_count": { "type": "integer", "minimum": 1 },
        "operator_action_count": { "type": "integer", "minimum": 1 },
        "approval_required_action_ids": { "type": "array", "items": { "type": "string" } },
        "blocked_runtime_action_count": { "type": "integer", "minimum": 1 },
        "all_zero_weekly_report_confidence": { "const": "low_trust_actionable_anomaly" },
        "all_zero_weekly_report_actionability_score": { "type": "integer", "minimum": 80, "maximum": 100 }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
