{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/citeladder-com/json-schema/citeladder-com-prompt-metric-item-schema.json",
  "title": "PromptMetricItem",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/citeladder-com-openapi.json#/components/schemas/PromptMetricItem",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "audit_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "prompt_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "prompt_index": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "prompt_text": {
      "type": "string"
    },
    "prompt_snapshot_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "cohort": {
      "type": "string"
    },
    "composite_score": {
      "type": [
        "number",
        "null"
      ]
    },
    "source_audit_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid",
        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
      }
    },
    "previous_score": {
      "type": [
        "number",
        "null"
      ]
    },
    "immediate_delta": {
      "type": [
        "number",
        "null"
      ]
    },
    "rolling_four": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "per_engine_scores": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "number"
      }
    },
    "components": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": [
          "number",
          "null"
        ]
      }
    },
    "engine_agreement": {
      "type": "number"
    },
    "repetition_agreement": {
      "type": "number"
    },
    "evidence_coverage": {
      "type": "number"
    },
    "trend_confidence": {
      "type": "number"
    },
    "decline_confirmed": {
      "type": "boolean"
    },
    "analyzer_version": {
      "type": "string"
    },
    "scoring_rule_version": {
      "type": "string"
    },
    "created_at": {
      "type": "string"
    },
    "theme": {
      "type": "string"
    },
    "intent": {
      "type": "string"
    },
    "visibility_rate": {
      "type": [
        "number",
        "null"
      ]
    },
    "owned_citation_rate": {
      "type": [
        "number",
        "null"
      ]
    },
    "avg_position": {
      "type": [
        "number",
        "null"
      ]
    },
    "visibility_delta": {
      "type": [
        "number",
        "null"
      ]
    },
    "comparison_status": {
      "type": "string"
    },
    "comparison": {
      "anyOf": [
        {
          "$ref": "#/$defs/VisibilityComparison"
        },
        {
          "type": "null"
        }
      ]
    },
    "counts": {
      "$ref": "#/$defs/MeasurementCounts"
    },
    "answer_states": {
      "anyOf": [
        {
          "$ref": "#/$defs/AnswerStates"
        },
        {
          "type": "null"
        }
      ]
    },
    "action_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "outcomes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "logical_engine": {
            "type": "string"
          },
          "transport_model": {
            "type": "string"
          },
          "counts": {
            "$ref": "#/$defs/MeasurementCounts"
          },
          "visibility_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "owned_citation_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "answer_states": {
            "anyOf": [
              {
                "$ref": "#/$defs/AnswerStates"
              },
              {
                "type": "null"
              }
            ]
          },
          "gap_counts": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            }
          }
        },
        "required": [
          "logical_engine",
          "transport_model",
          "counts",
          "visibility_rate",
          "owned_citation_rate",
          "gap_counts"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "id",
    "audit_id",
    "prompt_id",
    "prompt_index",
    "prompt_text",
    "cohort",
    "composite_score",
    "previous_score",
    "immediate_delta",
    "rolling_four",
    "per_engine_scores",
    "components",
    "engine_agreement",
    "repetition_agreement",
    "evidence_coverage",
    "trend_confidence",
    "decline_confirmed",
    "analyzer_version",
    "scoring_rule_version",
    "created_at"
  ],
  "additionalProperties": false,
  "$defs": {
    "AnswerStates": {
      "type": "object",
      "properties": {
        "mentioned_and_cited": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "mentioned_only": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "cited_only": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "neither": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "mentioned_and_cited",
        "mentioned_only",
        "cited_only",
        "neither"
      ],
      "additionalProperties": false
    },
    "MeasurementCounts": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string"
        },
        "responses": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "brand_responses": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "owned_citation_responses": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "entity_presences": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "expected": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "failed": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "not_run": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "state",
        "responses",
        "brand_responses",
        "owned_citation_responses",
        "entity_presences",
        "expected",
        "failed",
        "not_run"
      ],
      "additionalProperties": false
    },
    "RankingRow": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "is_brand": {
          "type": "boolean"
        },
        "logo_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "website_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "mention_rate": {
          "type": [
            "number",
            "null"
          ]
        },
        "citation_rate": {
          "type": [
            "number",
            "null"
          ]
        },
        "share_of_voice": {
          "type": [
            "number",
            "null"
          ]
        },
        "mention_count": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "visibility_delta": {
          "type": [
            "number",
            "null"
          ]
        },
        "gap_count": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "matched_visibility_rate": {
          "type": [
            "number",
            "null"
          ]
        },
        "matched_visibility_delta": {
          "type": [
            "number",
            "null"
          ]
        },
        "matched_response_count": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "avg_position": {
          "type": [
            "number",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "is_brand",
        "mention_rate",
        "citation_rate",
        "share_of_voice",
        "mention_count",
        "avg_position"
      ],
      "additionalProperties": false
    },
    "VisibilityComparison": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string"
        },
        "baseline_audit_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            {
              "type": "null"
            }
          ]
        },
        "baseline_audit_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "baseline_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "baseline_counts": {
          "anyOf": [
            {
              "$ref": "#/$defs/MeasurementCounts"
            },
            {
              "type": "null"
            }
          ]
        },
        "current_counts": {
          "anyOf": [
            {
              "$ref": "#/$defs/MeasurementCounts"
            },
            {
              "type": "null"
            }
          ]
        },
        "deltas": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "rankings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RankingRow"
          }
        },
        "skipped_runs": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "matched_cells": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "current_cells": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "baseline_cells": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "current_values": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "baseline_values": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "current_rankings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RankingRow"
          }
        }
      },
      "required": [
        "status",
        "baseline_audit_id",
        "baseline_audit_ids",
        "baseline_at",
        "baseline_counts",
        "current_counts",
        "deltas",
        "rankings",
        "skipped_runs",
        "matched_cells",
        "current_cells",
        "baseline_cells",
        "current_values",
        "baseline_values",
        "current_rankings"
      ],
      "additionalProperties": false
    }
  }
}