{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://awoooi.wooo.work/schemas/ai_agent_runtime_readback_fixture_approval_v1.schema.json",
  "title": "AI Agent Runtime Readback Fixture Approval v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "generated_at",
    "program_status",
    "source_refs",
    "prior_runtime_review",
    "prior_delivery_approval",
    "fixture_approval_truth",
    "fixture_approval_cards",
    "adapter_contracts",
    "verifier_fixture_checks",
    "blocker_mappings",
    "operator_actions",
    "display_redaction_contract",
    "rollups"
  ],
  "properties": {
    "schema_version": {
      "const": "ai_agent_runtime_readback_fixture_approval_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-112"
        },
        "next_task_id": {
          "const": "P2-113"
        },
        "read_only_mode": {
          "const": true
        },
        "runtime_authority": {
          "const": "runtime_readback_fixture_approval_only_no_canonical_target_or_live_query"
        },
        "status_note": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "source_refs": {
      "$ref": "#/$defs/string_array"
    },
    "prior_runtime_review": {
      "$ref": "#/$defs/prior_runtime_review"
    },
    "prior_delivery_approval": {
      "$ref": "#/$defs/prior_delivery_approval"
    },
    "fixture_approval_truth": {
      "$ref": "#/$defs/fixture_approval_truth"
    },
    "fixture_approval_cards": {
      "type": "array",
      "minItems": 5,
      "items": {
        "$ref": "#/$defs/fixture_approval_card"
      }
    },
    "adapter_contracts": {
      "type": "array",
      "minItems": 4,
      "items": {
        "$ref": "#/$defs/adapter_contract"
      }
    },
    "verifier_fixture_checks": {
      "type": "array",
      "minItems": 5,
      "items": {
        "$ref": "#/$defs/verifier_fixture_check"
      }
    },
    "blocker_mappings": {
      "type": "array",
      "minItems": 5,
      "items": {
        "$ref": "#/$defs/blocker_mapping"
      }
    },
    "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"
      ]
    },
    "risk_tier": {
      "enum": [
        "medium",
        "high",
        "critical"
      ]
    },
    "prior_runtime_review": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "implementation_review_schema_version",
        "implementation_review_card_count",
        "no_write_verifier_check_count",
        "implementation_blocker_count",
        "runtime_readback_execution_count",
        "live_query_count",
        "production_write_count",
        "readiness_note"
      ],
      "properties": {
        "implementation_review_schema_version": {
          "const": "ai_agent_runtime_readback_implementation_review_v1"
        },
        "implementation_review_card_count": {
          "const": 5
        },
        "no_write_verifier_check_count": {
          "const": 5
        },
        "implementation_blocker_count": {
          "const": 5
        },
        "runtime_readback_execution_count": {
          "const": 0
        },
        "live_query_count": {
          "const": 0
        },
        "production_write_count": {
          "const": 0
        },
        "readiness_note": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "prior_delivery_approval": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "delivery_approval_schema_version",
        "delivery_approval_packet_count",
        "route_lock_gate_count",
        "payload_redaction_check_count",
        "dry_run_delivery_receipt_count",
        "telegram_send_count",
        "gateway_queue_write_count",
        "bot_api_call_count",
        "readiness_note"
      ],
      "properties": {
        "delivery_approval_schema_version": {
          "const": "ai_agent_report_live_delivery_approval_package_v1"
        },
        "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
        },
        "telegram_send_count": {
          "const": 0
        },
        "gateway_queue_write_count": {
          "const": 0
        },
        "bot_api_call_count": {
          "const": 0
        },
        "readiness_note": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "fixture_approval_truth": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "p2_110_implementation_review_loaded",
        "p2_111_delivery_approval_loaded",
        "fixture_approval_package_ready",
        "adapter_contract_ready",
        "verifier_fixture_ready",
        "blocker_mapping_ready",
        "owner_review_required_before_readback",
        "canonical_runtime_target_read_enabled",
        "live_query_enabled",
        "runtime_readback_execution_enabled",
        "gateway_queue_write_enabled",
        "telegram_send_enabled",
        "bot_api_call_enabled",
        "report_receipt_write_enabled",
        "result_capture_write_enabled",
        "production_write_enabled",
        "secret_read_enabled",
        "destructive_operation_enabled",
        "owner_approval_received_count",
        "fixture_readback_execution_count",
        "canonical_runtime_target_read_count",
        "live_query_count",
        "gateway_queue_write_count",
        "telegram_send_count",
        "bot_api_call_count",
        "report_receipt_write_count",
        "result_capture_write_count",
        "production_write_count",
        "truth_note"
      ],
      "properties": {
        "p2_110_implementation_review_loaded": { "const": true },
        "p2_111_delivery_approval_loaded": { "const": true },
        "fixture_approval_package_ready": { "const": true },
        "adapter_contract_ready": { "const": true },
        "verifier_fixture_ready": { "const": true },
        "blocker_mapping_ready": { "const": true },
        "owner_review_required_before_readback": { "const": true },
        "canonical_runtime_target_read_enabled": { "const": false },
        "live_query_enabled": { "const": false },
        "runtime_readback_execution_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 },
        "result_capture_write_enabled": { "const": false },
        "production_write_enabled": { "const": false },
        "secret_read_enabled": { "const": false },
        "destructive_operation_enabled": { "const": false },
        "owner_approval_received_count": { "const": 0 },
        "fixture_readback_execution_count": { "const": 0 },
        "canonical_runtime_target_read_count": { "const": 0 },
        "live_query_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 },
        "result_capture_write_count": { "const": 0 },
        "production_write_count": { "const": 0 },
        "truth_note": { "type": "string", "minLength": 1 }
      }
    },
    "fixture_approval_card": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "card_id",
        "display_name",
        "owner_agent",
        "source_task_id",
        "status",
        "risk_tier",
        "required_fixture_fields",
        "blocked_runtime_actions",
        "operator_guidance",
        "owner_approval_required",
        "fixture_only",
        "evidence_hash"
      ],
      "properties": {
        "card_id": { "type": "string", "minLength": 1 },
        "display_name": { "type": "string", "minLength": 1 },
        "owner_agent": { "$ref": "#/$defs/owner_agent" },
        "source_task_id": { "enum": ["P2-110", "P2-111"] },
        "status": { "enum": ["approval_required", "ready_for_owner_review", "blocked_by_policy"] },
        "risk_tier": { "$ref": "#/$defs/risk_tier" },
        "required_fixture_fields": { "$ref": "#/$defs/string_array" },
        "blocked_runtime_actions": { "$ref": "#/$defs/string_array" },
        "operator_guidance": { "type": "string", "minLength": 1 },
        "owner_approval_required": { "const": true },
        "fixture_only": { "const": true },
        "evidence_hash": { "$ref": "#/$defs/redacted_sha256" }
      }
    },
    "adapter_contract": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "contract_id",
        "display_name",
        "status",
        "input_schema",
        "output_schema",
        "required_evidence",
        "canonical_target_read_enabled",
        "live_query_enabled",
        "evidence_hash"
      ],
      "properties": {
        "contract_id": { "type": "string", "minLength": 1 },
        "display_name": { "type": "string", "minLength": 1 },
        "status": { "enum": ["ready", "approval_required", "blocked_by_policy"] },
        "input_schema": { "type": "string", "minLength": 1 },
        "output_schema": { "type": "string", "minLength": 1 },
        "required_evidence": { "$ref": "#/$defs/string_array" },
        "canonical_target_read_enabled": { "const": false },
        "live_query_enabled": { "const": false },
        "evidence_hash": { "$ref": "#/$defs/redacted_sha256" }
      }
    },
    "verifier_fixture_check": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "check_id",
        "display_name",
        "status",
        "required_fixture",
        "failure_if_missing",
        "live_verifier_enabled",
        "evidence_hash"
      ],
      "properties": {
        "check_id": { "type": "string", "minLength": 1 },
        "display_name": { "type": "string", "minLength": 1 },
        "status": { "enum": ["ready", "approval_required", "blocked_by_policy"] },
        "required_fixture": { "type": "string", "minLength": 1 },
        "failure_if_missing": { "type": "string", "minLength": 1 },
        "live_verifier_enabled": { "const": false },
        "evidence_hash": { "$ref": "#/$defs/redacted_sha256" }
      }
    },
    "blocker_mapping": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "blocker_id",
        "display_name",
        "source_blocker",
        "severity",
        "blocked_action",
        "blocked_until",
        "status",
        "evidence_hash"
      ],
      "properties": {
        "blocker_id": { "type": "string", "minLength": 1 },
        "display_name": { "type": "string", "minLength": 1 },
        "source_blocker": { "type": "string", "minLength": 1 },
        "severity": { "enum": ["medium", "high", "critical"] },
        "blocked_action": { "type": "string", "minLength": 1 },
        "blocked_until": { "type": "string", "minLength": 1 },
        "status": { "enum": ["mapped", "approval_required", "blocked_by_policy"] },
        "evidence_hash": { "$ref": "#/$defs/redacted_sha256" }
      }
    },
    "operator_action": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "action_id",
        "display_name",
        "owner_agent",
        "action_type",
        "operator_instruction",
        "runtime_readback_allowed"
      ],
      "properties": {
        "action_id": { "type": "string", "minLength": 1 },
        "display_name": { "type": "string", "minLength": 1 },
        "owner_agent": { "$ref": "#/$defs/owner_agent" },
        "action_type": {
          "enum": [
            "review_fixture_approval",
            "compare_adapter_contract",
            "confirm_no_live_query",
            "reject_canonical_target",
            "promote_to_p2_113"
          ]
        },
        "operator_instruction": { "type": "string", "minLength": 1 },
        "runtime_readback_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_runtime_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_runtime_payload_display_allowed": { "const": false },
        "internal_collaboration_content_display_allowed": { "const": false }
      }
    },
    "rollups": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "fixture_approval_card_count",
        "adapter_contract_count",
        "verifier_fixture_check_count",
        "blocker_mapping_count",
        "operator_action_count",
        "approval_required_card_count",
        "blocked_card_count",
        "blocked_contract_count",
        "blocked_check_count",
        "owner_approval_received_count",
        "fixture_readback_execution_count",
        "canonical_runtime_target_read_count",
        "live_query_count",
        "gateway_queue_write_count",
        "telegram_send_count",
        "bot_api_call_count",
        "report_receipt_write_count",
        "result_capture_write_count",
        "production_write_count",
        "secret_read_count",
        "destructive_operation_count"
      ],
      "properties": {
        "fixture_approval_card_count": { "const": 5 },
        "adapter_contract_count": { "const": 4 },
        "verifier_fixture_check_count": { "const": 5 },
        "blocker_mapping_count": { "const": 5 },
        "operator_action_count": { "const": 5 },
        "approval_required_card_count": { "type": "integer", "minimum": 0 },
        "blocked_card_count": { "type": "integer", "minimum": 0 },
        "blocked_contract_count": { "type": "integer", "minimum": 0 },
        "blocked_check_count": { "type": "integer", "minimum": 0 },
        "owner_approval_received_count": { "const": 0 },
        "fixture_readback_execution_count": { "const": 0 },
        "canonical_runtime_target_read_count": { "const": 0 },
        "live_query_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 },
        "result_capture_write_count": { "const": 0 },
        "production_write_count": { "const": 0 },
        "secret_read_count": { "const": 0 },
        "destructive_operation_count": { "const": 0 }
      }
    }
  }
}
