{
  "$id": "https://hoba.work/schemas/pattern.schema.json",
  "$ref": "#/definitions/Pattern",
  "definitions": {
    "Pattern": {
      "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": "pattern"
        },
        "summary": {
          "type": "string",
          "minLength": 10
        },
        "required_artifacts": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema1"
          }
        },
        "compatible_mechanisms": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema2"
          }
        },
        "trigger_rule": {
          "type": "string",
          "minLength": 10
        },
        "establishes": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema3"
          }
        },
        "non_inferences": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema4"
          }
        },
        "interventions": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^(I-\\d{3}|int\\.[a-z0-9_]+)$"
          }
        },
        "superseded_by": {
          "allOf": [
            {
              "$ref": "#/definitions/__schema0"
            }
          ]
        },
        "evidence_level": {
          "default": "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/__schema5"
                }
              },
              "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",
        "summary",
        "required_artifacts",
        "compatible_mechanisms",
        "trigger_rule",
        "establishes",
        "non_inferences"
      ],
      "additionalProperties": false
    },
    "__schema0": {
      "type": "string",
      "pattern": "^(P-\\d{3}|pat\\.[a-z0-9_]+)$"
    },
    "__schema1": {
      "type": "string",
      "pattern": "^(A-\\d{3}|obs\\.[a-z0-9_]+)$"
    },
    "__schema2": {
      "type": "string",
      "pattern": "^(M-\\d{3}|mech\\.[a-z0-9_]+)$"
    },
    "__schema3": {
      "type": "string"
    },
    "__schema4": {
      "type": "string"
    },
    "__schema5": {
      "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#"
}
