{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mearef-dev/json-schema/mearef-dev-certified-extract-schema.json",
  "title": "CertifiedExtract",
  "description": "A signed series certified extract. Not an answer receipt (kind answer_receipt lives on paid answer responses). The signature covers the canonical JSON of certified_extract exactly as received.",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mearef-dev-openapi.json#/components/schemas/CertifiedExtract",
  "type": "object",
  "properties": {
    "certified_extract": {
      "type": "object",
      "properties": {
        "format": {
          "type": "string",
          "const": "afriref-certified-extract/1"
        },
        "issued_at": {
          "type": "string",
          "format": "date-time"
        },
        "extract_id": {
          "type": "string",
          "description": "Stable id derived from the extract's own content"
        },
        "issuer": {
          "type": "object"
        },
        "subject": {
          "type": "object",
          "properties": {
            "country": {
              "type": "string"
            },
            "series": {
              "type": "string"
            }
          }
        },
        "value": {
          "type": "object",
          "description": "Value, unit, effective dates, confidence and staleness, plus confidence_label and coverage_label (signed)"
        },
        "citation": {
          "type": "object",
          "description": "Official source name and URL; includes the rule-vs-instances split for dated series"
        },
        "source_document": {
          "type": "object",
          "description": "The cited document as archived: sha256 over the retrieved bytes, size, content type, first and latest fingerprint dates, and whether a copy is held."
        },
        "verification": {
          "type": "object",
          "description": "How and when the value was last confirmed, and - where the mechanical pass holds it - the value located in the archived document with surrounding context."
        },
        "limitations": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What this extract does NOT certify. Always populated."
        }
      }
    },
    "signature": {
      "type": "object",
      "properties": {
        "alg": {
          "type": "string",
          "const": "Ed25519"
        },
        "key_id": {
          "type": "string"
        },
        "public_key": {
          "type": "string",
          "format": "uri"
        },
        "signed_payload": {
          "type": "string",
          "description": "How to reconstruct the signed bytes"
        },
        "value": {
          "type": "string",
          "description": "Base64 Ed25519 signature"
        }
      }
    },
    "confidence_label": {
      "type": "string",
      "enum": [
        "high",
        "medium",
        "low"
      ],
      "description": "Derived from source type, verification age, stale. Rules: /label-rules"
    },
    "coverage_label": {
      "type": "string",
      "enum": [
        "ready",
        "partial",
        "gap"
      ],
      "description": "ready=complete, partial=limited, gap=no number. Rules: /label-rules"
    },
    "label_basis": {
      "type": "object",
      "description": "Inputs and rule ids behind both labels"
    }
  }
}