{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peopleprincipia-com/json-schema/peopleprincipia-com-refusal-monthly-digest-schema.json",
  "title": "RefusalMonthlyDigest",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peopleprincipia-com-openapi.yaml#/components/schemas/RefusalMonthlyDigest",
  "type": "object",
  "required": [
    "month",
    "total",
    "total_basis",
    "by_class",
    "by_class_basis",
    "by_reason",
    "by_gate",
    "by_gate_basis",
    "examples",
    "consumers_affected",
    "consumers_affected_basis",
    "agent_class_hits",
    "agent_class_hits_basis",
    "generated_at"
  ],
  "properties": {
    "month": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}$"
    },
    "total": {
      "type": "integer",
      "minimum": 0
    },
    "total_basis": {
      "$ref": "#/$defs/ScoreboardBasis"
    },
    "by_class": {
      "type": "object",
      "additionalProperties": {
        "type": "integer",
        "minimum": 0
      }
    },
    "by_class_basis": {
      "$ref": "#/$defs/ScoreboardBasis"
    },
    "by_reason": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "refusal_class",
          "reason_code",
          "count"
        ],
        "properties": {
          "refusal_class": {
            "type": "string"
          },
          "reason_code": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          }
        }
      }
    },
    "by_gate": {
      "type": "object",
      "additionalProperties": {
        "type": "integer",
        "minimum": 0
      }
    },
    "by_gate_basis": {
      "$ref": "#/$defs/ScoreboardBasis"
    },
    "consumers_affected": {
      "type": "integer",
      "minimum": 0
    },
    "consumers_affected_basis": {
      "$ref": "#/$defs/ScoreboardBasis"
    },
    "agent_class_hits": {
      "type": "object",
      "additionalProperties": {
        "type": "integer",
        "minimum": 0
      }
    },
    "agent_class_hits_basis": {
      "$ref": "#/$defs/ScoreboardBasis"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "ScoreboardBasis": {
      "type": "object",
      "required": [
        "command",
        "measured_at"
      ],
      "properties": {
        "command": {
          "type": "string"
        },
        "measured_at": {
          "type": "string"
        }
      }
    }
  }
}