{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://awoooi.wooo.work/schemas/ai_agent_result_capture_release_decision_input_prep_v1.schema.json",
  "title": "AI Agent Result Capture Release Decision Input Prep",
  "type": "object",
  "required": [
    "schema_version",
    "generated_at",
    "program_status",
    "prior_next_handoff",
    "decision_input_truth",
    "decision_input_packets",
    "blocked_input_transitions",
    "operator_actions",
    "display_redaction_contract",
    "rollups"
  ],
  "properties": {
    "schema_version": {
      "const": "ai_agent_result_capture_release_decision_input_prep_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": {
          "const": "P2"
        },
        "current_task_id": {
          "const": "P2-141"
        },
        "next_task_id": {
          "const": "P2-142"
        },
        "read_only_mode": {
          "const": true
        },
        "runtime_authority": {
          "const": "result_capture_release_decision_input_prep_only_no_live_write"
        },
        "status_note": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": true
    },
    "prior_next_handoff": {
      "type": "object",
      "required": [
        "schema_version",
        "current_task_id",
        "next_task_id",
        "next_gate_handoff_count",
        "stale_operator_action_count",
        "blocked_handoff_transition_count",
        "operator_action_count",
        "readiness_note"
      ],
      "properties": {
        "schema_version": {
          "const": "ai_agent_result_capture_release_decision_next_handoff_v1"
        },
        "current_task_id": {
          "const": "P2-140"
        },
        "next_task_id": {
          "const": "P2-141"
        },
        "next_gate_handoff_count": {
          "const": 5
        },
        "stale_operator_action_count": {
          "const": 1
        },
        "blocked_handoff_transition_count": {
          "const": 6
        },
        "operator_action_count": {
          "const": 5
        },
        "readiness_note": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": true
    },
    "decision_input_truth": {
      "type": "object",
      "required": [
        "p2_140_next_handoff_loaded",
        "next_task_id_alignment_checked",
        "stale_self_loop_containment_inherited",
        "p2_141_input_prep_only",
        "owner_input_packet_required",
        "verifier_input_packet_required",
        "rollback_input_packet_required",
        "maintenance_window_input_required",
        "live_apply_input_required",
        "redaction_review_required",
        "truth_note"
      ],
      "properties": {
        "p2_140_next_handoff_loaded": {
          "const": true
        },
        "next_task_id_alignment_checked": {
          "const": true
        },
        "stale_self_loop_containment_inherited": {
          "const": true
        },
        "p2_141_input_prep_only": {
          "const": true
        },
        "truth_note": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": true
    },
    "decision_input_packets": {
      "type": "array",
      "minItems": 5,
      "maxItems": 5,
      "items": {
        "type": "object",
        "required": [
          "packet_id",
          "display_name",
          "owner_agent",
          "source_handoff_id",
          "current_task_id",
          "target_next_task_id",
          "input_status",
          "required_input_type",
          "input_summary",
          "missing_fields",
          "approval_required",
          "runtime_write_allowed",
          "telegram_send_allowed"
        ],
        "properties": {
          "packet_id": {
            "type": "string"
          },
          "current_task_id": {
            "const": "P2-141"
          },
          "target_next_task_id": {
            "const": "P2-142"
          },
          "approval_required": {
            "const": true
          },
          "runtime_write_allowed": {
            "const": false
          },
          "telegram_send_allowed": {
            "const": false
          },
          "missing_fields": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": true
      }
    },
    "blocked_input_transitions": {
      "type": "array",
      "minItems": 6,
      "maxItems": 6
    },
    "operator_actions": {
      "type": "array",
      "minItems": 5,
      "maxItems": 5
    },
    "display_redaction_contract": {
      "type": "object",
      "required": [
        "redaction_required",
        "raw_prompt_display_allowed",
        "private_reasoning_display_allowed",
        "secret_value_display_allowed",
        "raw_runtime_payload_display_allowed",
        "internal_collaboration_content_display_allowed",
        "frontend_display_policy"
      ],
      "properties": {
        "redaction_required": {
          "const": true
        },
        "raw_prompt_display_allowed": {
          "const": false
        },
        "private_reasoning_display_allowed": {
          "const": false
        },
        "secret_value_display_allowed": {
          "const": false
        },
        "raw_runtime_payload_display_allowed": {
          "const": false
        },
        "internal_collaboration_content_display_allowed": {
          "const": false
        }
      },
      "additionalProperties": true
    },
    "rollups": {
      "type": "object",
      "required": [
        "decision_input_packet_count",
        "missing_input_field_count",
        "blocked_input_transition_count",
        "operator_action_count",
        "approval_required_subtotal",
        "blocked_and_critical_subtotal",
        "reviewer_queue_write_count",
        "gateway_queue_write_count",
        "telegram_send_count",
        "bot_api_call_count",
        "production_write_count"
      ],
      "properties": {
        "decision_input_packet_count": {
          "const": 5
        },
        "missing_input_field_count": {
          "const": 15
        },
        "blocked_input_transition_count": {
          "const": 6
        },
        "operator_action_count": {
          "const": 5
        },
        "approval_required_subtotal": {
          "const": 12
        },
        "blocked_and_critical_subtotal": {
          "const": 12
        },
        "reviewer_queue_write_count": {
          "const": 0
        },
        "gateway_queue_write_count": {
          "const": 0
        },
        "telegram_send_count": {
          "const": 0
        },
        "bot_api_call_count": {
          "const": 0
        },
        "production_write_count": {
          "const": 0
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
