{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/agent-rubric.v1.json",
  "title": "Agent Rubric",
  "description": "Evaluation rubric for Agent OS runs, diagnostics, and listing canaries.",
  "type": "object",
  "required": [
    "schema",
    "rubric_id",
    "target_type",
    "version",
    "criteria",
    "total_weight",
    "required_evidence",
    "safety_critical_criteria",
    "minimum_required_criteria",
    "scoring_policy",
    "receipt_policy_required"
  ],
  "properties": {
    "schema": {
      "const": "agoragentic.agent-rubric.v1"
    },
    "rubric_id": {
      "type": "string"
    },
    "target_type": {
      "type": "string",
      "enum": [
        "run",
        "deployment",
        "listing",
        "x402_service",
        "template",
        "context_packet",
        "provider",
        "capability"
      ]
    },
    "target_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "template_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "version": {
      "type": "string"
    },
    "criteria": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "criterion_id",
          "description"
        ],
        "properties": {
          "criterion_id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "weight": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "evidence_sources": {
            "type": "array",
            "items": { "type": "string" }
          },
          "score_type": {
            "type": "string",
            "enum": ["boolean", "numeric", "enum", "status"]
          },
          "pass_values": {
            "type": "array"
          },
          "fail_values": {
            "type": "array"
          },
          "unknown_allowed": {
            "type": "boolean"
          },
          "safety_critical": {
            "type": "boolean"
          },
          "caps_overall_score": {
            "type": "boolean"
          },
          "minimum_required": {
            "type": "boolean"
          },
          "evidence_key": {
            "type": "string"
          },
          "notes": {
            "type": ["string", "null"]
          },
          "required": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      }
    },
    "total_weight": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "required_evidence": {
      "type": "array",
      "items": { "type": "string" }
    },
    "safety_critical_criteria": {
      "type": "array",
      "items": { "type": "string" }
    },
    "minimum_required_criteria": {
      "type": "array",
      "items": { "type": "string" }
    },
    "scoring_policy": {
      "type": "object",
      "additionalProperties": true
    },
    "receipt_policy_required": {
      "const": true
    },
    "public_boundary": {
      "type": "object",
      "properties": {
        "trust_mutation_triggered": {
          "const": false
        },
        "marketplace_publication_triggered": {
          "const": false
        },
        "routing_weight_changed": {
          "const": false
        },
        "readiness_overridden": {
          "const": false
        }
      },
      "additionalProperties": true
    },
    "created_at": { "type": "string", "format": "date-time" },
    "updated_at": { "type": "string", "format": "date-time" }
  },
  "additionalProperties": true
}
