{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/decide-fyi/json-schema/decide-fyi-decision-confidence-schema.json",
  "title": "DecisionConfidence",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/decide-fyi-confidence-api-openapi.yml#/components/schemas/DecisionConfidence",
  "type": "object",
  "required": [
    "ok",
    "decision_confidence_version",
    "score",
    "level",
    "recommendation",
    "confidence_hash"
  ],
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "decision_confidence_version": {
      "type": "string",
      "const": "decision_confidence_v1"
    },
    "generated_at": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "const": "decision_outcomes"
    },
    "scope": {
      "type": "string",
      "const": "caller_api_key"
    },
    "decision_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "policy_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "policy_version": {
      "type": [
        "string",
        "null"
      ]
    },
    "verdict": {
      "type": "string"
    },
    "action": {
      "type": [
        "string",
        "null"
      ]
    },
    "score": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "level": {
      "type": "string",
      "enum": [
        "high",
        "medium",
        "low",
        "weak",
        "insufficient_data"
      ]
    },
    "based_on": {
      "type": "integer"
    },
    "similar_decisions": {
      "type": "integer"
    },
    "policy_stability": {
      "type": "string",
      "enum": [
        "high",
        "medium",
        "low",
        "insufficient_data"
      ]
    },
    "recommendation": {
      "type": "string",
      "enum": [
        "collect_more_outcomes",
        "high_confidence_proceed",
        "high_confidence_block",
        "high_confidence_review",
        "proceed_with_monitoring",
        "route_for_review",
        "monitor"
      ]
    },
    "metrics": {
      "type": "object",
      "additionalProperties": true
    },
    "baseline": {
      "type": "object",
      "additionalProperties": true
    },
    "data_quality": {
      "type": "object",
      "additionalProperties": true
    },
    "reasons": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "confidence_hash": {
      "type": "string"
    }
  },
  "additionalProperties": true
}