{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/decide-fyi/json-schema/decide-fyi-policy-effectiveness-schema.json",
  "title": "PolicyEffectiveness",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/decide-fyi-openapi.json#/components/schemas/PolicyEffectiveness",
  "type": "object",
  "required": [
    "ok",
    "policy_effectiveness_version",
    "policy_id",
    "decisions_analyzed",
    "metrics",
    "effectiveness_hash",
    "recommendation"
  ],
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "policy_effectiveness_version": {
      "type": "string",
      "const": "policy_effectiveness_v1"
    },
    "generated_at": {
      "type": "string"
    },
    "policy_id": {
      "type": "string"
    },
    "policy_version": {
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "type": "string",
      "const": "decision_outcomes"
    },
    "minimum_sample_size": {
      "type": "integer"
    },
    "decisions_analyzed": {
      "type": "integer"
    },
    "outcomes_analyzed": {
      "type": "integer"
    },
    "distinct_decisions": {
      "type": "integer"
    },
    "by_status": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    },
    "by_verdict": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    },
    "metrics": {
      "type": "object",
      "properties": {
        "success_rate": {
          "type": [
            "number",
            "null"
          ]
        },
        "failure_rate": {
          "type": [
            "number",
            "null"
          ]
        },
        "revert_rate": {
          "type": [
            "number",
            "null"
          ]
        },
        "review_rate": {
          "type": [
            "number",
            "null"
          ]
        },
        "skipped_rate": {
          "type": [
            "number",
            "null"
          ]
        },
        "unknown_rate": {
          "type": [
            "number",
            "null"
          ]
        },
        "terminal_coverage": {
          "type": [
            "number",
            "null"
          ]
        },
        "executed_rate": {
          "type": [
            "number",
            "null"
          ]
        }
      },
      "additionalProperties": true
    },
    "proxy_quality": {
      "type": "object",
      "properties": {
        "estimated_false_positive_rate": {
          "type": [
            "number",
            "null"
          ]
        },
        "estimated_false_negative_rate": {
          "type": [
            "number",
            "null"
          ]
        },
        "note": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "effectiveness_score": {
      "type": [
        "number",
        "null"
      ]
    },
    "confidence": {
      "type": [
        "number",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "scored",
        "insufficient_data"
      ]
    },
    "recommendation": {
      "type": "string",
      "enum": [
        "insufficient_data",
        "review_policy",
        "monitor",
        "healthy"
      ]
    },
    "window": {
      "type": "object",
      "additionalProperties": true
    },
    "data_quality": {
      "type": "object",
      "additionalProperties": true
    },
    "effectiveness_hash": {
      "type": "string"
    }
  },
  "additionalProperties": true
}