{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Publishers use sidecar_rkey(claim AT-URI), one derivation per claim per writer. Readers do not depend on the key: they find a derivation by the claim it names.",
      "key": "any",
      "record": {
        "properties": {
          "attributions": {
            "description": "Same-issuer pub.techne.draft.sourceAttribution records crediting data the method used (for example OpenStreetMap for a geocode).",
            "items": {
              "ref": "com.atproto.repo.strongRef",
              "type": "ref"
            },
            "maxLength": 16,
            "type": "array"
          },
          "basis": {
            "description": "For a location claim: where the position came from.",
            "knownValues": [
              "source",
              "geocoder",
              "venue"
            ],
            "maxLength": 32,
            "type": "string"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "digest": {
            "description": "sha256 hex over the public evidence the method used, so a reader can tell whether it would change.",
            "maxLength": 64,
            "minLength": 64,
            "type": "string"
          },
          "inputs": {
            "description": "Public records the method read.",
            "items": {
              "ref": "com.atproto.repo.strongRef",
              "type": "ref"
            },
            "maxLength": 64,
            "type": "array"
          },
          "method": {
            "ref": "#method",
            "type": "ref"
          },
          "model": {
            "description": "The model id, when a model answered.",
            "maxLength": 128,
            "type": "string"
          },
          "precision": {
            "description": "For a location claim: the grain of the position. Readers must not show a coarser grain as a pin.",
            "knownValues": [
              "point",
              "address",
              "cell",
              "locality"
            ],
            "maxLength": 32,
            "type": "string"
          },
          "reason": {
            "description": "A short machine reason (for a distinctFrom: `time-disjoint`, `place-far`, `venue-conflict`, `low-score`).",
            "maxLength": 64,
            "type": "string"
          },
          "score": {
            "description": "The method's confidence, 0 to 100.",
            "maximum": 100,
            "minimum": 0,
            "type": "integer"
          },
          "signals": {
            "items": {
              "ref": "#signal",
              "type": "ref"
            },
            "maxLength": 24,
            "type": "array"
          },
          "subject": {
            "description": "The claim this explains.",
            "ref": "com.atproto.repo.strongRef",
            "type": "ref"
          },
          "tier": {
            "description": "Who decided: a deterministic rule, a model, or a person adjudicating.",
            "knownValues": [
              "rule",
              "model",
              "person"
            ],
            "maxLength": 32,
            "type": "string"
          }
        },
        "required": [
          "subject",
          "method",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "method": {
      "properties": {
        "codeRepo": {
          "format": "uri",
          "maxLength": 2048,
          "type": "string"
        },
        "commit": {
          "maxLength": 128,
          "type": "string"
        },
        "name": {
          "maxLength": 64,
          "minLength": 1,
          "type": "string"
        },
        "version": {
          "maxLength": 128,
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "name",
        "version"
      ],
      "type": "object"
    },
    "signal": {
      "properties": {
        "name": {
          "knownValues": [
            "titleSimilarity",
            "nameSimilarity",
            "nameContainment",
            "titleFrequency",
            "startDelta",
            "endDelta",
            "samePlaceCluster",
            "distance",
            "placePrecision",
            "sameAddress",
            "addressGeoConflict",
            "categoryConflict",
            "sameUrl",
            "venueNameConflict",
            "placeNameInTitle",
            "placeNameTokens",
            "edgeResolution",
            "ladderRung"
          ],
          "maxLength": 64,
          "type": "string"
        },
        "value": {
          "type": "integer"
        }
      },
      "required": [
        "name",
        "value"
      ],
      "type": "object"
    }
  },
  "description": "How a claim was made. It names the method (name, version, code), the public inputs it read, and the method's own measures (model, score, signals, tier, precision, basis, evidence digest). Its subject is the claim, pinned by CID, so if the claim changes the old derivation visibly stops matching. Readers that don't care how a claim was made ignore it; a trust check or an operator reads it. A record about a derivation is just another record with a subject. Written by the commons rules about their own claims, in the same repo as the claim. PUBLIC when its claim is public; private inputs are never listed here.",
  "id": "pub.techne.draft.derivation",
  "lexicon": 1
}
