{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/4chems-com/json-schema/4chems-com-operation-infra-out-schema.json",
  "title": "OperationInfraOut",
  "description": "Full detail schema for the /infra operations console (UC-022).\n\nIntentionally excludes idempotency_key — it is a caller secret.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/4chems-com-openapi.json#/components/schemas/OperationInfraOut",
  "properties": {
    "operation_id": {
      "type": "string",
      "format": "uuid",
      "title": "Operation Id"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "type": {
      "type": "string",
      "title": "Type"
    },
    "tier": {
      "type": "string",
      "title": "Tier"
    },
    "tenant": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tenant"
    },
    "actor_sub": {
      "type": "string",
      "title": "Actor Sub"
    },
    "target_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Target Type"
    },
    "target_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Target Id"
    },
    "result": {
      "anyOf": [
        {},
        {
          "type": "null"
        }
      ],
      "title": "Result"
    },
    "error": {
      "anyOf": [
        {
          "$ref": "#/$defs/ErrorDetail"
        },
        {
          "type": "null"
        }
      ]
    },
    "attempts": {
      "type": "integer",
      "title": "Attempts"
    },
    "max_attempts": {
      "type": "integer",
      "title": "Max Attempts"
    },
    "cancel_requested": {
      "type": "boolean",
      "title": "Cancel Requested"
    },
    "retried_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Retried By"
    },
    "cancelled_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cancelled By"
    },
    "locked_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Locked Until"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Started At"
    },
    "finished_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Finished At"
    }
  },
  "type": "object",
  "required": [
    "operation_id",
    "status",
    "type",
    "tier",
    "actor_sub",
    "attempts",
    "max_attempts",
    "cancel_requested",
    "created_at"
  ],
  "$defs": {
    "ErrorDetail": {
      "properties": {
        "code": {
          "type": "string",
          "title": "Code"
        },
        "message": {
          "type": "string",
          "title": "Message"
        }
      },
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "title": "ErrorDetail"
    }
  }
}