{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://x07.io/spec/x07.xtal.violation@0.1.0.schema.json",
  "title": "x07.xtal.violation@0.1.0",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "kind",
    "id",
    "clause_id",
    "world",
    "source",
    "repro",
    "generated_at"
  ],
  "properties": {
    "schema_version": {
      "type": "string",
      "const": "x07.xtal.violation@0.1.0"
    },
    "kind": {
      "type": "string",
      "const": "contract_violation"
    },
    "id": {
      "$ref": "#/$defs/sha256_hex"
    },
    "clause_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "world": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "source": {
      "$ref": "#/$defs/source"
    },
    "repro": {
      "$ref": "#/$defs/repro_ref"
    },
    "original_repro_path": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    },
    "generated_at": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
    }
  },
  "$defs": {
    "sha256_hex": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "source": {
      "type": "object",
      "additionalProperties": true,
      "required": ["mode"],
      "properties": {
        "mode": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        },
        "test_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "test_entry": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        }
      }
    },
    "repro_ref": {
      "type": "object",
      "additionalProperties": false,
      "required": ["path", "sha256", "bytes_len"],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "sha256": {
          "$ref": "#/$defs/sha256_hex"
        },
        "bytes_len": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  }
}
