{
  "$ref": "#/definitions/Derivation",
  "definitions": {
    "Derivation": {
      "type": "object",
      "properties": {
        "method": {
          "type": "string",
          "enum": [
            "direct",
            "members_sum",
            "members_partial",
            "cut_estimate",
            "pool_estimate",
            "temporal",
            "others_sum",
            "absent"
          ],
          "description": "How a DerivedResult value was obtained.\n\ndirect: value came directly from a matching poll output (not estimated).\nmembers_sum: sum of all member choices; every member resolved directly (not estimated).\nmembers_partial: sum of present members; one or more members estimated.\ncut_estimate: half of lower_cut_percent from the same poll output.\npool_estimate: distributed share of the unaccounted pool value.\nothers_sum: sum of all poll values not mapped to any named choice (for others_id).\ntemporal: estimated from neighboring polls by date (reserved, not yet implemented).\nabsent: no basis for estimation; value_percent will be null."
        },
        "source_output_type": {
          "type": "string",
          "description": "output_type of the raw PollOutput used as source."
        },
        "source_tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "tags[] of the raw PollOutput used as source."
        },
        "source_members": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "choice_ids of member choices that were successfully resolved."
        },
        "missing_members": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "choice_ids of member choices that could not be resolved."
        },
        "cut_value": {
          "type": "number",
          "description": "The lower_cut_percent value from the poll output (for cut_estimate)."
        },
        "cut_fraction": {
          "type": "number",
          "description": "Fraction of cut_value assigned as the estimate. Default 0.5."
        },
        "pool_choice_id": {
          "type": "string",
          "description": "choice_id of the pool choice, typically the \"others\" bucket (for pool_estimate)."
        },
        "pool_value": {
          "type": "number",
          "description": "Measured value of the pool choice in the poll output."
        },
        "pool_peers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Other choice_ids sharing the pool with this one."
        },
        "pool_method": {
          "type": "string",
          "enum": [
            "equal",
            "proportional"
          ],
          "description": "Distribution method applied to the pool."
        },
        "temporal_source_polls": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Poll ids used as source for temporal estimation (reserved)."
        },
        "temporal_method": {
          "type": "string",
          "description": "Method used to combine temporal sources (reserved)."
        },
        "temporal_window_days": {
          "type": "number",
          "description": "Time window (days) used to select neighboring polls (reserved)."
        },
        "extras": {
          "type": "object",
          "additionalProperties": {},
          "description": "Arbitrary extra provenance fields."
        }
      },
      "required": [
        "method"
      ],
      "additionalProperties": false,
      "description": "Full provenance record attached to every DerivedResult.\n\nLayer: compute (embedded in DerivedResult)\n\nRecords exactly how the value was obtained from source poll data. Only fields relevant to the specific method need to be populated."
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}