{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openbrandexchange.com/schemas/v0.1/Provenance.json",
  "type": "object",
  "title": "Provenance",
  "description": "Origin of the image, required so AI provenance (EU AI Act art. 50) survives the brand -> retailer -> shop chain.",
  "properties": {
    "ai_generated": {
      "type": "boolean",
      "description": "True when the image is (mostly) generated by AI. A publisher that knows this MUST say so."
    },
    "ai_edited": {
      "type": "boolean",
      "description": "True when a real photo was materially edited with generative AI (e.g. background, model, garment fit)."
    },
    "source": {
      "type": "string",
      "enum": [
        "photo",
        "generated",
        "composite"
      ],
      "description": "photo: camera original (possibly retouched); generated: synthesised; composite: photo combined with generated parts."
    },
    "c2pa": {
      "type": "string",
      "enum": [
        "embedded",
        "sidecar",
        "none"
      ],
      "description": "Where C2PA Content Credentials live. embedded: inside the original bytes (preserved: originals are served unmodified)."
    },
    "c2pa_manifest_url": {
      "anyOf": [
        {
          "$ref": "Common.json#/$defs/Url",
          "description": "Sidecar manifest URL (when c2pa is sidecar)."
        },
        {
          "type": "null"
        }
      ]
    },
    "generator": {
      "type": [
        "string",
        "null"
      ],
      "description": "Optional free-text tool/model name.",
      "maxLength": 200
    }
  },
  "required": [
    "ai_generated",
    "ai_edited",
    "source",
    "c2pa"
  ],
  "additionalProperties": false,
  "patternProperties": {
    "^x-[a-z0-9]+-[a-z0-9_-]+$": true
  }
}
