{
  "$id": "https://razi.dev/schemas/spec_schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "version": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        }
      ]
    },
    "policy": {
      "type": "string",
      "description": "Policy preset name. Must be a preset registered in policy_compile.py."
    },
    "model": {
      "type": "object",
      "properties": {
        "provider": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "temperature": {
          "type": "number",
          "minimum": 0,
          "maximum": 2
        }
      },
      "required": [
        "provider",
        "id",
        "temperature"
      ],
      "additionalProperties": false
    },
    "input_schema": {
      "type": "string"
    },
    "output_schema": {
      "type": "string"
    },
    "operators": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "evidence.index",
              "synth.json"
            ]
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "additionalProperties": true
      },
      "minItems": 1
    }
  },
  "required": [
    "name",
    "version",
    "policy",
    "model",
    "input_schema",
    "output_schema",
    "operators"
  ],
  "additionalProperties": false
}