{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/riskmodels-app/json-schema/riskmodels-app-artifact-capability-response-schema.json",
  "title": "ArtifactCapabilityResponse",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/riskmodels-app-openapi.json#/components/schemas/ArtifactCapabilityResponse",
  "type": "object",
  "required": [
    "derived_from",
    "subject_kinds",
    "params",
    "pairs",
    "unavailable",
    "counts"
  ],
  "properties": {
    "derived_from": {
      "type": "string",
      "description": "The source constant the response is computed from."
    },
    "discovery": {
      "type": "object",
      "description": "Routes to call before forming a render request.",
      "properties": {
        "capability": {
          "type": "string"
        },
        "as_of": {
          "type": "string"
        }
      }
    },
    "subject_kinds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Every kind render-svc resolves from a subject_id prefix."
    },
    "prerendered_subject_kinds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Kinds render-svc can only read from the store. See each pair's `as_of_latest` for what `latest` does; `GET /api/artifacts/as-of` lists the dates that exist.\n"
    },
    "store_resolved_latest_kinds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Pre-rendered kinds whose `as_of=latest` resolves to the newest stored vintage (cohorts).\n"
    },
    "unimplemented_subject_kinds": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Kinds resolvable from an id prefix that no loader serves, keyed to the reason. Present so a zero-capability kind reads as measured rather than unaudited.\n"
    },
    "params": {
      "type": "object",
      "properties": {
        "vocabulary": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Every key the render request schema accepts."
        },
        "by_slug": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": "Applicability per slug. A slug absent from this map accepts no params. Applicability is not the accepted value set — the artifact module narrows further and answers 422 on a value it does not take.\n"
        }
      }
    },
    "pairs": {
      "type": "array",
      "description": "Verified pairs only. Nothing else may appear here.",
      "items": {
        "type": "object",
        "required": [
          "slug",
          "version",
          "subject_kind",
          "params",
          "prerendered"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "subject_kind": {
            "type": "string"
          },
          "params": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "prerendered": {
            "type": "boolean"
          },
          "as_of_latest": {
            "type": "string",
            "enum": [
              "loader",
              "newest_prerendered",
              "unsupported"
            ],
            "description": "How `as_of=latest` resolves for this pair. `newest_prerendered` reads the newest date from `GET /api/artifacts/as-of`; `unsupported` means pass one of those dates explicitly.\n"
          },
          "notes": {
            "type": "string"
          }
        }
      }
    },
    "unavailable": {
      "type": "array",
      "description": "Pairs measured against prod and refused, with the reason. Recorded rather than deleted so a later audit does not re-add them hopefully.\n",
      "items": {
        "type": "object",
        "required": [
          "slug",
          "subject_kind",
          "status",
          "reason"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "subject_kind": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "degraded",
              "unavailable"
            ]
          },
          "reason": {
            "type": "string"
          }
        }
      }
    },
    "counts": {
      "type": "object",
      "properties": {
        "verified": {
          "type": "integer"
        },
        "unavailable": {
          "type": "integer"
        },
        "slugs": {
          "type": "integer"
        }
      }
    }
  }
}