{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.mildport.com/spec/benchmark-scorecard.v1.schema.json",
  "title": "Mildport Benchmark Scorecard v1",
  "description": "A benchmark result as a typed, validated claim: per-case and per-track metrics with recorded gaps (a metric that could not run is a stated gap, never a silent omission). The public benchmark itself is not yet live; this schema is published so scorecards are checkable artifacts from day one.",
  "$comment": "License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Generated from the Mildport contract sources — do not edit by hand.",
  "type": "object",
  "properties": {
    "scorecardVersion": {
      "type": "number",
      "const": 1
    },
    "benchmark": {
      "type": "string",
      "const": "openimportbench"
    },
    "corpusVersion": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "importer": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "version": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        }
      },
      "required": [
        "name",
        "version"
      ],
      "additionalProperties": false
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    },
    "caseResults": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "caseId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "track": {
            "type": "string",
            "enum": [
              "crm-csv",
              "invoice",
              "scan-ocr",
              "relational-workbook",
              "scale"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "scored",
              "gap"
            ]
          },
          "gapReason": {
            "type": "string",
            "maxLength": 400
          },
          "metrics": {
            "type": "object",
            "properties": {
              "autoMapRate": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "mappingPrecision": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "mappingRecall": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "extractionFieldAccuracy": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "abstentionPrecision": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "autoMapRate",
              "mappingPrecision",
              "mappingRecall",
              "extractionFieldAccuracy",
              "abstentionPrecision"
            ],
            "additionalProperties": false
          },
          "counts": {
            "type": "object",
            "properties": {
              "expected": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "assigned": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "correct": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "expected",
              "assigned",
              "correct"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "caseId",
          "track",
          "status"
        ],
        "additionalProperties": false
      }
    },
    "tracks": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "track": {
            "type": "string",
            "enum": [
              "crm-csv",
              "invoice",
              "scan-ocr",
              "relational-workbook",
              "scale"
            ]
          },
          "cases": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "scored": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "metrics": {
            "type": "object",
            "properties": {
              "autoMapRate": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "mappingPrecision": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "mappingRecall": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "extractionFieldAccuracy": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "abstentionPrecision": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "autoMapRate",
              "mappingPrecision",
              "mappingRecall",
              "extractionFieldAccuracy",
              "abstentionPrecision"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "track",
          "cases",
          "scored",
          "metrics"
        ],
        "additionalProperties": false
      }
    },
    "overall": {
      "type": "object",
      "properties": {
        "autoMapRate": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "mappingPrecision": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "mappingRecall": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "extractionFieldAccuracy": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "abstentionPrecision": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "autoMapRate",
        "mappingPrecision",
        "mappingRecall",
        "extractionFieldAccuracy",
        "abstentionPrecision"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "scorecardVersion",
    "benchmark",
    "corpusVersion",
    "importer",
    "generatedAt",
    "caseResults",
    "tracks",
    "overall"
  ],
  "additionalProperties": false
}
