{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://autonomi.dev/loki-mode/schemas/seams.schema.json",
  "title": "Loki Migration Seams",
  "description": "Validates seams.json produced by the migration engine understand phase.",
  "oneOf": [
    {
      "type": "array",
      "items": { "$ref": "#/definitions/SeamInfo" }
    },
    {
      "type": "object",
      "properties": {
        "seams": {
          "type": "array",
          "items": { "$ref": "#/definitions/SeamInfo" }
        }
      },
      "required": ["seams"],
      "additionalProperties": false
    }
  ],
  "definitions": {
    "SeamInfo": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the seam."
        },
        "description": {
          "type": "string",
          "default": "",
          "description": "Human-readable description of the seam."
        },
        "type": {
          "type": "string",
          "default": "",
          "description": "Seam type (e.g. api, module, database, config)."
        },
        "location": {
          "type": "string",
          "default": "",
          "description": "Location of the seam in the codebase."
        },
        "name": {
          "type": "string",
          "default": "",
          "description": "Human-readable name for the seam."
        },
        "priority": {
          "type": "string",
          "default": "medium",
          "description": "Priority level for addressing this seam."
        },
        "files": {
          "type": "array",
          "items": { "type": "string" },
          "default": [],
          "description": "Files involved in this seam."
        },
        "dependencies": {
          "type": "array",
          "items": { "type": "string" },
          "default": [],
          "description": "Dependencies of this seam on other components."
        },
        "complexity": {
          "type": "string",
          "default": "",
          "description": "Complexity assessment of the seam."
        },
        "confidence": {
          "type": "number",
          "minimum": 0.0,
          "maximum": 1.0,
          "default": 0.0,
          "description": "Confidence score for this seam detection (0.0 to 1.0)."
        },
        "suggested_interface": {
          "type": "string",
          "default": "",
          "description": "Suggested interface definition for this seam."
        }
      },
      "required": ["id"],
      "additionalProperties": false
    }
  }
}
