{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mammoth-io/json-schema/mammoth-io-block-answer-schema.json",
  "title": "BlockAnswer",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mammoth-io-agents-api-openapi.yml#/components/schemas/BlockAnswer",
  "properties": {
    "answered": {
      "type": "boolean"
    },
    "label": {
      "type": "string",
      "default": ""
    },
    "text": {
      "type": "string",
      "default": ""
    },
    "items": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "default": []
    },
    "columns": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "default": []
    },
    "rows": {
      "items": {
        "items": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "type": "array"
      },
      "type": "array",
      "default": []
    },
    "chart": {
      "oneOf": [
        {
          "$ref": "#/$defs/BlockChart"
        },
        {
          "type": "null"
        }
      ]
    },
    "file_id": {
      "oneOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ]
    },
    "written_at": {
      "type": "string",
      "default": ""
    },
    "proof": {
      "oneOf": [
        {
          "$ref": "#/$defs/BlockProof"
        },
        {
          "type": "null"
        }
      ]
    },
    "usual": {
      "oneOf": [
        {
          "$ref": "#/$defs/BlockUsual"
        },
        {
          "type": "null"
        }
      ]
    },
    "history": {
      "items": {
        "oneOf": [
          {
            "type": "number"
          },
          {
            "type": "null"
          }
        ]
      },
      "type": "array",
      "default": []
    },
    "facts_used": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "default": []
    },
    "planned_at": {
      "type": "string",
      "default": ""
    },
    "headline": {
      "oneOf": [
        {
          "$ref": "#/$defs/BlockHeadline"
        },
        {
          "type": "null"
        }
      ]
    },
    "verified": {
      "type": "boolean",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "answered"
  ],
  "$defs": {
    "BlockChart": {
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "bar",
            "line"
          ],
          "default": "bar"
        },
        "labels": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "values": {
          "items": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": "array"
        },
        "measure": {
          "type": "string"
        },
        "periods": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "default": []
        },
        "grain": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "partial": {
          "type": "boolean",
          "default": false
        },
        "adds": {
          "type": "boolean",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "labels",
        "measure",
        "values"
      ],
      "title": "BlockChart"
    },
    "BlockHeadline": {
      "properties": {
        "value": {
          "type": "number"
        },
        "period": {
          "type": "string"
        },
        "grain": {
          "type": "string"
        },
        "measure": {
          "type": "string"
        },
        "change": {
          "oneOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "so_far": {
          "type": "boolean",
          "default": false
        },
        "worse_up": {
          "type": "boolean",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "grain",
        "measure",
        "period",
        "value"
      ],
      "title": "BlockHeadline"
    },
    "BlockProof": {
      "properties": {
        "file_id": {
          "type": "integer"
        },
        "file_name": {
          "type": "string"
        },
        "project_name": {
          "type": "string"
        },
        "rows_read": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "query": {
          "type": "string"
        },
        "sql": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "view_id": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "figure": {
          "oneOf": [
            {
              "additionalProperties": {},
              "type": "object"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "file_id",
        "file_name",
        "project_name",
        "query"
      ],
      "title": "BlockProof"
    },
    "BlockUsual": {
      "properties": {
        "group": {
          "type": "string"
        },
        "period": {
          "type": "string"
        },
        "latest": {
          "type": "number"
        },
        "usual": {
          "type": "number"
        },
        "times_usual": {
          "type": "number"
        },
        "measure": {
          "type": "string"
        },
        "grain": {
          "type": "string"
        },
        "periods": {
          "type": "integer"
        },
        "rate": {
          "type": "boolean",
          "default": false
        },
        "worse_up": {
          "type": "boolean",
          "default": false
        },
        "in_numbers": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "\"24 vs usual 4\": what the chip says in place of a percentage when a count's\nusual is under :data:`SMALL_USUAL` (Gaurav 10-28); None when a percentage reads\nfine.",
          "readOnly": true
        }
      },
      "type": "object",
      "required": [
        "grain",
        "group",
        "latest",
        "measure",
        "period",
        "periods",
        "times_usual",
        "usual"
      ],
      "title": "BlockUsual"
    }
  }
}