{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openssom.org/schema/condition.json",
  "title": "SSOM Condition",
  "type": "object",
  "required": [
    "condition_id",
    "condition_type",
    "subject_ref",
    "lifecycle_state",
    "severity",
    "confidence",
    "detected_at",
    "evidence_refs",
    "provenance",
    "quality_summary",
    "ssom_version"
  ],
  "properties": {
    "condition_id": {
      "type": "string",
      "pattern": "^urn:ssom:condition:"
    },
    "ssom_version": {
      "type": "string"
    },
    "condition_type": {
      "type": "string"
    },
    "subject_ref": {
      "type": "string"
    },
    "lifecycle_state": {
      "enum": [
        "detected",
        "updated",
        "suppressed",
        "escalated",
        "resolved",
        "closed"
      ]
    },
    "severity": {
      "type": "string"
    },
    "confidence": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "detected_at": {
      "type": "string",
      "format": "date-time"
    },
    "resolved_at": {
      "type": "string",
      "format": "date-time"
    },
    "evidence_refs": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1
    },
    "provenance": {
      "$ref": "common.json#/$defs/provenance"
    },
    "quality_summary": {
      "$ref": "common.json#/$defs/quality"
    },
    "policy_evidence": {
      "$ref": "common.json#/$defs/policyEvidence"
    },
    "operational_context_refs": {
      "$ref": "common.json#/$defs/operationalContextRefs"
    },
    "extensions": {
      "type": "object",
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
