{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/blvkware-dev/json-schema/blvkware-dev-check-response-schema.json",
  "title": "CheckResponse",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/blvkware-dev-openapi.json#/components/schemas/CheckResponse",
  "properties": {
    "checkedAt": {
      "format": "date-time",
      "type": "string"
    },
    "receipt": {
      "$ref": "#/$defs/Receipt"
    },
    "results": {
      "items": {
        "$ref": "#/$defs/Result"
      },
      "type": "array"
    },
    "safeToProceed": {
      "type": "boolean"
    },
    "summary": {
      "type": "object"
    }
  },
  "required": [
    "checkedAt",
    "results"
  ],
  "type": "object",
  "$defs": {
    "Evidence": {
      "description": "Everything that was true at decision time.",
      "properties": {
        "attestations": {
          "type": "integer"
        },
        "attestationsBeforeRegistration": {
          "type": "integer"
        },
        "firstObserved": {
          "type": "string"
        },
        "lastObserved": {
          "type": "string"
        },
        "nearestExisting": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "note": {
          "type": "string"
        },
        "observedFrom": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "phantomSince": {
          "type": "string"
        },
        "publisherPriorPackages": {
          "type": "integer"
        },
        "registeredAt": {
          "type": "string"
        },
        "registryCheckedAt": {
          "format": "date-time",
          "type": "string"
        },
        "registryStatus": {
          "enum": [
            "found",
            "not_found",
            "deprecated",
            "unreachable"
          ],
          "type": "string"
        },
        "stale": {
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "Receipt": {
      "description": "Ed25519 signature over the RFC 8785 canonical JSON of `checkedAt` and `results`. Verify against https://blvkware.dev/.well-known/blvkware-attestation.pub",
      "properties": {
        "alg": {
          "const": "Ed25519",
          "type": "string"
        },
        "canonicalization": {
          "const": "RFC8785",
          "type": "string"
        },
        "covers": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "keyId": {
          "type": "string"
        },
        "signature": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "Result": {
      "properties": {
        "confidence": {
          "maximum": 1,
          "minimum": 0,
          "type": "number"
        },
        "evidence": {
          "$ref": "#/$defs/Evidence"
        },
        "namespace": {
          "type": "string"
        },
        "reason": {
          "description": "Only on the `unknown` verdict.",
          "enum": [
            "namespace_unsupported",
            "registry_unreachable",
            "malformed_identifier",
            "quota_exceeded"
          ],
          "type": "string"
        },
        "recommendation": {
          "type": "string"
        },
        "successor": {
          "description": "The identifier to use instead. Present only when it can be named with confidence.",
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "verdict": {
          "enum": [
            "exists",
            "deprecated",
            "absent",
            "phantom",
            "squat",
            "unknown"
          ],
          "type": "string"
        }
      },
      "required": [
        "namespace",
        "value",
        "verdict",
        "confidence"
      ],
      "type": "object"
    }
  }
}