{
  "$id": "https://llamon.ai/schemas/diagnostic/v1.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "통합 Diagnostic wire shape — Phase Zero T0.1. SDK 진단 family (PRJ/LDR/FLW/EDG/RES, 그리고 SaveConflict 에 할당 예정인 SCF prefix) 의 최소 공통 부분집합.",
  "properties": {
    "actual": {
      "type": [
        "string",
        "null"
      ]
    },
    "category": {
      "enum": [
        "parse",
        "config_load",
        "flow_graph",
        "edge_rule",
        "unused_resource",
        "save_conflict"
      ],
      "type": "string"
    },
    "code": {
      "description": "3 글자 prefix + 3 자리 숫자로 구성된 안정 식별자.",
      "pattern": "^(PRJ|LDR|FLW|EDG|RES|SCF)[0-9]{3}$",
      "type": "string"
    },
    "expected": {
      "type": [
        "string",
        "null"
      ]
    },
    "location": {
      "additionalProperties": false,
      "properties": {
        "col": {
          "minimum": 1,
          "type": [
            "integer",
            "null"
          ]
        },
        "edge": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": [
            "string",
            "null"
          ]
        },
        "file": {
          "type": [
            "string",
            "null"
          ]
        },
        "line": {
          "minimum": 1,
          "type": [
            "integer",
            "null"
          ]
        },
        "node": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "message": {
      "type": "string"
    },
    "repair": {
      "additionalProperties": false,
      "properties": {
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "type": "string"
        },
        "safety": {
          "enum": [
            "safe",
            "manual"
          ],
          "type": "string"
        }
      },
      "required": [
        "id",
        "safety"
      ],
      "type": [
        "object",
        "null"
      ]
    },
    "severity": {
      "default": "error",
      "enum": [
        "error",
        "warning"
      ],
      "type": "string"
    }
  },
  "required": [
    "code",
    "category",
    "message"
  ],
  "title": "Diagnostic",
  "type": "object"
}
