{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/huggingbay-xyz/json-schema/huggingbay-xyz-request-intent-surface-schema.json",
  "title": "RequestIntentSurface",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/huggingbay-xyz-openapi.json#/components/schemas/RequestIntentSurface",
  "type": "object",
  "required": [
    "schema",
    "intentId",
    "intentKey",
    "kind",
    "title",
    "description",
    "canonicalUrl",
    "jsonUrl",
    "generatedAt",
    "identity",
    "lifecycle",
    "fulfillment",
    "authorityRefs",
    "nextAction",
    "license",
    "supersededBy",
    "blockers",
    "uncertainty",
    "claims",
    "surfaceDigest",
    "etag"
  ],
  "properties": {
    "schema": {
      "const": "hugging-bay.request-intent.v1"
    },
    "intentId": {
      "type": "string",
      "pattern": "^hbri_[a-f0-9]{32}$"
    },
    "intentKey": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "kind": {
      "type": "string",
      "enum": [
        "exact-representation",
        "dataset",
        "runtime-verification",
        "preservation",
        "feature"
      ]
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "canonicalUrl": {
      "type": "string",
      "format": "uri"
    },
    "jsonUrl": {
      "type": "string",
      "format": "uri"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "identity": {
      "type": "object",
      "required": [
        "constraints",
        "exactSelector",
        "kind",
        "publicVisibility"
      ],
      "properties": {
        "constraints": {
          "type": "object",
          "properties": {
            "commercialUse": {
              "enum": [
                "required",
                "preferred",
                "not-required"
              ]
            },
            "format": {
              "type": "string"
            },
            "hardwareTier": {
              "type": "string"
            },
            "contextTokens": {
              "type": "integer",
              "minimum": 0
            },
            "minBytes": {
              "type": "integer",
              "minimum": 0
            },
            "maxBytes": {
              "type": "integer",
              "minimum": 0
            },
            "quantPreference": {
              "type": "string"
            },
            "task": {
              "type": "string"
            },
            "licenseId": {
              "type": "string"
            },
            "licensePolicy": {
              "type": "string"
            },
            "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": false
        },
        "exactSelector": {
          "type": "object",
          "properties": {
            "representationId": {
              "type": [
                "string",
                "null"
              ]
            },
            "quant": {
              "type": [
                "string",
                "null"
              ]
            },
            "config": {
              "type": [
                "string",
                "null"
              ]
            },
            "split": {
              "type": [
                "string",
                "null"
              ]
            },
            "subset": {
              "type": [
                "string",
                "null"
              ]
            },
            "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": false
        },
        "kind": {
          "type": "string"
        },
        "publicVisibility": {
          "const": "public"
        },
        "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": false
    },
    "lifecycle": {
      "type": "object",
      "required": [
        "state",
        "reason",
        "evidenceCutoff"
      ],
      "properties": {
        "state": {
          "enum": [
            "recorded",
            "under-review",
            "evidence-needed",
            "blocked",
            "fulfilled",
            "rejected",
            "superseded"
          ]
        },
        "reason": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,63}$"
        },
        "evidenceCutoff": {
          "type": "string",
          "format": "date-time"
        },
        "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": false
    },
    "fulfillment": {
      "type": "object",
      "required": [
        "fulfilled",
        "authoritativeFulfillmentRef"
      ],
      "properties": {
        "fulfilled": {
          "type": "boolean"
        },
        "authoritativeFulfillmentRef": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "required": [
                "authority",
                "recordId",
                "ref"
              ],
              "properties": {
                "authority": {
                  "type": "string"
                },
                "recordId": {
                  "type": "string"
                },
                "ref": {
                  "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."
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "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": false
    },
    "authorityRefs": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "items": {
        "type": "object",
        "required": [
          "authority",
          "refKind",
          "ref",
          "state"
        ],
        "properties": {
          "authority": {
            "type": "string"
          },
          "refKind": {
            "type": "string"
          },
          "ref": {
            "type": "string",
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "state": {
            "enum": [
              "unobserved",
              "fulfilled"
            ]
          },
          "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": false
      }
    },
    "nextAction": {
      "type": "string"
    },
    "license": {
      "type": [
        "object",
        "null"
      ]
    },
    "supersededBy": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "blockers": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "code",
          "detail"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "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": false
      }
    },
    "uncertainty": {
      "type": "array",
      "maxItems": 0
    },
    "claims": {
      "type": "array",
      "minItems": 11,
      "maxItems": 12,
      "items": {
        "type": "object",
        "required": [
          "id",
          "label",
          "value",
          "evidenceSource",
          "evidenceDigest",
          "timestamp",
          "canonicalVerificationUrl",
          "citationId",
          "digest"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "evidenceSource": {
            "type": "string"
          },
          "evidenceDigest": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^sha256:[a-f0-9]{64}$"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "canonicalVerificationUrl": {
            "type": "string",
            "format": "uri"
          },
          "citationId": {
            "type": "string"
          },
          "digest": {
            "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."
          }
        },
        "additionalProperties": false
      }
    },
    "surfaceDigest": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "etag": {
      "type": "string",
      "pattern": "^W/\"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."
    }
  },
  "additionalProperties": false
}