{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://labelyst.com/schemas/acceptance-replay-result-v1.json",
  "title": "Labelyst Acceptance replay result v1",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "outcome", "fixture", "contract", "environment", "observedAt", "observation"],
  "properties": {
    "schemaVersion": { "const": 1 },
    "outcome": { "enum": ["pass", "divergence", "unable-to-run"] },
    "fixture": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "path", "sha256"],
      "properties": {
        "id": { "type": "string", "maxLength": 120 },
        "path": { "type": "string", "maxLength": 240 },
        "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
      }
    },
    "contract": {
      "type": "object",
      "additionalProperties": false,
      "required": ["path", "sha256"],
      "properties": {
        "path": { "type": "string", "maxLength": 240 },
        "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
      }
    },
    "environment": {
      "type": "object",
      "additionalProperties": false,
      "required": ["runner", "version", "operatingSystem"],
      "properties": {
        "runner": { "enum": ["browser", "cli", "ci"] },
        "version": { "type": "string", "maxLength": 120 },
        "operatingSystem": { "type": "string", "maxLength": 120 }
      }
    },
    "observedAt": { "type": "string", "format": "date-time" },
    "observation": {
      "type": "object",
      "additionalProperties": false,
      "required": ["verdictStatus", "ruleIds", "detail"],
      "properties": {
        "verdictStatus": { "enum": ["pass", "fail", "incomplete", "unavailable"] },
        "ruleIds": { "type": "array", "maxItems": 32, "items": { "type": "string", "maxLength": 120 } },
        "detail": { "type": "string", "maxLength": 2000 }
      }
    }
  }
}
