{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://daarion.city/schemas/clan-artifact.schema.json",
  "title": "CLAN Artifact",
  "type": "object",
  "required": ["type", "visibility_level", "status", "content", "provenance"],
  "properties": {
    "type": {"type": "string", "minLength": 3},
    "visibility_level": {
      "type": "string",
      "enum": ["public", "interclan", "incircle", "soulsafe", "sacred"]
    },
    "status": {
      "type": "string",
      "enum": ["draft", "needs_confirmation", "waiting_for_consent", "confirmed", "proposed"]
    },
    "content": {
      "oneOf": [
        {"type": "string"},
        {"type": "object", "additionalProperties": true},
        {"type": "array", "items": {"type": "object", "additionalProperties": true}}
      ]
    },
    "provenance": {"$ref": "clan-provenance.schema.json"},
    "required_confirmations": {
      "type": "array",
      "items": {"type": "string"},
      "default": []
    },
    "links": {
      "type": "array",
      "items": {"type": "string"},
      "default": []
    },
    "risk_flags": {
      "type": "array",
      "items": {"type": "string"},
      "default": []
    }
  },
  "additionalProperties": false
}
