{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://awoooi.wooo.work/schemas/ai_agent_canonical_runtime_readback_owner_acceptance_v1.schema.json",
  "title": "AI Agent Canonical Runtime Readback Owner Acceptance v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "generated_at",
    "program_status",
    "source_refs",
    "prior_promotion_gate",
    "owner_gate_truth",
    "owner_approval_packets",
    "acceptance_record_templates",
    "fixture_promotion_reviews",
    "no_write_verifier_plans",
    "blocked_promotions",
    "operator_actions",
    "display_redaction_contract",
    "rollups"
  ],
  "properties": {
    "schema_version": {
      "const": "ai_agent_canonical_runtime_readback_owner_acceptance_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-115"
        },
        "next_task_id": {
          "const": "P2-116"
        },
        "read_only_mode": {
          "const": true
        },
        "runtime_authority": {
          "const": "canonical_runtime_readback_owner_acceptance_only_no_live_read_or_write"
        },
        "status_note": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "source_refs": {
      "$ref": "#/$defs/string_array"
    },
    "prior_promotion_gate": {
      "type": "object"
    },
    "owner_gate_truth": {
      "type": "object"
    },
    "owner_approval_packets": {
      "type": "array",
      "minItems": 5,
      "items": {
        "$ref": "#/$defs/owner_packet"
      }
    },
    "acceptance_record_templates": {
      "type": "array",
      "minItems": 4,
      "items": {
        "$ref": "#/$defs/acceptance_template"
      }
    },
    "fixture_promotion_reviews": {
      "type": "array",
      "minItems": 4,
      "items": {
        "$ref": "#/$defs/fixture_review"
      }
    },
    "no_write_verifier_plans": {
      "type": "array",
      "minItems": 5,
      "items": {
        "$ref": "#/$defs/verifier_plan"
      }
    },
    "blocked_promotions": {
      "type": "array",
      "minItems": 5,
      "items": {
        "$ref": "#/$defs/blocked_promotion"
      }
    },
    "operator_actions": {
      "type": "array",
      "minItems": 5,
      "items": {
        "$ref": "#/$defs/operator_action"
      }
    },
    "display_redaction_contract": {
      "type": "object"
    },
    "rollups": {
      "type": "object"
    }
  },
  "$defs": {
    "string_array": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "hash": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "owner_agent": {
      "enum": [
        "openclaw",
        "hermes",
        "nemotron"
      ]
    },
    "status": {
      "enum": [
        "ready",
        "ready_for_owner_review",
        "approval_required",
        "blocked_by_policy"
      ]
    },
    "risk_tier": {
      "enum": [
        "high",
        "critical"
      ]
    },
    "owner_packet": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "packet_id",
        "display_name",
        "owner_agent",
        "source_lane_id",
        "status",
        "risk_tier",
        "required_owner_fields",
        "allowed_fixture",
        "blocked_runtime_actions",
        "owner_acceptance_required",
        "evidence_hash"
      ],
      "properties": {
        "packet_id": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "owner_agent": {
          "$ref": "#/$defs/owner_agent"
        },
        "source_lane_id": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/status"
        },
        "risk_tier": {
          "$ref": "#/$defs/risk_tier"
        },
        "required_owner_fields": {
          "$ref": "#/$defs/string_array"
        },
        "allowed_fixture": {
          "type": "string"
        },
        "blocked_runtime_actions": {
          "$ref": "#/$defs/string_array"
        },
        "owner_acceptance_required": {
          "const": true
        },
        "evidence_hash": {
          "$ref": "#/$defs/hash"
        }
      }
    },
    "acceptance_template": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "template_id",
        "display_name",
        "status",
        "required_fields",
        "accepted",
        "record_write_enabled",
        "evidence_hash"
      ],
      "properties": {
        "template_id": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/status"
        },
        "required_fields": {
          "$ref": "#/$defs/string_array"
        },
        "accepted": {
          "const": false
        },
        "record_write_enabled": {
          "const": false
        },
        "evidence_hash": {
          "$ref": "#/$defs/hash"
        }
      }
    },
    "fixture_review": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "review_id",
        "display_name",
        "status",
        "source_packet_id",
        "review_outcome",
        "runtime_write_enabled",
        "evidence_hash"
      ],
      "properties": {
        "review_id": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/status"
        },
        "source_packet_id": {
          "type": "string"
        },
        "review_outcome": {
          "type": "string"
        },
        "runtime_write_enabled": {
          "const": false
        },
        "evidence_hash": {
          "$ref": "#/$defs/hash"
        }
      }
    },
    "verifier_plan": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "plan_id",
        "display_name",
        "status",
        "required_fixture",
        "failure_if_missing",
        "live_verifier_enabled",
        "evidence_hash"
      ],
      "properties": {
        "plan_id": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/status"
        },
        "required_fixture": {
          "type": "string"
        },
        "failure_if_missing": {
          "type": "string"
        },
        "live_verifier_enabled": {
          "const": false
        },
        "evidence_hash": {
          "$ref": "#/$defs/hash"
        }
      }
    },
    "blocked_promotion": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "blocker_id",
        "display_name",
        "severity",
        "status",
        "blocked_action",
        "blocked_until",
        "evidence_hash"
      ],
      "properties": {
        "blocker_id": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "severity": {
          "enum": [
            "high",
            "critical"
          ]
        },
        "status": {
          "$ref": "#/$defs/status"
        },
        "blocked_action": {
          "type": "string"
        },
        "blocked_until": {
          "type": "string"
        },
        "evidence_hash": {
          "$ref": "#/$defs/hash"
        }
      }
    },
    "operator_action": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "action_id",
        "display_name",
        "owner_agent",
        "action_type",
        "operator_instruction",
        "runtime_promotion_allowed"
      ],
      "properties": {
        "action_id": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "owner_agent": {
          "$ref": "#/$defs/owner_agent"
        },
        "action_type": {
          "type": "string"
        },
        "operator_instruction": {
          "type": "string"
        },
        "runtime_promotion_allowed": {
          "const": false
        }
      }
    }
  }
}
