{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://theclusterofwack.com/schemas/wml-v0.1-structured-record.schema.json",
  "title": "W/ML v0.1 Structured Observation",
  "description": "A machine-readable companion to a human W/ML expression. Validation does not establish the truth, sufficiency, or PCI DSS consequence of the recorded observation.",
  "type": "object",
  "required": ["wml", "state", "object", "authority", "recorded_at"],
  "additionalProperties": false,
  "properties": {
    "wml": {"type": "string", "minLength": 2},
    "state": {"enum": ["OBSERVED", "SUSPECTED", "CONFIRMED", "MATERIAL", "UNKNOWN", "ACCUMULATING", "SYSTEMIC", "DEVELOPING", "REMEDIATED", "ELIMINATED"]},
    "object": {"type": "string", "pattern": "^[A-Z][A-Z0-9_]*$"},
    "authority": {"enum": ["PRACTITIONER_POSITION", "PRACTITIONER_METHOD", "ASSESSOR_JUDGMENT", "ORGANIZATIONAL_POSITION", "PCI_SSC_SOURCE", "AI_ASSISTED"]},
    "owner": {"type": ["string", "null"]},
    "requirement": {"type": ["string", "null"]},
    "source": {"type": ["string", "null"]},
    "severity": {"type": ["string", "null"]},
    "confidence": {"type": ["number", "null"], "minimum": 0, "maximum": 1},
    "evidence": {"type": ["string", "null"]},
    "recorded_at": {"type": "string", "format": "date-time"},
    "expires_at": {"type": ["string", "null"], "format": "date-time"},
    "notes": {"type": ["string", "null"]}
  }
}
