{
  "$id": "https://hoba.work/schemas/intervention.schema.json",
  "$ref": "#/definitions/Intervention",
  "definitions": {
    "Intervention": {
      "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": "intervention"
        },
        "summary": {
          "type": "string",
          "minLength": 10
        },
        "targets": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema1"
          }
        },
        "actor": {
          "type": "string",
          "enum": [
            "employer-policy",
            "recruiter-process",
            "ats-vendor",
            "hiring-manager",
            "candidate-action",
            "industry-standard",
            "policy"
          ]
        },
        "scope": {
          "type": "string",
          "enum": [
            "individual",
            "team",
            "organizational",
            "industry",
            "ecosystem"
          ]
        },
        "cost": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high"
          ]
        },
        "superseded_by": {
          "allOf": [
            {
              "$ref": "#/definitions/__schema0"
            }
          ]
        },
        "evidence_level": {
          "default": "supported",
          "type": "string",
          "enum": [
            "observed",
            "compatible",
            "supported",
            "strongly_supported",
            "proven",
            "contradicted",
            "unknown"
          ]
        },
        "expected_effects": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema2"
          }
        },
        "measurements": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema3"
          }
        },
        "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/__schema4"
                }
              },
              "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",
        "targets",
        "actor",
        "scope",
        "cost",
        "expected_effects",
        "measurements"
      ],
      "additionalProperties": false
    },
    "__schema0": {
      "type": "string",
      "pattern": "^(I-\\d{3}|int\\.[a-z0-9_]+)$"
    },
    "__schema1": {
      "type": "string",
      "pattern": "^([MBPL]-\\d{3}|(mech|bar|pat|loop)\\.[a-z0-9_]+)$"
    },
    "__schema2": {
      "type": "string"
    },
    "__schema3": {
      "type": "string"
    },
    "__schema4": {
      "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#"
}
