{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/edinetdb-jp/json-schema/edinetdb-jp-irsection-provenance-schema.json",
  "title": "IRSectionProvenance",
  "description": "セクションに追加される抽出出所。既存の本文・フィールドは維持する。 `parser` は保存された処理器名（不明な場合は null）、`parser_family` はその分類です。 `regex` は既知の正規表現抽出、`llm` は既知の LLM 処理による本文を示します。 LLM 処理の本文には生成された要約が含まれ、原文の転載とは限りません。 `marker` は解析状態マーカー、`unknown` は出所を分類できないことを示します。 この分類は本文中の数値の検証済み状態や逐語的忠実性を保証しません。",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/edinetdb-jp-ir-sections-api-openapi.yml#/components/schemas/IRSectionProvenance",
  "properties": {
    "body_kind": {
      "description": "本文の種類（2026-09 追加）。source は原資料テキストからの 規則ベース抽出（逐語一致は保証しない）、summary は LLM 生成の要約。 null は判別できない場合（原文の意味ではない）。parser ごとに生成コードを 確認した対応表で判定し、parser 名から推測しない。",
      "enum": [
        "source",
        "summary",
        null
      ],
      "type": [
        "string",
        "null"
      ]
    },
    "parser": {
      "description": "保存された処理器名（未加工の parser 列の値）。欠損または複数 parser の集約で 出所が一意でない場合は null。未知の文字列もそのまま返す。",
      "type": [
        "string",
        "null"
      ]
    },
    "parser_family": {
      "description": "parser の分類。regex は既知の正規表現抽出、llm は既知の LLM 処理、 marker は解析状態マーカー、unknown は出所を分類できないことを示す。 原文と要約の区別や数値の正確性は保証しない。",
      "enum": [
        "regex",
        "llm",
        "marker",
        "unknown"
      ],
      "type": "string"
    },
    "summary": {
      "description": "要約本文。`include_summary=true` を指定した時だけ、body_kind が summary の行で body と同じ文字列が入る（既定 false では常に null。キーは常に存在する）。 現在は body と同文なので既定で返さない（応答サイズ倍増の回避）。今後 body を 原文専用に切り替えた後は、要約はこのフィールドで返す。",
      "type": [
        "string",
        "null"
      ]
    },
    "summary_meta": {
      "allOf": [
        {
          "$ref": "#/$defs/IRSummaryMeta"
        }
      ],
      "description": "body_kind が summary の行でのみ非 null。"
    }
  },
  "type": "object",
  "$defs": {
    "IRSummaryMeta": {
      "description": "LLM 要約行のメタ情報。numbers_verified は現時点で常に false = この要約内の 数値は財務フィールドと突合していない（誤値の判定ではなく、財務フィールド側の 検証状態を変えるものでもない）。",
      "properties": {
        "numbers_verified": {
          "description": "現在は常に false。true を返す条件は今後定義する （同じ企業・期間定義・指標・連結区分・実績/予想・単位・訂正版まで一致した時のみ）。",
          "enum": [
            false
          ],
          "type": "boolean"
        },
        "parser": {
          "description": "行の parser（出所が単体で分かるように重複して返す）。",
          "type": "string"
        },
        "processed_at": {
          "description": "対応元行の処理時刻（parsed_at、UTC）。LLM 行では要約を書き込んだ バッチの処理時刻。集約経路で単一に定まらない場合は null。",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "verification_targets": {
          "$ref": "#/$defs/IRVerificationTargets"
        }
      },
      "type": [
        "object",
        "null"
      ]
    },
    "IRVerificationTargets": {
      "description": "企業単位の確認先。要約内の数値と財務行・期間・指標の対応は示さない。 対応する財務項目が無い数値は会社ページ経由で原資料を確認する。",
      "properties": {
        "edinet_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "mcp_tools": {
          "description": "確認先の MCP tool（決算短信は get_earnings が先頭、それ以外は get_financials が先頭）。",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "note": {
          "description": "企業単位の案内であることの注記（英語の固定文）。",
          "type": "string"
        },
        "period_hint": {
          "description": "PDF メタ由来の未検証のヒント。対応するデータの存在を保証しない。",
          "type": [
            "string",
            "null"
          ]
        },
        "rest_paths": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    }
  }
}