{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/citeladder-com/json-schema/citeladder-com-prompt-candidate-schema.json",
  "title": "PromptCandidate",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/citeladder-com-prompt-sets-api-openapi.yml#/components/schemas/PromptCandidate",
  "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)$"
    },
    "run_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_set_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)$"
    },
    "topic_id": {
      "default": null,
      "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"
        }
      ]
    },
    "text": {
      "type": "string"
    },
    "intent": {
      "default": "",
      "type": "string"
    },
    "buyer_stage": {
      "default": "",
      "$ref": "#/$defs/BuyerStage"
    },
    "prompt_intent": {
      "default": "",
      "$ref": "#/$defs/PromptIntentDetail"
    },
    "cohort": {
      "$ref": "#/$defs/PromptCohort"
    },
    "created_at": {
      "type": "string"
    },
    "expires_at": {
      "type": "string"
    },
    "quality_status": {
      "default": "not_judged",
      "type": "string",
      "enum": [
        "judged",
        "off",
        "unavailable",
        "not_judged"
      ]
    },
    "quality_flags": {
      "default": [],
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "grounded": {
      "default": false,
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "run_id",
    "prompt_set_id",
    "topic_id",
    "text",
    "intent",
    "buyer_stage",
    "prompt_intent",
    "cohort",
    "created_at",
    "expires_at",
    "quality_status",
    "quality_flags",
    "grounded"
  ],
  "additionalProperties": false,
  "$defs": {
    "BuyerStage": {
      "type": "string",
      "enum": [
        "",
        "awareness",
        "consideration",
        "decision",
        "implementation"
      ]
    },
    "PromptCohort": {
      "type": "string",
      "enum": [
        "core",
        "brand_diagnostic",
        "comparison",
        "commerce"
      ]
    },
    "PromptIntentDetail": {
      "type": "string",
      "enum": [
        "",
        "learn",
        "solve",
        "compare",
        "recommend",
        "validate",
        "buy",
        "implement"
      ]
    }
  }
}