{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://awoooi.local/schemas/ai_agent_result_capture_writer_dry_run_readback_v1.schema.json",
  "title": "AI Agent Result Capture Writer Dry Run Readback",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "schema_version",
    "generated_at",
    "program_status",
    "prior_result_capture_writer_dry_run_fixture",
    "readback_truth",
    "dry_run_readback_cards",
    "receipt_verifier_checks",
    "promotion_readiness_gates",
    "blocked_promotion_writes",
    "operator_actions",
    "display_redaction_contract",
    "rollups"
  ],
  "properties": {
    "schema_version": {
      "const": "ai_agent_result_capture_writer_dry_run_readback_v1"
    },
    "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-124"
        },
        "next_task_id": {
          "const": "P2-125"
        },
        "read_only_mode": {
          "const": true
        },
        "runtime_authority": {
          "const": "result_capture_writer_dry_run_readback_only_no_live_write"
        }
      }
    },
    "readback_truth": {
      "type": "object",
      "required": [
        "p2_123_fixture_loaded",
        "dry_run_readback_ready",
        "receipt_verifier_ready",
        "promotion_readiness_ready",
        "writer_apply_enabled",
        "dry_run_execution_enabled",
        "receipt_write_enabled",
        "promotion_apply_enabled",
        "result_capture_write_enabled",
        "learning_write_enabled",
        "playbook_trust_write_enabled",
        "gateway_queue_write_enabled",
        "telegram_send_enabled"
      ],
      "properties": {
        "p2_123_fixture_loaded": {
          "const": true
        },
        "dry_run_readback_ready": {
          "const": true
        },
        "receipt_verifier_ready": {
          "const": true
        },
        "promotion_readiness_ready": {
          "const": true
        },
        "writer_apply_enabled": {
          "const": false
        },
        "dry_run_execution_enabled": {
          "const": false
        },
        "receipt_write_enabled": {
          "const": false
        },
        "promotion_apply_enabled": {
          "const": false
        },
        "result_capture_write_enabled": {
          "const": false
        },
        "learning_write_enabled": {
          "const": false
        },
        "playbook_trust_write_enabled": {
          "const": false
        },
        "gateway_queue_write_enabled": {
          "const": false
        },
        "telegram_send_enabled": {
          "const": false
        },
        "production_write_enabled": {
          "const": false
        }
      }
    },
    "dry_run_readback_cards": {
      "type": "array",
      "minItems": 5,
      "maxItems": 5
    },
    "receipt_verifier_checks": {
      "type": "array",
      "minItems": 5,
      "maxItems": 5
    },
    "promotion_readiness_gates": {
      "type": "array",
      "minItems": 5,
      "maxItems": 5
    },
    "blocked_promotion_writes": {
      "type": "array",
      "minItems": 6,
      "maxItems": 6
    },
    "operator_actions": {
      "type": "array",
      "minItems": 5,
      "maxItems": 5
    },
    "display_redaction_contract": {
      "type": "object",
      "properties": {
        "redaction_required": {
          "const": true
        },
        "secret_value_display_allowed": {
          "const": false
        },
        "internal_collaboration_content_display_allowed": {
          "const": false
        }
      }
    },
    "rollups": {
      "type": "object",
      "required": [
        "dry_run_readback_card_count",
        "receipt_verifier_check_count",
        "promotion_readiness_gate_count",
        "blocked_promotion_write_count",
        "operator_action_count",
        "writer_apply_count",
        "dry_run_execution_count",
        "receipt_write_count",
        "promotion_apply_count",
        "result_capture_write_count",
        "learning_write_count",
        "playbook_trust_write_count",
        "gateway_queue_write_count",
        "telegram_send_count"
      ],
      "properties": {
        "dry_run_readback_card_count": {
          "const": 5
        },
        "receipt_verifier_check_count": {
          "const": 5
        },
        "promotion_readiness_gate_count": {
          "const": 5
        },
        "blocked_promotion_write_count": {
          "const": 6
        },
        "operator_action_count": {
          "const": 5
        },
        "writer_apply_count": {
          "const": 0
        },
        "dry_run_execution_count": {
          "const": 0
        },
        "receipt_write_count": {
          "const": 0
        },
        "promotion_apply_count": {
          "const": 0
        },
        "result_capture_write_count": {
          "const": 0
        },
        "learning_write_count": {
          "const": 0
        },
        "playbook_trust_write_count": {
          "const": 0
        },
        "gateway_queue_write_count": {
          "const": 0
        },
        "telegram_send_count": {
          "const": 0
        }
      }
    }
  }
}
