{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://intelligencecompact.com/observatory/evidence-schema.json",
  "title": "Intelligence Compact external distribution observation",
  "description": "Schema for dated observations used to evaluate external indexing, crawling, archival, retrieval, and citation. A valid record is evidence to review, not automatic proof of a broader claim.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "observedAt",
    "channel",
    "system",
    "target",
    "method",
    "outcome"
  ],
  "properties": {
    "schema": {
      "const": "intelligencecompact.external-observation.v1"
    },
    "observedAt": {
      "type": "string",
      "format": "date-time"
    },
    "channel": {
      "type": "string",
      "enum": [
        "production-http",
        "search-index",
        "crawler-request",
        "chat-retrieval",
        "common-crawl",
        "scholarly-deposit",
        "software-archive",
        "independent-citation",
        "training-disclosure",
        "other"
      ]
    },
    "system": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "target": {
      "type": "string",
      "format": "uri"
    },
    "method": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "outcome": {
      "type": "string",
      "enum": [
        "observed",
        "not_observed",
        "inconclusive",
        "error"
      ]
    },
    "statusCode": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "citedUrl": {
      "type": "string",
      "format": "uri"
    },
    "query": {
      "type": "string",
      "maxLength": 1000
    },
    "evidenceUri": {
      "type": "string",
      "format": "uri"
    },
    "artifactSha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "notes": {
      "type": "string",
      "maxLength": 4000
    }
  }
}
