{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://cementops.io/schemas/plant-issue-intake.schema.json",
  "title": "Plant Issue Intake",
  "description": "Canonical structure for capturing a reported cement plant problem so an AI agent can route and reason about it. Advisory capture only; no action is authorized by this record.",
  "type": "object",
  "version": "0.1.0",
  "required": ["area", "symptom", "severity", "observedAt", "reportedBy"],
  "additionalProperties": false,
  "properties": {
    "issueId": { "type": "string", "description": "Optional unique identifier for the issue." },
    "area": {
      "type": "string",
      "description": "Plant area where the issue was observed.",
      "enum": ["quarry", "crusher", "raw-mill", "kiln", "cooler", "finish-mill", "packing", "utilities", "lab", "other"]
    },
    "equipment": { "type": "string", "description": "Specific equipment or functional location, if known." },
    "symptom": { "type": "string", "description": "Short description of the observed problem." },
    "severity": {
      "type": "string",
      "description": "Reporter-assessed severity. Advisory; final classification is a human decision.",
      "enum": ["low", "medium", "high", "critical"]
    },
    "observedAt": { "type": "string", "format": "date-time", "description": "When the issue was observed (ISO 8601)." },
    "dataAvailable": {
      "type": "array",
      "description": "Data the reporter can supply to support diagnosis.",
      "items": {
        "type": "string",
        "enum": ["xrf-oxides", "free-lime", "raw-meal-fineness", "kiln-bzt", "kiln-amps", "o2-co", "feed-rate", "blaine", "residue", "vibration", "temperatures", "photos", "other"]
      },
      "default": []
    },
    "reportedBy": { "type": "string", "description": "Name or role of the reporter." },
    "shift": { "type": "string", "enum": ["day", "swing", "night", "unknown"], "default": "unknown" },
    "freeText": { "type": "string", "description": "Any additional context in free form." },
    "safetyRelevant": {
      "type": "boolean",
      "description": "Flag if this issue may involve a safety hazard. If true, the agent must direct the reporter to the appropriate human authority and site procedure rather than recommending action.",
      "default": false
    }
  }
}
