{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "openmontage/artifacts/publish_log",
  "title": "Publish Log",
  "description": "Per-platform publish/export results produced by the Publisher agent.",
  "type": "object",
  "required": ["version", "entries"],
  "properties": {
    "version": { "type": "string", "const": "1.0" },
    "entries": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["platform", "status", "timestamp"],
        "properties": {
          "platform": { "type": "string" },
          "status": { "type": "string", "enum": ["published", "exported", "failed", "draft", "pending_review"] },
          "url": { "type": "string" },
          "video_id": { "type": "string" },
          "visibility": { "type": "string", "enum": ["public", "private", "unlisted"] },
          "export_path": { "type": "string" },
          "timestamp": { "type": "string", "format": "date-time" },
          "metadata_used": {
            "type": "object",
            "properties": {
              "title": { "type": "string" },
              "description": { "type": "string" },
              "hashtags": { "type": "array", "items": { "type": "string" } },
              "chapters": { "type": "array", "items": { "type": "object" } }
            }
          },
          "error": { "type": "string" }
        },
        "additionalProperties": false
      }
    },
    "metadata": { "type": "object" }
  },
  "additionalProperties": false
}
