{
  "$id": "https://hoba.work/schemas/mechanism.schema.json",
  "$ref": "#/definitions/Mechanism",
  "definitions": {
    "Mechanism": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "minLength": 3
        },
        "status": {
          "default": "active",
          "type": "string",
          "enum": [
            "active",
            "deprecated"
          ]
        },
        "evidence_ids": {
          "default": [],
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema0"
          }
        },
        "content": {
          "type": "string"
        },
        "aliases": {
          "default": [],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "id": {
          "$ref": "#/definitions/__schema1"
        },
        "type": {
          "type": "string",
          "const": "mechanism"
        },
        "summary": {
          "type": "string",
          "minLength": 10
        },
        "operates_at": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema2"
          }
        },
        "emissions": {
          "default": [],
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "artifact": {
                "type": "string",
                "pattern": "^(A-\\d{3}|obs\\.[a-z0-9_]+)$"
              },
              "fidelity": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "direct",
                      "euphemism",
                      "distortion",
                      "noise",
                      "void"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "likelihood": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "evidence": {
                "default": [],
                "type": "array",
                "items": {
                  "$ref": "#/definitions/__schema0"
                }
              },
              "observed_at": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "pre-posting",
                    "sourcing",
                    "ingestion",
                    "screening",
                    "recruiter",
                    "technical",
                    "hiring-manager",
                    "team",
                    "client",
                    "compensation",
                    "offer",
                    "post-offer"
                  ]
                }
              }
            },
            "required": [
              "artifact"
            ],
            "additionalProperties": false
          }
        },
        "facets": {
          "type": "object",
          "properties": {
            "actor": {
              "type": "string",
              "enum": [
                "system",
                "recruiter",
                "hiring-manager",
                "policy",
                "external",
                "candidate"
              ]
            },
            "nature": {
              "type": "string",
              "enum": [
                "rule",
                "incentive",
                "bias",
                "noise",
                "void"
              ]
            },
            "visibility": {
              "type": "string",
              "enum": [
                "observable",
                "inferable",
                "opaque"
              ]
            },
            "removability": {
              "type": "string",
              "enum": [
                "candidate",
                "intermediary",
                "none"
              ]
            }
          },
          "required": [
            "actor",
            "nature",
            "visibility",
            "removability"
          ],
          "additionalProperties": false
        },
        "amplifies": {
          "default": [],
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema1"
          }
        },
        "masks": {
          "default": [],
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema1"
          }
        },
        "superseded_by": {
          "allOf": [
            {
              "$ref": "#/definitions/__schema1"
            }
          ]
        },
        "evidence_level": {
          "default": "supported",
          "type": "string",
          "enum": [
            "observed",
            "compatible",
            "supported",
            "strongly_supported",
            "proven",
            "contradicted",
            "unknown"
          ]
        },
        "honest_baseline": {
          "default": false,
          "type": "boolean"
        },
        "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
          }
        },
        "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
          }
        },
        "non_inferences": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema4"
          }
        }
      },
      "required": [
        "title",
        "id",
        "type",
        "summary",
        "operates_at",
        "facets",
        "non_inferences"
      ],
      "additionalProperties": false
    },
    "__schema0": {
      "type": "string",
      "pattern": "^(EVD-\\d{3}|evidence\\.[a-z0-9_]+)$"
    },
    "__schema1": {
      "type": "string",
      "pattern": "^(M-\\d{3}|mech\\.[a-z0-9_]+)$"
    },
    "__schema2": {
      "type": "string",
      "pattern": "^(B-\\d{3}|bar\\.[a-z0-9_]+)$"
    },
    "__schema3": {
      "type": "object",
      "properties": {
        "speaker": {
          "type": "string"
        },
        "at": {
          "type": "string"
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "tell": {
          "default": false,
          "type": "boolean"
        }
      },
      "required": [
        "text"
      ],
      "additionalProperties": false
    },
    "__schema4": {
      "type": "string"
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}
