{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://bars.commonsware.com/conformance/schema/full-report.schema.json",
  "title": "conformance --full-report",
  "description": "Machine-readable report emitted by 'kbars conformance --full-report' for one run of the conformance suite against a set of fixture files.",
  "type": "object",
  "required": ["reportFormat", "tool", "summary", "files"],
  "additionalProperties": false,
  "properties": {
    "reportFormat": { "type": "string", "description": "The version of this report shape, e.g. \"1.1\"." },
    "tool": { "$ref": "#/$defs/tool" },
    "summary": { "$ref": "#/$defs/summary" },
    "files": { "type": "array", "items": { "$ref": "#/$defs/file" } }
  },
  "$defs": {
    "tool": {
      "type": "object",
      "required": ["name", "version"],
      "additionalProperties": false,
      "properties": {
        "name": { "type": "string", "description": "The tool that produced this report, e.g. \"kBars\"." },
        "version": { "type": "string", "description": "The tool's version string." }
      }
    },
    "summary": {
      "type": "object",
      "required": ["total", "passed", "failed", "ok", "tiers"],
      "additionalProperties": false,
      "properties": {
        "total": { "type": "integer", "minimum": 0, "description": "The total number of cases executed." },
        "passed": { "type": "integer", "minimum": 0, "description": "The number of cases that passed." },
        "failed": { "type": "integer", "minimum": 0, "description": "The number of cases that failed." },
        "ok": { "type": "boolean", "description": "true when failed is zero." },
        "tiers": {
          "type": "array",
          "items": { "$ref": "#/$defs/tierSummary" },
          "description": "Per-tier pass/fail breakdown. Includes only tiers that contributed at least one case, ordered core before full."
        }
      }
    },
    "tierSummary": {
      "type": "object",
      "required": ["tier", "total", "passed", "failed"],
      "additionalProperties": false,
      "properties": {
        "tier": { "type": "string", "enum": ["core", "full"], "description": "The conformance tier these counts cover." },
        "total": { "type": "integer", "minimum": 0, "description": "Cases executed in this tier." },
        "passed": { "type": "integer", "minimum": 0, "description": "Cases that passed in this tier." },
        "failed": { "type": "integer", "minimum": 0, "description": "Cases that failed in this tier." }
      }
    },
    "file": {
      "type": "object",
      "required": ["path", "schema", "version", "tier", "cases"],
      "additionalProperties": false,
      "properties": {
        "path": { "type": "string", "description": "The fixture file's path, as a string." },
        "schema": { "type": "string", "description": "The fixture file's declared schema envelope field." },
        "version": { "type": "string", "description": "The fixture file's declared version envelope field." },
        "tier": { "type": "string", "enum": ["core", "full"], "description": "The conformance tier this fixture belongs to." },
        "cases": { "type": "array", "items": { "$ref": "#/$defs/case" } }
      }
    },
    "case": {
      "type": "object",
      "required": ["name", "status"],
      "additionalProperties": false,
      "properties": {
        "name": { "type": "string", "description": "The case's name field." },
        "status": { "type": "string", "enum": ["pass", "fail"] },
        "expected": { "type": "string", "description": "What the case expected; present only when status is fail." },
        "actual": { "type": "string", "description": "What the case actually produced; present only when status is fail." }
      }
    }
  }
}
