{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://alexandrafranco.com/alexandrianovus/library/schema-v0.1.json",
  "title": "Alexandria Great Library Evidence Object v0.1",
  "description": "Schema for provenance-first knowledge objects indexed or admitted to the Great Library. Indexing does not imply scientific validation.",
  "type": "object",
  "required": [
    "id",
    "title",
    "kind",
    "canonical_source",
    "publisher",
    "rights",
    "provenance",
    "retrieved_at",
    "assessment"
  ],
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "kind": {
      "type": "string",
      "description": "Collection, publication, dataset, software artifact, evidence package, archive, agent artifact, or other bounded source class."
    },
    "canonical_source": {
      "type": "string",
      "format": "uri"
    },
    "publisher": {
      "type": "string"
    },
    "rights": {
      "type": "object",
      "required": ["status"],
      "properties": {
        "status": {
          "type": "string",
          "enum": ["PUBLIC_DOMAIN", "OPEN_LICENSE", "ITEM_SPECIFIC", "RESTRICTED", "UNKNOWN"]
        },
        "license": {
          "type": ["string", "null"]
        },
        "reuse_note": {
          "type": ["string", "null"]
        }
      },
      "additionalProperties": true
    },
    "provenance": {
      "type": "object",
      "required": ["source_type"],
      "properties": {
        "source_type": {
          "type": "string"
        },
        "version": {
          "type": ["string", "null"]
        },
        "commit_or_doi": {
          "type": ["string", "null"]
        },
        "retrieval_method": {
          "type": ["string", "null"]
        }
      },
      "additionalProperties": true
    },
    "retrieved_at": {
      "type": "string",
      "format": "date-time"
    },
    "claim_or_question": {
      "type": ["string", "null"]
    },
    "evidence": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "verification": {
      "type": "object",
      "properties": {
        "tests": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "reproducible": {
          "type": ["boolean", "null"]
        },
        "reconstruction_notes": {
          "type": ["string", "null"]
        }
      },
      "additionalProperties": true
    },
    "assessment": {
      "type": "string",
      "enum": [
        "NOT_ASSESSED",
        "SOURCE_ONLY",
        "VERIFIED_LINK",
        "SUPPORTED",
        "REFUTED",
        "CONFLICTED",
        "UNKNOWN"
      ]
    },
    "assessment_authority": {
      "type": ["string", "null"],
      "description": "Who or what made the assessment. AA/BUBi states may only be used when produced by an exact authorized AA primitive."
    },
    "human_access": {
      "type": ["string", "null"],
      "format": "uri"
    },
    "machine_access": {
      "type": ["string", "null"],
      "format": "uri"
    }
  },
  "additionalProperties": true
}
