{
  "$id": "https://hoba.work/schemas/observation.schema.json",
  "$ref": "#/definitions/Observation",
  "definitions": {
    "Observation": {
      "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": "observation"
        },
        "summary": {
          "type": "string",
          "minLength": 10
        },
        "stages": {
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/definitions/__schema1"
          }
        },
        "fidelity": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "direct",
                "euphemism",
                "distortion",
                "noise",
                "void"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "superseded_by": {
          "allOf": [
            {
              "$ref": "#/definitions/__schema0"
            }
          ]
        },
        "evidence_level": {
          "default": "supported",
          "type": "string",
          "enum": [
            "observed",
            "compatible",
            "supported",
            "strongly_supported",
            "proven",
            "contradicted",
            "unknown"
          ]
        },
        "probes": {
          "default": [],
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^PROBE-[A-Z0-9-]+$"
              },
              "action": {
                "type": "string",
                "minLength": 5
              },
              "expected_signal": {
                "type": "string",
                "minLength": 5
              },
              "cost": {
                "type": "string",
                "enum": [
                  "low",
                  "medium",
                  "high"
                ]
              },
              "removability_target": {
                "type": "string",
                "enum": [
                  "candidate",
                  "intermediary",
                  "none"
                ]
              },
              "outcomes": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "$ref": "#/definitions/__schema2"
                    },
                    "label": {
                      "$ref": "#/definitions/__schema3"
                    },
                    "weighs_against": {
                      "$ref": "#/definitions/__schema4"
                    },
                    "excludes": {
                      "$ref": "#/definitions/__schema6"
                    },
                    "because": {
                      "$ref": "#/definitions/__schema7"
                    }
                  },
                  "required": [
                    "id",
                    "label"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "id",
              "action",
              "expected_signal",
              "cost"
            ],
            "additionalProperties": false
          }
        },
        "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/__schema8"
                }
              },
              "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/__schema9"
          }
        }
      },
      "required": [
        "title",
        "id",
        "type",
        "summary",
        "stages",
        "non_inferences"
      ],
      "additionalProperties": false
    },
    "__schema0": {
      "type": "string",
      "pattern": "^(A-\\d{3}|obs\\.[a-z0-9_]+)$"
    },
    "__schema1": {
      "type": "string",
      "enum": [
        "pre-posting",
        "sourcing",
        "ingestion",
        "screening",
        "recruiter",
        "technical",
        "hiring-manager",
        "team",
        "client",
        "compensation",
        "offer",
        "post-offer"
      ]
    },
    "__schema2": {
      "type": "string",
      "pattern": "^[a-z0-9-]+$"
    },
    "__schema3": {
      "type": "string",
      "minLength": 5
    },
    "__schema4": {
      "default": [],
      "type": "array",
      "items": {
        "$ref": "#/definitions/__schema5"
      }
    },
    "__schema5": {
      "type": "string",
      "pattern": "^(M-\\d{3}|mech\\.[a-z0-9_]+)$"
    },
    "__schema6": {
      "default": [],
      "type": "array",
      "items": {
        "$ref": "#/definitions/__schema5"
      }
    },
    "__schema7": {
      "default": "",
      "type": "string"
    },
    "__schema8": {
      "type": "object",
      "properties": {
        "speaker": {
          "type": "string"
        },
        "at": {
          "type": "string"
        },
        "text": {
          "type": "string",
          "minLength": 1
        },
        "tell": {
          "default": false,
          "type": "boolean"
        }
      },
      "required": [
        "text"
      ],
      "additionalProperties": false
    },
    "__schema9": {
      "type": "string"
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}
