{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://awoooi.wooo.work/schemas/ai_agent_critic_reviewer_result_capture_v1.schema.json",
  "title": "AI Agent Critic Reviewer Result Capture v1",
  "type": "object",
  "required": [
    "schema_version",
    "generated_at",
    "program_status",
    "source_refs",
    "prior_readback",
    "score_truth",
    "agent_scorecards",
    "result_capture_contracts",
    "promotion_gates",
    "candidate_routes",
    "display_redaction_contract",
    "rollups"
  ],
  "properties": {
    "schema_version": { "const": "ai_agent_critic_reviewer_result_capture_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": { "type": "integer", "minimum": 0, "maximum": 100 },
        "current_priority": { "enum": ["P0", "P1", "P2", "P3"] },
        "current_task_id": { "const": "P2-105" },
        "next_task_id": { "const": "P2-106" },
        "read_only_mode": { "const": true },
        "runtime_authority": { "const": "critic_reviewer_result_capture_contract_only_no_live_write" },
        "status_note": { "type": "string" }
      },
      "additionalProperties": false
    },
    "source_refs": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
    "prior_readback": {
      "type": "object",
      "required": [
        "source_schema_version",
        "readback_at",
        "approval_24h_total",
        "approval_24h_matched",
        "approved_without_execution_meta_24h",
        "pending_with_matched_24h",
        "execution_failed_with_matched_24h",
        "playbook_updated_24h",
        "readback_note"
      ],
      "properties": {
        "source_schema_version": { "const": "ai_agent_matched_playbook_learning_gap_v1" },
        "readback_at": { "type": "string" },
        "approval_24h_total": { "type": "integer", "minimum": 0 },
        "approval_24h_matched": { "type": "integer", "minimum": 0 },
        "approved_without_execution_meta_24h": { "type": "integer", "minimum": 0 },
        "pending_with_matched_24h": { "type": "integer", "minimum": 0 },
        "execution_failed_with_matched_24h": { "type": "integer", "minimum": 0 },
        "playbook_updated_24h": { "type": "integer", "minimum": 0 },
        "readback_note": { "type": "string" }
      },
      "additionalProperties": false
    },
    "score_truth": { "type": "object" },
    "agent_scorecards": {
      "type": "array",
      "minItems": 5,
      "items": {
        "type": "object",
        "required": [
          "scorecard_id",
          "display_name",
          "owner_agent",
          "role",
          "status",
          "risk_tier",
          "minimum_score",
          "required_fields",
          "failure_if_missing",
          "runtime_score_enabled",
          "evidence_hash"
        ],
        "properties": {
          "scorecard_id": { "type": "string" },
          "display_name": { "type": "string" },
          "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] },
          "role": { "enum": ["critic", "reviewer", "reporter", "verifier", "coordinator"] },
          "status": { "enum": ["ready_for_owner_review", "blocked_by_policy"] },
          "risk_tier": { "enum": ["low", "medium", "high", "critical"] },
          "minimum_score": { "type": "integer", "minimum": 0, "maximum": 100 },
          "required_fields": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
          "failure_if_missing": { "type": "string" },
          "runtime_score_enabled": { "const": false },
          "evidence_hash": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
        },
        "additionalProperties": false
      }
    },
    "result_capture_contracts": {
      "type": "array",
      "minItems": 5,
      "items": {
        "type": "object",
        "required": [
          "contract_id",
          "display_name",
          "owner_agent",
          "result_state",
          "status",
          "risk_tier",
          "count_24h",
          "required_fields",
          "write_enabled",
          "runtime_writer_enabled",
          "blocker_summary",
          "evidence_hash"
        ],
        "properties": {
          "contract_id": { "type": "string" },
          "display_name": { "type": "string" },
          "owner_agent": { "enum": ["openclaw", "hermes", "nemotron"] },
          "result_state": { "type": "string" },
          "status": { "enum": ["ready", "needs_owner_review", "blocked_by_policy"] },
          "risk_tier": { "enum": ["low", "medium", "high", "critical"] },
          "count_24h": { "type": "integer", "minimum": 0 },
          "required_fields": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
          "write_enabled": { "const": false },
          "runtime_writer_enabled": { "const": false },
          "blocker_summary": { "type": "string" },
          "evidence_hash": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
        },
        "additionalProperties": false
      }
    },
    "promotion_gates": { "type": "array", "minItems": 6 },
    "candidate_routes": { "type": "array", "minItems": 4 },
    "display_redaction_contract": { "type": "object" },
    "rollups": { "type": "object" }
  },
  "additionalProperties": false
}
