{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/seqbench-com/json-schema/seqbench-com-success-response-schema.json",
  "title": "SuccessResponse",
  "description": "Standard success envelope returned by every single-tool call.",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/seqbench-com-openapi.json#/components/schemas/SuccessResponse",
  "type": "object",
  "properties": {
    "ok": {
      "const": true
    },
    "tool": {
      "type": "string",
      "description": "The tool slug that ran."
    },
    "result": {
      "type": "object",
      "additionalProperties": true,
      "description": "Tool-specific output object. Its shape depends on the tool — call `GET /{tool}` or see the docs for each tool's fields."
    },
    "gate": {
      "oneOf": [
        {
          "$ref": "#/$defs/GateResult"
        },
        {
          "type": "null"
        }
      ],
      "description": "Typed QC verdict, or null when the tool defines no gate or the call lacked gating inputs (e.g. no targetTm)."
    },
    "provenance": {
      "$ref": "#/$defs/Provenance"
    }
  },
  "required": [
    "ok",
    "tool",
    "result",
    "provenance"
  ],
  "$defs": {
    "GateCheck": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "severity": {
          "type": "string",
          "enum": [
            "hard",
            "soft"
          ]
        },
        "pass": {
          "type": "boolean"
        },
        "message": {
          "type": "string"
        },
        "value": {
          "type": "number"
        },
        "threshold": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "label",
        "severity",
        "pass",
        "message"
      ]
    },
    "GateResult": {
      "type": "object",
      "properties": {
        "pass": {
          "type": "boolean",
          "description": "True if and only if every hard check passed."
        },
        "checks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GateCheck"
          }
        },
        "notChecked": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Honest list of what this gate does NOT verify."
        }
      },
      "required": [
        "pass",
        "checks",
        "notChecked"
      ]
    },
    "Provenance": {
      "type": "object",
      "properties": {
        "apiVersion": {
          "type": "string"
        },
        "tool": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ],
          "description": "Tool slug, or an array of slugs (one per step) for a workflow."
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp of when the result was generated."
        }
      },
      "required": [
        "apiVersion",
        "tool",
        "generatedAt"
      ]
    }
  }
}