{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/huggingbay-xyz/json-schema/huggingbay-xyz-mirror-request-status-schema.json",
  "title": "MirrorRequestStatus",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/huggingbay-xyz-mirrors-api-openapi.yml#/components/schemas/MirrorRequestStatus",
  "type": "object",
  "required": [
    "schemaVersion",
    "requestId",
    "status",
    "storedStatus",
    "terminalDecision",
    "outcomes"
  ],
  "properties": {
    "schemaVersion": {
      "const": "hugging-bay.mirror-request-status.v1"
    },
    "requestId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "requested",
        "partial",
        "blocked",
        "completed",
        "quarantined",
        "rejected"
      ]
    },
    "storedStatus": {
      "type": "string"
    },
    "terminalDecision": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "auditId",
        "commandId",
        "transitionEventId",
        "decisionKind",
        "auditDigest"
      ],
      "additionalProperties": false,
      "properties": {
        "auditId": {
          "type": "string",
          "pattern": "^mirror-request-terminal-[a-f0-9]{32}$"
        },
        "commandId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{7,127}$"
        },
        "transitionEventId": {
          "type": "string",
          "pattern": "^mirror-request-terminal-transition-[a-f0-9]{32}$"
        },
        "decisionKind": {
          "type": "string",
          "enum": [
            "blocked",
            "completed",
            "quarantined",
            "rejected"
          ]
        },
        "auditDigest": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "object",
              "required": [
                "summary"
              ],
              "properties": {
                "summary": {
                  "type": "string"
                },
                "downloadable": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "noteMessage": {
          "type": "string",
          "description": "Original route note, when a public qualification occupies note."
        }
      }
    },
    "outcomes": {
      "type": "object",
      "required": [
        "mirrorComplete",
        "usable",
        "successfulRun",
        "successfulRunEvidence"
      ],
      "additionalProperties": false,
      "properties": {
        "mirrorComplete": {
          "type": "boolean",
          "description": "True only for a matching audited completed mirror-request transition."
        },
        "usable": {
          "type": "boolean",
          "description": "True only when the recorded selected-representation state is the complete, runnable state."
        },
        "successfulRun": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Null when this request-status surface has not evaluated accepted-run evidence."
        },
        "successfulRunEvidence": {
          "type": "string",
          "enum": [
            "not-evaluated-by-request-status"
          ]
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "object",
              "required": [
                "summary"
              ],
              "properties": {
                "summary": {
                  "type": "string"
                },
                "downloadable": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "noteMessage": {
          "type": "string",
          "description": "Original route note, when a public qualification occupies note."
        }
      }
    }
  },
  "additionalProperties": true
}