{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://axis.efeonce.org/contracts/candidate/glitch-line-intent.v0.2.schema.json",
  "title": "Glitch — composition intent (efeonce.glitch-line 0.2.0, stable desde 2026-09-29; sólo Glitch)",
  "description": "Intent de UNA pieza de Glitch. Datos, nunca coordenadas libres ni colores: pnpm glitch:resolve toma todos los valores de glitchLine. Las listas de piezas y formatos se verifican contra el token en la prueba del contrato. 0.2.0: `edition` acepta { kind: weekly | flash, number? }; un Glitch Flash (piezas flash-*) no lleva número de edición ni `progress`.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "franchise",
    "piece"
  ],
  "properties": {
    "contract": {
      "const": "efeonce.glitch-line"
    },
    "version": {
      "enum": [
        "0.1.0",
        "0.2.0",
        "0.3.0",
        "0.4.0"
      ]
    },
    "franchise": {
      "const": "glitch"
    },
    "piece": {
      "enum": [
        "portada-a",
        "portada-b",
        "portada-c",
        "interior",
        "interior-noticia-1",
        "interior-lente",
        "contraportada",
        "blog-banner-a",
        "blog-banner-b",
        "blog-banner-c",
        "blog-banner-square-a",
        "blog-banner-square-b",
        "blog-banner-square-c",
        "blog-banner-interno",
        "reel-portada",
        "reel-overlay",
        "reel-tarjeta-final",
        "vlog-overlay",
        "vlog-tarjeta-final",
        "historia-9x16",
        "carrusel-panoramico",
        "flash-portada",
        "flash-interior",
        "flash-contraportada",
        "flash-blog-banner",
        "flash-blog-banner-interno",
        "flash-threads",
        "flash-dato",
        "flash-evidencia",
        "flash-pasos",
        "flash-en-el-blog"
      ]
    },
    "format": {
      "enum": [
        "linkedin-4x5",
        "landscape-16x9",
        "square-1x1",
        "blog-inline-16x9",
        "reel-9x16"
      ]
    },
    "edition": {
      "description": "La semanal #N como número (0.1.0 y 0.2.0), o 0.2.0: { kind, number? }. Un Flash nunca trae número.",
      "oneOf": [
        {
          "type": "integer",
          "minimum": 1
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "kind": {
              "enum": [
                "weekly",
                "flash"
              ]
            },
            "number": {
              "type": "integer",
              "minimum": 1
            }
          }
        }
      ]
    },
    "progress": {
      "description": "0.2.0 · Avance n/8 de la lámina en la edición semanal. El Flash no lo lleva.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "current"
      ],
      "properties": {
        "current": {
          "type": "integer",
          "minimum": 1,
          "maximum": 8
        },
        "total": {
          "const": 8
        }
      }
    },
    "previousCoverTemplate": {
      "enum": [
        "A",
        "B",
        "C",
        null
      ]
    },
    "headline": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "entry": {
          "type": "string",
          "minLength": 1
        },
        "close": {
          "type": "string",
          "minLength": 1
        },
        "entryWeight": {
          "type": "integer"
        },
        "closeWeight": {
          "type": "integer"
        }
      }
    },
    "spheres": {
      "type": "array",
      "items": {
        "enum": [
          "apple",
          "lens"
        ]
      },
      "maxItems": 1
    },
    "surface": {
      "enum": [
        "dark",
        "light"
      ]
    },
    "accentUses": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "role",
          "on"
        ],
        "properties": {
          "role": {
            "enum": [
              "text",
              "border",
              "separator",
              "fill",
              "graphic"
            ]
          },
          "on": {
            "enum": [
              "dark",
              "light"
            ]
          }
        }
      }
    },
    "overlays": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "box"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "box": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "x",
              "y",
              "w",
              "h"
            ],
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              },
              "w": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "h": {
                "type": "number",
                "exclusiveMinimum": 0
              }
            }
          }
        }
      }
    },
    "faces": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "x",
          "y",
          "w",
          "h"
        ],
        "properties": {
          "x": {
            "type": "number"
          },
          "y": {
            "type": "number"
          },
          "w": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "h": {
            "type": "number",
            "exclusiveMinimum": 0
          }
        }
      }
    },
    "bytes": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "box"
        ],
        "properties": {
          "box": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "x",
              "y",
              "w",
              "h"
            ],
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              },
              "w": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "h": {
                "type": "number",
                "exclusiveMinimum": 0
              }
            }
          },
          "edge": {
            "enum": [
              "bottom",
              "side"
            ]
          }
        }
      }
    },
    "narrator": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "text"
      ],
      "properties": {
        "text": {
          "type": "string",
          "minLength": 1
        },
        "rotationDeg": {
          "type": "number",
          "minimum": -5,
          "maximum": -3
        }
      }
    },
    "slogan": {
      "type": "boolean"
    },
    "urlBubble": {
      "const": false
    },
    "iconRendering": {
      "const": "flat"
    },
    "line": {
      "enum": [
        "glitch"
      ],
      "description": "0.3.0 · Línea propia de Glitch (operador, 2026-11-16). Si se declara, es \"glitch\": nunca growth ni otra línea de servicio (issue line-not-own)."
    }
  }
}
