{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "The provenance of one MyData record. One provenance record per subject record, holding the latest state only: its record key is `<subject collection NSID>:<subject record key>`. It is written in the same commit as its subject and deleted together with it. It is not a MyData category or section and is not part of the assembled payload. Provenance does not decide access rights or visibility.",
      "key": "any",
      "record": {
        "properties": {
          "agent": {
            "description": "A URI for whoever wrote this version of the subject record: the DID of a person, service or agent, or, for a client without a DID, a URI that identifies that client.",
            "format": "uri",
            "type": "string"
          },
          "evidence": {
            "description": "URIs of the evidence for the value: the AT-URI of an archive record, an attestation record of the issuing institution, the identifier of a verifiable credential, and so on.",
            "items": {
              "description": "A URI pointing at one piece of evidence.",
              "format": "uri",
              "type": "string"
            },
            "type": "array"
          },
          "fields": {
            "description": "The keys of the subject record's data that this provenance describes. When absent, it describes the whole subject record.",
            "items": {
              "description": "The name of one key directly under the subject record's data.",
              "type": "string"
            },
            "type": "array"
          },
          "method": {
            "description": "How the value of the subject record was obtained: user_stated (entered or said by the user), inferred (inferred by a service or agent), imported (taken from an external service or file), issued (issued by an institution), observed (measured or observed by a device or service).",
            "knownValues": [
              "user_stated",
              "inferred",
              "imported",
              "issued",
              "observed"
            ],
            "type": "string"
          },
          "recordedAt": {
            "description": "When this version of the subject record was written. Not the time the subject record was first created (_meta.createdAt), nor the time the value actually occurred or was observed.",
            "format": "datetime",
            "type": "string"
          },
          "subject": {
            "description": "The AT-URI and CID of the subject record this provenance describes. If the CID is not the subject record's current CID, this provenance describes an earlier version and the provenance of the current version is unknown.",
            "ref": "#recordRef",
            "type": "ref"
          }
        },
        "required": [
          "subject"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "recordRef": {
      "description": "A reference to one version of one record (AT-URI and CID). Same shape and same stored value as com.atproto.repo.strongRef; defined in this document so that it resolves with the documents this repository publishes alone.",
      "properties": {
        "cid": {
          "description": "The CID of the version of the subject record this provenance describes.",
          "format": "cid",
          "type": "string"
        },
        "uri": {
          "description": "The AT-URI of the subject record.",
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "cid"
      ],
      "type": "object"
    }
  },
  "id": "ai.newnal.mydata.provenance",
  "lexicon": 1
}
