def METHOD_NAME(data: bytes) -> Caveat:
    loaded = json.loads(data)
    # Our original caveats were implemented as a mapping with arbitrary keys,
    # so if we've gotten one of our those, we'll attempt to adapt it to our
    # new format.
    if isinstance(loaded, Mapping):
        loaded = _legacy.adapt(loaded)
        if loaded is None:
            raise CaveatDeserializationError("caveat must be an array")
    if not isinstance(loaded, Sequence) or isinstance(loaded, str):
        raise CaveatDeserializationError("caveat must be an array")
    if not len(loaded):
        raise CaveatDeserializationError("caveat array cannot be empty")
    tag, *fields = loaded
    cls = _caveat_registry.lookup(tag)
    if cls is None:
        raise CaveatDeserializationError(f"caveat has unknown tag: {tag}")
    return cls.__deserialize__(fields)