{
  "$id": "https://hoba.work/schemas/barrier.schema.json",
  "$ref": "#/definitions/Barrier",
  "definitions": {
    "Barrier": {
      "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": {
          "$ref": "#/definitions/__schema0"
        },
        "type": {
          "type": "string",
          "const": "barrier"
        },
        "stage": {
          "type": "string",
          "enum": [
            "pre-posting",
            "sourcing",
            "ingestion",
            "screening",
            "recruiter",
            "technical",
            "hiring-manager",
            "team",
            "client",
            "compensation",
            "offer",
            "post-offer"
          ]
        },
        "order": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "precedes": {
          "default": [],
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema0"
          }
        },
        "description": {
          "type": "string",
          "minLength": 10
        },
        "pass_condition": {
          "type": "string",
          "minLength": 5
        },
        "superseded_by": {
          "allOf": [
            {
              "$ref": "#/definitions/__schema0"
            }
          ]
        },
        "evidence_level": {
          "default": "strongly_supported",
          "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/__schema1"
                }
              },
              "reading": {
                "type": "string",
                "minLength": 10
              }
            },
            "required": [
              "kind",
              "label",
              "lines"
            ],
            "additionalProperties": false
          }
        },
        "perspectives": {
          "default": [],
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "actor": {
                "type": "string",
                "enum": [
                  "actor.candidate",
                  "actor.recruiter",
                  "actor.hiring_manager",
                  "actor.ats_vendor",
                  "actor.employer_policy",
                  "actor.public_policy_and_industry_standards",
                  "actor.client"
                ]
              },
              "sees": {
                "type": "string",
                "minLength": 20
              },
              "reads": {
                "type": "string",
                "minLength": 20
              },
              "does": {
                "type": "string",
                "minLength": 20
              }
            },
            "required": [
              "actor",
              "sees",
              "reads",
              "does"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "title",
        "id",
        "type",
        "stage",
        "order",
        "description",
        "pass_condition"
      ],
      "additionalProperties": false
    },
    "__schema0": {
      "type": "string",
      "pattern": "^(B-\\d{3}|bar\\.[a-z0-9_]+)$"
    },
    "__schema1": {
      "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#"
}
