{
  "$id": "https://hoba.work/schemas/process.schema.json",
  "$ref": "#/definitions/Process",
  "definitions": {
    "Process": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "minLength": 3
        },
        "status": {
          "default": "active",
          "type": "string",
          "enum": [
            "active",
            "deprecated"
          ]
        },
        "evidence_ids": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^(EVD-\\d{3}|evidence\\.[a-z0-9_]+)$"
          }
        },
        "content": {
          "type": "string"
        },
        "aliases": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "id": {
          "type": "string",
          "pattern": "^(WF-\\d{3}|proc\\.[a-z0-9_]+)$"
        },
        "type": {
          "type": "string",
          "const": "process"
        },
        "summary": {
          "type": "string",
          "minLength": 10
        },
        "subject": {
          "type": "string",
          "minLength": 3
        },
        "states": {
          "minItems": 2,
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema0"
          }
        },
        "transitions": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema2"
          }
        },
        "evidence_level": {
          "default": "unknown",
          "type": "string",
          "enum": [
            "observed",
            "compatible",
            "supported",
            "strongly_supported",
            "proven",
            "contradicted",
            "unknown"
          ]
        },
        "specimens": {
          "default": [],
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "email",
                  "chat",
                  "ats",
                  "transcript",
                  "posting",
                  "note"
                ]
              },
              "label": {
                "type": "string",
                "minLength": 3
              },
              "subject": {
                "type": "string"
              },
              "context": {
                "type": "string"
              },
              "lines": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "$ref": "#/definitions/__schema3"
                }
              },
              "reading": {
                "type": "string",
                "minLength": 10
              }
            },
            "required": [
              "kind",
              "label",
              "lines"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "title",
        "id",
        "type",
        "summary",
        "subject",
        "states",
        "transitions"
      ],
      "additionalProperties": false
    },
    "__schema0": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9-]+$"
        },
        "title": {
          "type": "string",
          "minLength": 3
        },
        "kind": {
          "default": "active",
          "type": "string",
          "enum": [
            "initial",
            "active",
            "terminal"
          ]
        },
        "owner": {
          "$ref": "#/definitions/__schema1"
        },
        "description": {
          "type": "string",
          "minLength": 10
        },
        "entities": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "visible_to_candidate": {
          "type": "string"
        },
        "deviations": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "max_dwell_days": {
          "type": "number",
          "exclusiveMinimum": 0
        }
      },
      "required": [
        "id",
        "title",
        "owner",
        "description"
      ],
      "additionalProperties": false
    },
    "__schema1": {
      "type": "string",
      "enum": [
        "actor.candidate",
        "actor.recruiter",
        "actor.hiring_manager",
        "actor.ats_vendor",
        "actor.employer_policy",
        "actor.public_policy_and_industry_standards",
        "actor.client"
      ]
    },
    "__schema2": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "label": {
          "type": "string",
          "minLength": 3
        },
        "owner": {
          "$ref": "#/definitions/__schema1"
        },
        "guard": {
          "type": "string",
          "minLength": 5
        },
        "entities": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "latency_expected_days": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "latency_max_days": {
          "type": "number",
          "exclusiveMinimum": 0
        }
      },
      "required": [
        "from",
        "to",
        "label",
        "owner",
        "guard"
      ],
      "additionalProperties": false
    },
    "__schema3": {
      "type": "object",
      "properties": {
        "speaker": {
          "type": "string"
        },
        "at": {
          "type": "string"
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "tell": {
          "default": false,
          "type": "boolean"
        }
      },
      "required": [
        "text"
      ],
      "additionalProperties": false
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}
