{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://local.retirement-portfolio/schemas/operational_report.schema.json",
  "title": "Operational Report JSON Contract",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "source_json",
    "section_count",
    "sections",
    "summary"
  ],
  "properties": {
    "schema_version": {
      "type": "string",
      "const": "2026-05-24-operational-report-v1"
    },
    "source_json": {
      "type": "string",
      "const": "GatherTradingData.json"
    },
    "section_count": {
      "type": "integer",
      "minimum": 1
    },
    "sections": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "title",
          "markdown"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "markdown": {
            "type": "string",
            "minLength": 1,
            "pattern": "^## .+\\n\\n[\\s\\S]+$"
          }
        }
      }
    },
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "found_settlement",
        "found_heat",
        "found_routing",
        "found_qeh",
        "found_concise_hts_input_sheet",
        "found_reference_price_ledger",
        "canonical_order_ok",
        "json_validation_status"
      ],
      "properties": {
        "found_settlement": {
          "type": "boolean"
        },
        "found_heat": {
          "type": "boolean"
        },
        "found_routing": {
          "type": "boolean"
        },
        "found_qeh": {
          "type": "boolean"
        },
        "found_concise_hts_input_sheet": {
          "type": "boolean"
        },
        "found_reference_price_ledger": {
          "type": "boolean"
        },
        "canonical_order_ok": {
          "type": "boolean"
        },
        "json_validation_status": {
          "type": [
            "string",
            "null"
          ]
        },
        "found_outcome_eval_window": {
          "type": "boolean"
        },
        "outcome_eval_gate": {
          "type": [
            "string",
            "null"
          ]
        },
        "outcome_root_cause_flags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "score_harness_audit": {
          "type": "object",
          "additionalProperties": true
        },
        "found_algorithm_guidance_proof": {
          "type": "boolean"
        },
        "algorithm_guidance_proof_score": {
          "type": [
            "number",
            "null"
          ]
        },
        "algorithm_guidance_proof_gate": {
          "type": [
            "string",
            "null"
          ]
        },
        "calibration_state": {
          "type": [
            "string",
            "null"
          ]
        },
        "honest_proof_score": {
          "type": [
            "number",
            "null"
          ]
        },
        "honest_gate": {
          "type": [
            "string",
            "null"
          ]
        },
        "truth_divergence_abs": {
          "type": [
            "number",
            "null"
          ]
        },
        "truth_divergence_gate": {
          "type": [
            "string",
            "null"
          ]
        },
        "truth_divergence_note": {
          "type": [
            "string",
            "null"
          ]
        },
        "pass_100_allowed": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "published_verdict": {
          "type": [
            "string",
            "null"
          ]
        },
        "headline_score": {
          "type": [
            "number",
            "null"
          ]
        }
      }
    }
  }
}