//! SQL object lifecycle registry entries.

use super::{
    SqlContractObject, SqlLifecycle,
    contract_catalog_objects::{CATALOG_SQL_CONTRACT_OBJECTS, CATALOG_SQL_CONTRACT_OBJECTS_LEN},
    contract_pgvector_ownership_objects::{
        PGVECTOR_OWNERSHIP_SQL_CONTRACT_OBJECTS, PGVECTOR_OWNERSHIP_SQL_CONTRACT_OBJECTS_LEN,
    },
};

const FUNCTION_SQL_CONTRACT_OBJECTS_LEN: usize = 470;
const SQL_CONTRACT_OBJECTS_LEN: usize = CATALOG_SQL_CONTRACT_OBJECTS_LEN
    + PGVECTOR_OWNERSHIP_SQL_CONTRACT_OBJECTS_LEN
    + FUNCTION_SQL_CONTRACT_OBJECTS_LEN;

static SQL_CONTRACT_OBJECTS_ARRAY: [SqlContractObject; SQL_CONTRACT_OBJECTS_LEN] =
    build_sql_contract_objects();

/// SQL objects intentionally covered by the first release registry.
///
/// The registry classifies installed objects by compatibility lifecycle. Tests
/// compare this list with PostgreSQL catalogs so SQL-visible additions require a
/// conscious stable, experimental, or internal decision.
pub(crate) const SQL_CONTRACT_OBJECTS: &[SqlContractObject] = &SQL_CONTRACT_OBJECTS_ARRAY;

const fn build_sql_contract_objects() -> [SqlContractObject; SQL_CONTRACT_OBJECTS_LEN] {
    let mut objects = [CATALOG_SQL_CONTRACT_OBJECTS[0]; SQL_CONTRACT_OBJECTS_LEN];
    let mut output_index = 0;
    let mut input_index = 0;

    while input_index < CATALOG_SQL_CONTRACT_OBJECTS_LEN {
        objects[output_index] = CATALOG_SQL_CONTRACT_OBJECTS[input_index];
        output_index += 1;
        input_index += 1;
    }

    input_index = 0;
    while input_index < PGVECTOR_OWNERSHIP_SQL_CONTRACT_OBJECTS_LEN {
        objects[output_index] = PGVECTOR_OWNERSHIP_SQL_CONTRACT_OBJECTS[input_index];
        output_index += 1;
        input_index += 1;
    }

    input_index = 0;
    while input_index < FUNCTION_SQL_CONTRACT_OBJECTS_LEN {
        objects[output_index] = FUNCTION_SQL_CONTRACT_OBJECTS[input_index];
        output_index += 1;
        input_index += 1;
    }

    objects
}

#[rustfmt::skip]
const FUNCTION_SQL_CONTRACT_OBJECTS: &[SqlContractObject; FUNCTION_SQL_CONTRACT_OBJECTS_LEN] = &[
    SqlContractObject::function("cancel_exact_first_build", "collection text", SqlLifecycle::Experimental),
    SqlContractObject::function("claim_exact_first_build", "collection text, worker_id text, lease_millis integer", SqlLifecycle::Experimental),
    SqlContractObject::function("exact_first_progress", "collection text", SqlLifecycle::Experimental),
    SqlContractObject::function("fail_exact_first_build", "collection text, plan_revision bigint, lease_token bigint, error_code text", SqlLifecycle::Experimental),
    SqlContractObject::function("heartbeat_exact_first_build", "collection text, plan_revision bigint, lease_token bigint, lease_millis integer", SqlLifecycle::Experimental),
    SqlContractObject::function("publish_exact_first_build", "collection text, plan_revision bigint, lease_token bigint", SqlLifecycle::Experimental),
    SqlContractObject::function("retry_exact_first_build", "collection text", SqlLifecycle::Experimental),
    SqlContractObject::function("exact_first_search", "collection text, binding text, vector vector, \"limit\" integer", SqlLifecycle::Experimental),
    SqlContractObject::function("apply_exact_first_plan", "collection text, plan_revision bigint, policy text", SqlLifecycle::Experimental),
    SqlContractObject::function("exact_first_advisor", "collection text, objectives jsonb", SqlLifecycle::Experimental),
    SqlContractObject::function("exact_first_readiness", "collection text", SqlLifecycle::Experimental),
    SqlContractObject::function("inspect_exact_first_source", "source_table text, options jsonb", SqlLifecycle::Experimental),
    SqlContractObject::function("register_exact_first", "collection text, source_table text, specification jsonb, apply_policy text", SqlLifecycle::Experimental),
    SqlContractObject::function("_document_chunk_raw_datum_bytes", "value anyelement", SqlLifecycle::Internal),
    SqlContractObject::function("_document_chunk_source_key_visible", "document_source_id bigint, source_key text", SqlLifecycle::Internal),
    SqlContractObject::function("bitvec_out", "input bitvec", SqlLifecycle::Internal),
    SqlContractObject::function("bitvec_send", "input bitvec", SqlLifecycle::Internal),
    SqlContractObject::function("halfvec_in", "input cstring", SqlLifecycle::Internal),
    SqlContractObject::function("halfvec_out", "input halfvec", SqlLifecycle::Internal),
    SqlContractObject::function("sparsevec_in", "input cstring", SqlLifecycle::Internal),
    SqlContractObject::function("sparsevec_out", "input sparsevec", SqlLifecycle::Internal),
    SqlContractObject::function("vector_in", "input cstring", SqlLifecycle::Internal),
    SqlContractObject::function("vector_out", "input vector", SqlLifecycle::Internal),
    SqlContractObject::function("int8vec_out", "input int8vec", SqlLifecycle::Internal),
    SqlContractObject::function("int8vec_send", "input int8vec", SqlLifecycle::Internal),
    SqlContractObject::function("uint8vec_out", "input uint8vec", SqlLifecycle::Internal),
    SqlContractObject::function("uint8vec_send", "input uint8vec", SqlLifecycle::Internal),
    SqlContractObject::function("_reject_embedding_profile_mutation", "", SqlLifecycle::Internal),
    SqlContractObject::function("_cleanup_semantic_rerank_requests", "p_limit integer", SqlLifecycle::Internal),
    SqlContractObject::function("_finalize_semantic_rerank_request", "p_request_id bigint, p_response_sha256 bytea, p_final_status text, p_degraded_reason text, p_final_result jsonb", SqlLifecycle::Internal),
    SqlContractObject::function("_insert_semantic_rerank_request", "p_collection_id bigint, p_rerank_source_id bigint, p_registration_revision bigint, p_filter_binding_sha256 bytea, p_model_name text, p_model_revision bigint, p_query_text text, p_filter_json jsonb, p_failure_policy text, p_allow_partial boolean, p_expires_at_micros bigint, p_candidates jsonb", SqlLifecycle::Internal),
    SqlContractObject::function("_refresh_semantic_rerank_source", "p_collection_id bigint, p_source_name text", SqlLifecycle::Internal),
    SqlContractObject::function("_register_semantic_rerank_source", "p_collection_id bigint, p_source_name text, p_text_column text, p_source_version_column text", SqlLifecycle::Internal),
    SqlContractObject::function("cleanup_semantic_rerank_requests", "\"limit\" integer", SqlLifecycle::Experimental),
    SqlContractObject::function("finalize_semantic_rerank", "request_id bigint, response jsonb, failure_reason text", SqlLifecycle::Experimental),
    SqlContractObject::function("prepare_semantic_rerank", "collection text, source_name text, query text, candidates jsonb, model text, model_revision bigint, ttl_millis bigint, failure_policy text, filter jsonb, allow_partial boolean", SqlLifecycle::Experimental),
    SqlContractObject::function("register_semantic_rerank_source", "collection text, source_name text, text_column text, source_version_column text", SqlLifecycle::Experimental),
    SqlContractObject::function("_cancel_document_chunk_job", "p_job_id bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_claim_document_chunk_jobs", "p_limit integer, p_lease_millis integer, p_worker_id text", SqlLifecycle::Internal),
    SqlContractObject::function("_complete_document_chunk_publication", "p_job_id bigint, p_lease_token bigint, p_response_sha256 bytea, p_projection_sha256 bytea, p_chunk_count integer, p_token_count bigint, p_staging_bytes bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_checkpoint_document_chunk_job", "p_job_id bigint, p_lease_token bigint, p_status text, p_processed_units bigint, p_total_units bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_consume_document_chunk_permit", "operation integer, identity_a bigint, identity_b bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_document_chunk_outbox_trigger", "", SqlLifecycle::Internal),
    SqlContractObject::function("_drain_chunking_profile_alias", "p_alias_id bigint, p_profile_id bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_enqueue_document_chunk_job", "p_document_source_id bigint, p_source_key text, p_source_version bigint, p_source_sha256 bytea, p_chunking_profile_id bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_heartbeat_document_chunk_job", "p_job_id bigint, p_lease_token bigint, p_lease_millis integer", SqlLifecycle::Internal),
    SqlContractObject::function("_fail_document_chunk_job", "p_job_id bigint, p_lease_token bigint, p_error_code text", SqlLifecycle::Internal),
    SqlContractObject::function("_install_document_chunk_outbox_trigger", "p_document_source_id bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_invalidate_document_chunk_aliases", "p_document_source_id bigint, p_source_keys text[]", SqlLifecycle::Internal),
    SqlContractObject::function("_load_document_chunk_staging", "p_job_id bigint, p_lease_token bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_load_document_chunk_lease_expiry", "p_job_id bigint, p_lease_token bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_load_document_chunk_claim_source", "p_job_id bigint, p_lease_token bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_lock_document_chunk_source", "p_document_source_id bigint, p_source_key text, p_source_version bigint, p_source_bytes bigint, p_max_document_bytes bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_lock_document_chunk_job_alias", "p_job_id bigint, p_lease_token bigint, p_allow_ready_retained boolean", SqlLifecycle::Internal),
    SqlContractObject::function("_lock_document_chunk_read_alias", "p_document_source_id bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_release_document_chunk_claim", "p_job_id bigint, p_lease_token bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_register_chunking_profile", "p_profile_name text, p_parser_revision text, p_target_tokens integer, p_max_tokens integer, p_min_tokens integer, p_overlap_tokens integer, p_max_document_bytes bigint, p_include_structure_context boolean, p_configuration_sha256 bytea", SqlLifecycle::Internal),
    SqlContractObject::function("_prepare_chunking_profile_alias", "p_alias_id bigint, p_profile_id bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_promote_chunking_profile_alias", "p_alias_id bigint, p_profile_id bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_register_document_source", "p_collection_id bigint, p_source_name text, p_rerank_source_id bigint, p_chunking_profile_id bigint, p_chunking_profile_alias_id bigint, p_projection_table_oid oid, p_projection_schema_name text, p_projection_table_name text, p_projection_column_attnums smallint[], p_projection_column_type_oids oid[], p_projection_column_collation_oids bigint[]", SqlLifecycle::Internal),
    SqlContractObject::function("_retry_document_chunk_job", "p_job_id bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_rebuild_document_chunk_job", "p_job_id bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_refresh_document_chunk_source", "p_collection_id bigint, p_source_name text", SqlLifecycle::Internal),
    SqlContractObject::function("_rollback_document_chunk_generation", "p_document_source_id bigint, p_source_key text, p_generation_id bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_rollback_chunking_profile_alias", "p_alias_id bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_stage_document_chunk_response", "p_job_id bigint, p_lease_token bigint, p_response_json jsonb, p_response_sha256 bytea, p_chunk_count integer, p_token_count bigint, p_staging_bytes bigint", SqlLifecycle::Internal),
    SqlContractObject::function("_supersede_document_chunk_claim", "p_job_id bigint, p_lease_token bigint", SqlLifecycle::Internal),
    SqlContractObject::function("cancel_document_chunk_job", "job_id bigint", SqlLifecycle::Experimental),
    SqlContractObject::function("claim_document_chunk_jobs", "\"limit\" integer, lease_millis integer, worker_id text", SqlLifecycle::Experimental),
    SqlContractObject::function("checkpoint_document_chunk_job", "job_id bigint, lease_token bigint, status text, processed_units bigint, total_units bigint", SqlLifecycle::Experimental),
    SqlContractObject::function("create_document_chunk_projection", "table_name text", SqlLifecycle::Experimental),
    SqlContractObject::function("current_document_chunks", "collection text, source_name text, source_keys text[]", SqlLifecycle::Experimental),
    SqlContractObject::function("document_chunking_progress", "collection text, source_name text", SqlLifecycle::Experimental),
    SqlContractObject::function("drain_chunking_profile_alias", "alias_name text, profile_name text", SqlLifecycle::Experimental),
    SqlContractObject::function("enqueue_document_chunking", "collection text, source_name text, source_keys text[]", SqlLifecycle::Experimental),
    SqlContractObject::function("enqueue_document_chunking_profile", "collection text, source_name text, profile_name text, source_keys text[]", SqlLifecycle::Experimental),
    SqlContractObject::function("fail_document_chunk_job", "job_id bigint, lease_token bigint, error_code text", SqlLifecycle::Experimental),
    SqlContractObject::function("fake_process_document_chunk_job", "job_id bigint, lease_token bigint", SqlLifecycle::Internal),
    SqlContractObject::function("heartbeat_document_chunk_job", "job_id bigint, lease_token bigint, lease_millis integer", SqlLifecycle::Experimental),
    SqlContractObject::function("install_document_chunk_trigger", "collection text, source_name text", SqlLifecycle::Experimental),
    SqlContractObject::function("invalidate_document_chunks", "collection text, source_name text, source_keys text[]", SqlLifecycle::Experimental),
    SqlContractObject::function("publish_document_chunk_generation", "job_id bigint, lease_token bigint", SqlLifecycle::Experimental),
    SqlContractObject::function("prepare_chunking_profile_alias", "alias_name text, profile_name text", SqlLifecycle::Experimental),
    SqlContractObject::function("promote_chunking_profile_alias", "alias_name text, profile_name text", SqlLifecycle::Experimental),
    SqlContractObject::function("register_chunking_profile", "profile_name text, parser text, target_tokens integer, max_tokens integer, min_tokens integer, overlap_tokens integer, max_document_bytes bigint, include_structure_context boolean", SqlLifecycle::Experimental),
    SqlContractObject::function("register_document_source", "collection text, source_name text, text_column text, source_version_column text, projection_table text, profile_name text", SqlLifecycle::Experimental),
    SqlContractObject::function("retry_document_chunk_job", "job_id bigint", SqlLifecycle::Experimental),
    SqlContractObject::function("rebuild_document_chunk_job", "job_id bigint", SqlLifecycle::Experimental),
    SqlContractObject::function("rollback_document_chunk_generation", "collection text, source_name text, source_key text, generation_id bigint", SqlLifecycle::Experimental),
    SqlContractObject::function("rollback_chunking_profile_alias", "alias_name text", SqlLifecycle::Experimental),
    SqlContractObject::function("stage_document_chunks", "job_id bigint, lease_token bigint, response jsonb", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "bitvec_from_provider_bytes",
        "collection text, profile_name text, payload bytea",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "bitvec_typmod_input",
        "input cstring, _type_oid oid, typmod integer",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "bitvec_typmod_receive",
        "internal internal, _type_oid oid, typmod integer",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "embedding_profile_explain",
        "collection text, profile_name text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("embedding_profiles", "", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "register_embedding_profile",
        "collection text, profile_name text, source_column text, hnsw_index text, profile jsonb, lifecycle text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("int8vec", "input text", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "int8vec_cmp",
        "\"left\" int8vec, \"right\" int8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "int8vec_cosine_distance",
        "\"left\" int8vec, \"right\" int8vec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("int8vec_dims", "vector int8vec", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "int8vec_enforce_typmod",
        "vector int8vec, typmod integer, _explicit boolean",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "int8vec_eq",
        "\"left\" int8vec, \"right\" int8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "int8vec_from_integer_array",
        "\"values\" integer[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "int8vec_from_smallint_array",
        "\"values\" smallint[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "int8vec_from_profile",
        "collection text, profile_name text, \"values\" smallint[]",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("int8vec_from_vector", "vector vector", SqlLifecycle::Internal),
    SqlContractObject::function(
        "int8vec_ge",
        "\"left\" int8vec, \"right\" int8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "int8vec_gt",
        "\"left\" int8vec, \"right\" int8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "int8vec_l1_distance",
        "\"left\" int8vec, \"right\" int8vec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "int8vec_l2_distance",
        "\"left\" int8vec, \"right\" int8vec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "int8vec_le",
        "\"left\" int8vec, \"right\" int8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "int8vec_lt",
        "\"left\" int8vec, \"right\" int8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "int8vec_ne",
        "\"left\" int8vec, \"right\" int8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "int8vec_negative_inner_product",
        "\"left\" int8vec, \"right\" int8vec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "int8vec_inner_product",
        "\"left\" int8vec, \"right\" int8vec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "int8vec_sum_transition",
        "state bigint[], value int8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "int8vec_to_smallint_array",
        "vector int8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("int8vec_to_vector", "vector int8vec", SqlLifecycle::Internal),
    SqlContractObject::function("int8vec_typmod_in", "modifiers cstring[]", SqlLifecycle::Internal),
    SqlContractObject::function(
        "int8vec_typmod_input",
        "input cstring, _type_oid oid, typmod integer",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("int8vec_typmod_out", "typmod integer", SqlLifecycle::Internal),
    SqlContractObject::function(
        "int8vec_typmod_receive",
        "internal internal, _type_oid oid, typmod integer",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("integer_vector_avg_final", "state bigint[]", SqlLifecycle::Internal),
    SqlContractObject::function("integer_vector_sum_final", "state bigint[]", SqlLifecycle::Internal),
    SqlContractObject::function("uint8vec", "input text", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "uint8vec_cmp",
        "\"left\" uint8vec, \"right\" uint8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "uint8vec_cosine_distance",
        "\"left\" uint8vec, \"right\" uint8vec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("uint8vec_dims", "vector uint8vec", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "uint8vec_enforce_typmod",
        "vector uint8vec, typmod integer, _explicit boolean",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "uint8vec_eq",
        "\"left\" uint8vec, \"right\" uint8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "uint8vec_from_integer_array",
        "\"values\" integer[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "uint8vec_from_smallint_array",
        "\"values\" smallint[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "uint8vec_from_profile",
        "collection text, profile_name text, \"values\" smallint[]",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("uint8vec_from_vector", "vector vector", SqlLifecycle::Internal),
    SqlContractObject::function(
        "uint8vec_ge",
        "\"left\" uint8vec, \"right\" uint8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "uint8vec_gt",
        "\"left\" uint8vec, \"right\" uint8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "uint8vec_l1_distance",
        "\"left\" uint8vec, \"right\" uint8vec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "uint8vec_l2_distance",
        "\"left\" uint8vec, \"right\" uint8vec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "uint8vec_le",
        "\"left\" uint8vec, \"right\" uint8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "uint8vec_lt",
        "\"left\" uint8vec, \"right\" uint8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "uint8vec_ne",
        "\"left\" uint8vec, \"right\" uint8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "uint8vec_negative_inner_product",
        "\"left\" uint8vec, \"right\" uint8vec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "uint8vec_inner_product",
        "\"left\" uint8vec, \"right\" uint8vec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "uint8vec_sum_transition",
        "state bigint[], value uint8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "uint8vec_to_smallint_array",
        "vector uint8vec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("uint8vec_to_vector", "vector uint8vec", SqlLifecycle::Internal),
    SqlContractObject::function("uint8vec_typmod_in", "modifiers cstring[]", SqlLifecycle::Internal),
    SqlContractObject::function(
        "uint8vec_typmod_input",
        "input cstring, _type_oid oid, typmod integer",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("uint8vec_typmod_out", "typmod integer", SqlLifecycle::Internal),
    SqlContractObject::function(
        "uint8vec_typmod_receive",
        "internal internal, _type_oid oid, typmod integer",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("avg", "int8vec", SqlLifecycle::Experimental),
    SqlContractObject::function("avg", "uint8vec", SqlLifecycle::Experimental),
    SqlContractObject::function("sum", "int8vec", SqlLifecycle::Experimental),
    SqlContractObject::function("sum", "uint8vec", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "_mmap_hnsw_artifact_candidates",
        "collection text, artifact_name text, vector vector, max_mapped_bytes bigint, candidate_limit integer, \"limit\" integer",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_capture_late_interaction_tokens",
        "",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_begin_late_interaction_registration",
        "p_collection_id bigint, p_source_table_oid oid, p_source_schema_name text, p_source_table_name text, p_token_column_name text, p_token_attnum smallint",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_store_late_interaction_tokens",
        "p_collection_id bigint, p_source_key text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_finish_late_interaction_registration",
        "p_collection_id bigint, p_dimensions integer",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_late_interaction_ann_candidate_points",
        "p_collection_id bigint, p_query vector, p_limit integer",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_prepare_late_interaction_repair",
        "p_collection_id bigint, p_source_table_oid oid, p_token_attnum smallint",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_cleanup_late_interaction_registration",
        "",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "register_late_interaction",
        "collection text, source_table text, token_source text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "repair_late_interaction",
        "collection text, batch_size integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "search_late_interaction_ann",
        "collection text, query_vectors vector[], candidates_per_query integer, \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "explain_late_interaction_ann",
        "collection text, query_vectors vector[], candidates_per_query integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "collection_info",
        "collection_name text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "collection_limits",
        "collection_name text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "collection_vectors",
        "collection_name text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "collection_sparse_vectors",
        "collection_name text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("collection_aliases", "", SqlLifecycle::Stable),
    SqlContractObject::function(
        "clear_payload",
        "collection_name text, source_keys text[]",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "backfill_points",
        "collection_name text, batch_size integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "bulk_delete_points",
        "collection_name text, source_keys text[], batch_size integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "bulk_upsert_points",
        "collection_name text, source_keys text[], batch_size integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "configure_collection_limits",
        "collection_name text, strict_mode boolean, max_dimensions integer, max_vectors integer, max_points bigint, max_filter_nodes integer, max_search_limit integer, max_candidate_budget integer, query_timeout_ms integer, max_index_memory_bytes bigint",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "configure_vector",
        "collection_name text, vector_name text, hnsw_options jsonb, quantization_options jsonb, status text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "configure_sparse_vector",
        "collection_name text, vector_name text, storage_options jsonb, index_options jsonb, status text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("build_jobs", "collection text", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "_reject_build_job_progress_regression",
        "",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_enforce_build_job_terminal_state",
        "",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_publish_generation",
        "target_generation bigint",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_pin_generation",
        "target_collection bigint, target_alias text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_unpin_generation",
        "target_generation bigint",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "cosine_distance",
        "\"left\" vector, \"right\" vector",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "create_collection",
        "collection_name text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "create_collection",
        "collection_name text, table_name text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "create_collection_alias",
        "alias_name text, target_collection_name text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "create_embedding_migration",
        "collection text, source_profile text, target_profile text, total_points bigint",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("count", "collection text", SqlLifecycle::Stable),
    SqlContractObject::function(
        "count",
        "collection text, filter text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "delete_points",
        "collection_name text, source_keys text[]",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "delete_payload",
        "collection_name text, source_keys text[], payload_keys text[]",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "discover",
        "collection text, context_point_ids bigint[], \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "drop_collection",
        "collection_name text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "drop_collection_alias",
        "alias_name text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function("embedding_migrations", "", SqlLifecycle::Stable),
    SqlContractObject::function(
        "estimate_index_memory",
        "index_name text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "explore",
        "collection text, context_point_ids bigint[], \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "explain",
        "collection text, lexical_source text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "facet",
        "collection text, field text, filter text, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "grouped_search",
        "collection text, vector vector, group_by text, group_limit integer, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "grouped_search",
        "collection text, vector_name text, vector vector, group_by text, group_limit integer, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function("hamming_distance", "\"left\" bit, \"right\" bit", SqlLifecycle::Experimental),
    SqlContractObject::function("hamming_distance", "\"left\" bit varying, \"right\" bit varying", SqlLifecycle::Experimental),
    SqlContractObject::function("avg", "vector", SqlLifecycle::Stable),
    SqlContractObject::function("avg", "halfvec", SqlLifecycle::Experimental),
    SqlContractObject::function("avg", "sparsevec", SqlLifecycle::Experimental),
    SqlContractObject::function("bit_and", "bitvec", SqlLifecycle::Experimental),
    SqlContractObject::function("bit_or", "bitvec", SqlLifecycle::Experimental),
    SqlContractObject::function("bitvec", "input text", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "bitvec_and_transition",
        "state boolean[], value bitvec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "bitvec_bits_final",
        "state boolean[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("bitvec_cmp", "\"left\" bitvec, \"right\" bitvec", SqlLifecycle::Internal),
    SqlContractObject::function("bitvec_dims", "vector bitvec", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "bitvec_enforce_typmod",
        "vector bitvec, typmod integer, _explicit boolean",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("bitvec_eq", "\"left\" bitvec, \"right\" bitvec", SqlLifecycle::Internal),
    SqlContractObject::function(
        "bitvec_from_bool_array",
        "bits boolean[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("bitvec_ge", "\"left\" bitvec, \"right\" bitvec", SqlLifecycle::Internal),
    SqlContractObject::function("bitvec_gt", "\"left\" bitvec, \"right\" bitvec", SqlLifecycle::Internal),
    SqlContractObject::function("bitvec_hamming_distance", "\"left\" bitvec, \"right\" bitvec", SqlLifecycle::Experimental),
    SqlContractObject::function("bitvec_jaccard_distance", "\"left\" bitvec, \"right\" bitvec", SqlLifecycle::Experimental),
    SqlContractObject::function("bitvec_le", "\"left\" bitvec, \"right\" bitvec", SqlLifecycle::Internal),
    SqlContractObject::function("bitvec_lt", "\"left\" bitvec, \"right\" bitvec", SqlLifecycle::Internal),
    SqlContractObject::function("bitvec_ne", "\"left\" bitvec, \"right\" bitvec", SqlLifecycle::Internal),
    SqlContractObject::function(
        "bitvec_or_transition",
        "state boolean[], value bitvec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("bitvec_typmod_in", "modifiers cstring[]", SqlLifecycle::Internal),
    SqlContractObject::function("bitvec_typmod_out", "typmod integer", SqlLifecycle::Internal),
    SqlContractObject::function(
        "bitvec_to_bool_array",
        "vector bitvec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "binary_quantize",
        "vector vector",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("sum", "vector", SqlLifecycle::Stable),
    SqlContractObject::function("sum", "halfvec", SqlLifecycle::Experimental),
    SqlContractObject::function("sum", "sparsevec", SqlLifecycle::Experimental),
    SqlContractObject::function("halfvec", "input text", SqlLifecycle::Experimental),
    SqlContractObject::function("halfvec_cmp", "\"left\" halfvec, \"right\" halfvec", SqlLifecycle::Internal),
    SqlContractObject::function(
        "halfvec_cosine_distance",
        "\"left\" halfvec, \"right\" halfvec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("halfvec_dims", "vector halfvec", SqlLifecycle::Experimental),
    SqlContractObject::function("halfvec_enforce_typmod", "vector halfvec, typmod integer, _explicit boolean", SqlLifecycle::Internal),
    SqlContractObject::function("halfvec_eq", "\"left\" halfvec, \"right\" halfvec", SqlLifecycle::Internal),
    SqlContractObject::function("halfvec_avg_final", "state real[]", SqlLifecycle::Internal),
    SqlContractObject::function(
        "halfvec_from_double_array",
        "\"values\" double precision[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "halfvec_from_integer_array",
        "\"values\" integer[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "halfvec_from_real_array",
        "\"values\" real[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("halfvec_ge", "\"left\" halfvec, \"right\" halfvec", SqlLifecycle::Internal),
    SqlContractObject::function("halfvec_gt", "\"left\" halfvec, \"right\" halfvec", SqlLifecycle::Internal),
    SqlContractObject::function("halfvec_typmod_in", "modifiers cstring[]", SqlLifecycle::Internal),
    SqlContractObject::function("halfvec_typmod_out", "typmod integer", SqlLifecycle::Internal),
    SqlContractObject::function(
        "halfvec_inner_product",
        "\"left\" halfvec, \"right\" halfvec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "halfvec_l1_distance",
        "\"left\" halfvec, \"right\" halfvec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("halfvec_le", "\"left\" halfvec, \"right\" halfvec", SqlLifecycle::Internal),
    SqlContractObject::function("halfvec_sum_final", "state real[]", SqlLifecycle::Internal),
    SqlContractObject::function(
        "halfvec_sum_transition",
        "state real[], value halfvec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "halfvec_to_real_array",
        "vector halfvec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "halfvec_to_vector",
        "vector halfvec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("halfvec_lt", "\"left\" halfvec, \"right\" halfvec", SqlLifecycle::Internal),
    SqlContractObject::function(
        "halfvec_l2_distance",
        "\"left\" halfvec, \"right\" halfvec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("halfvec_ne", "\"left\" halfvec, \"right\" halfvec", SqlLifecycle::Internal),
    SqlContractObject::function(
        "halfvec_negative_inner_product",
        "\"left\" halfvec, \"right\" halfvec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("hnsw_handler", "internal", SqlLifecycle::Experimental),
    SqlContractObject::function("ivfflat_handler", "internal", SqlLifecycle::Experimental),
    SqlContractObject::function("index_advisor", "collection text", SqlLifecycle::Stable),
    SqlContractObject::function("index_diagnostics", "index_name text", SqlLifecycle::Stable),
    SqlContractObject::function("index_status", "index_name text", SqlLifecycle::Stable),
    SqlContractObject::function(
        "inner_product",
        "\"left\" vector, \"right\" vector",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "hnsw_l2_distance",
        "\"left\" vector, \"right\" vector",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("jaccard_distance", "\"left\" bit, \"right\" bit", SqlLifecycle::Experimental),
    SqlContractObject::function("jaccard_distance", "\"left\" bit varying, \"right\" bit varying", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "l1_distance",
        "\"left\" vector, \"right\" vector",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "l2_distance",
        "\"left\" vector, \"right\" vector",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "negative_inner_product",
        "\"left\" vector, \"right\" vector",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "optimization_status",
        "collection text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "product_quantize",
        "vector vector, subvector_dimensions integer, codebooks jsonb",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "product_reconstruct",
        "codes bytea, subvector_dimensions integer, codebooks jsonb",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "execute_query",
        "collection text, plan jsonb",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "query",
        "collection text, vector vector, text_query text, lexical_source text, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "query",
        "collection text, vector vector, sparse_vector_name text, sparse_query sparsevec, \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "query_discover",
        "context_point_ids bigint[], \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "query_formula",
        "branch jsonb, formula text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "set_embedding_profile_lifecycle",
        "collection text, profile_name text, lifecycle text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "embedding_profile_coverage",
        "collection text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "query_multi_model",
        "collection text, branches jsonb, filter jsonb, \"limit\" integer, rrf_k integer, unique_candidate_budget integer, require_all_profiles boolean",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "vector_prefix",
        "vector vector, dimensions integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "query_fuzzy",
        "source text, query text, mode text, threshold double precision, filter jsonb, \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "query_lexical",
        "source text, query jsonb, filter jsonb, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "query_late_interaction",
        "query_vectors vector[], candidates_per_query integer, \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("query_lookup", "point_ids bigint[]", SqlLifecycle::Stable),
    SqlContractObject::function(
        "query_nearest",
        "vector vector, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "query_nearest",
        "vector_name text, vector vector, filter jsonb, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "query_sparse_nearest",
        "vector_name text, vector sparsevec, \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "query_sparse_nearest",
        "vector_name text, vector sparsevec, filter jsonb, \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("query_prefetch", "branches jsonb[]", SqlLifecycle::Stable),
    SqlContractObject::function(
        "query_prefetch",
        "branches jsonb[], fusion text, rank_constant integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "query_external_rerank",
        "branch jsonb, model_revision bigint, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "query_topology_expand",
        "branch jsonb, max_depth integer, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "query_recommend",
        "positive_point_ids bigint[], negative_point_ids bigint[], \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "query_rerank",
        "branch jsonb, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "query_score_threshold",
        "branch jsonb, min_score double precision, max_score double precision",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "query_weight",
        "branch jsonb, weight double precision",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "recommend",
        "collection text, positive_point_ids bigint[], negative_point_ids bigint[], \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "recommend",
        "collection text, positive_vectors vector[], negative_vectors vector[], \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function("query_cohort_stats", "", SqlLifecycle::Stable),
    SqlContractObject::function("query_execution_stats", "", SqlLifecycle::Stable),
    SqlContractObject::function("query_telemetry_queue_stats", "", SqlLifecycle::Stable),
    SqlContractObject::function(
        "recall_check",
        "exact_point_ids bigint[], candidate_point_ids bigint[], min_recall double precision",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "request_build_cancel",
        "build_job_id bigint",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "retry_build_job",
        "build_job_id bigint",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "run_build_job",
        "build_job_id bigint, units_per_step bigint",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "record_query_stat",
        "collection text, cohort text, query_kind text, result_count bigint, candidate_count bigint, latency_ms double precision",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "record_query_stat",
        "collection text, cohort text, query_kind text, result_count bigint, candidates_considered bigint, rows_rechecked bigint, rows_pruned bigint, recall_threshold double precision, recall_achieved double precision, latency_ms double precision, lifecycle_state querylifecyclestate",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "register_filter_column",
        "collection_name text, filter_key text, column_name text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "register_jsonb_path",
        "collection_name text, filter_key text, column_name text, path text[]",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "register_vector",
        "collection_name text, vector_name text, vector_column text, dimensions integer, metric text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "register_sparse_vector",
        "collection_name text, vector_name text, vector_column text, dimensions integer, metric text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "scroll",
        "collection text, cursor text, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "scalar_quantize",
        "vector vector, min real, max real, levels integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "scalar_reconstruct",
        "codes bytea, min real, max real, levels integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("sparsevec", "input text", SqlLifecycle::Experimental),
    SqlContractObject::function("sparsevec_cmp", "\"left\" sparsevec, \"right\" sparsevec", SqlLifecycle::Internal),
    SqlContractObject::function(
        "sparsevec_dims",
        "vector sparsevec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("sparsevec_enforce_typmod", "vector sparsevec, typmod integer, _explicit boolean", SqlLifecycle::Internal),
    SqlContractObject::function("sparsevec_eq", "\"left\" sparsevec, \"right\" sparsevec", SqlLifecycle::Internal),
    SqlContractObject::function(
        "sparsevec_from_arrays",
        "indices integer[], \"values\" real[], dimensions integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "sparsevec_from_real_array",
        "\"values\" real[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "sparsevec_from_vector",
        "vector vector",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("sparsevec_ge", "\"left\" sparsevec, \"right\" sparsevec", SqlLifecycle::Internal),
    SqlContractObject::function("sparsevec_gt", "\"left\" sparsevec, \"right\" sparsevec", SqlLifecycle::Internal),
    SqlContractObject::function(
        "sparsevec_indices",
        "vector sparsevec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "sparsevec_inner_product",
        "\"left\" sparsevec, \"right\" sparsevec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "sparsevec_cosine_distance",
        "\"left\" sparsevec, \"right\" sparsevec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "sparsevec_l1_distance",
        "\"left\" sparsevec, \"right\" sparsevec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("sparsevec_le", "\"left\" sparsevec, \"right\" sparsevec", SqlLifecycle::Internal),
    SqlContractObject::function("sparsevec_typmod_in", "modifiers cstring[]", SqlLifecycle::Internal),
    SqlContractObject::function("sparsevec_typmod_out", "typmod integer", SqlLifecycle::Internal),
    SqlContractObject::function(
        "sparsevec_l2_distance",
        "\"left\" sparsevec, \"right\" sparsevec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "sparsevec_to_vector",
        "vector sparsevec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("sparsevec_lt", "\"left\" sparsevec, \"right\" sparsevec", SqlLifecycle::Internal),
    SqlContractObject::function("sparsevec_ne", "\"left\" sparsevec, \"right\" sparsevec", SqlLifecycle::Internal),
    SqlContractObject::function(
        "sparsevec_negative_inner_product",
        "\"left\" sparsevec, \"right\" sparsevec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "sparsevec_avg_final",
        "state real[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "sparsevec_sum_final",
        "state real[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "sparsevec_sum_transition",
        "state real[], value sparsevec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "sparsevec_to_real_array",
        "vector sparsevec",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "sparsevec_values",
        "vector sparsevec",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "search",
        "collection text, vector vector, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "search",
        "collection text, vector_name text, vector vector, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "search",
        "collection text, vector vector, filter text, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "search",
        "collection text, vector_name text, vector vector, filter text, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "search",
        "collection text, vector vector, candidate_point_ids bigint[], \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "search",
        "collection text, vector_name text, vector vector, candidate_point_ids bigint[], \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "search",
        "collection text, vector vector, filter text, candidate_point_ids bigint[], \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "search",
        "collection text, vector_name text, vector vector, filter text, candidate_point_ids bigint[], \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "set_payload",
        "collection_name text, source_keys text[], payload jsonb",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "search",
        "query vector, point_ids bigint[], vectors vector[], metric text, \"limit\" integer",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "search_sparse",
        "query sparsevec, point_ids bigint[], vectors sparsevec[], metric text, \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("artifact_segments", "collection text", SqlLifecycle::Experimental),
    SqlContractObject::function("artifact_segment_memory", "collection text", SqlLifecycle::Experimental),
    SqlContractObject::function("artifact_segment_diagnostics", "collection text", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "artifact_segment_serving_readiness",
        "collection text, max_mapped_bytes bigint",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "artifact_segment_mmap_payload",
        "collection text, artifact_name text, max_mapped_bytes bigint",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "search_mmap_hnsw_artifact",
        "collection text, artifact_name text, vector vector, max_mapped_bytes bigint, candidate_limit integer, \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("cleanup_artifact_segments", "collection text, dry_run boolean", SqlLifecycle::Experimental),
    SqlContractObject::function("retire_artifact_segment", "artifact_id bigint", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "search_sparse",
        "collection text, vector_name text, query sparsevec, \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "search_sparse",
        "collection text, vector_name text, query sparsevec, filter text, \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "rerank_quantized_candidates",
        "query vector, point_ids bigint[], original_vectors vector[], metric text, \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("publish_artifact_segment", "build_job_id bigint, segment bytea", SqlLifecycle::Experimental),
    SqlContractObject::function("publish_artifact_segment_file", "build_job_id bigint, segment bytea", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "rerank_late_interaction",
        "query_vectors vector[], point_ids bigint[], candidate_vectors vector[], candidate_offsets integer[], \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "search_late_interaction",
        "collection text, query_vectors vector[], vector_column text, \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("search_late_interaction_ann", "collection text, query_vectors vector[], vector_column text, token_table text, token_source_key_column text, token_vector_column text, candidates_per_query integer, \"limit\" integer", SqlLifecycle::Experimental),
    SqlContractObject::function("encode_artifact_segment", "kind text, payload bytea", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "validate_hnsw_graph_artifact",
        "segment bytea",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "explain_sparse",
        "collection text, vector_name text, query sparsevec, \"limit\" integer",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "explain_late_interaction",
        "collection text, query_vectors vector[], vector_column text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("explain_late_interaction_ann", "collection text, query_vectors vector[], vector_column text, token_table text, token_source_key_column text, token_vector_column text, candidates_per_query integer", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "start_build_job",
        "collection text, artifact_kind text, artifact_name text, target_name text, total_units bigint",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "enqueue_build_job",
        "collection text, job_kind text, publication_alias text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "enqueue_hnsw_compaction",
        "collection text, index regclass",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("telemetry", "", SqlLifecycle::Stable),
    SqlContractObject::function(
        "update_build_job",
        "build_job_id bigint, processed_units bigint, status text, error_message text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "update_embedding_migration",
        "migration_id bigint, processed_points bigint, status text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("validate_artifact_segment", "segment bytea", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "wake_build_jobs",
        "collection text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "upsert_points",
        "collection_name text, source_keys text[]",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function("vacuum_advice", "index_name text", SqlLifecycle::Stable),
    SqlContractObject::function("vector_avg_final", "state real[]", SqlLifecycle::Internal),
    SqlContractObject::function(
        "vector_cmp",
        "\"left\" vector, \"right\" vector",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("vector_dims", "vector vector", SqlLifecycle::Stable),
    SqlContractObject::function(
        "vector_enforce_typmod",
        "vector vector, typmod integer, _explicit boolean",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "vector_eq",
        "\"left\" vector, \"right\" vector",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "vector_from_double_array",
        "\"values\" double precision[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "vector_from_integer_array",
        "\"values\" integer[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "vector_from_real_array",
        "\"values\" real[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "vector_ge",
        "\"left\" vector, \"right\" vector",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "vector_gt",
        "\"left\" vector, \"right\" vector",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "vector_le",
        "\"left\" vector, \"right\" vector",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "vector_lt",
        "\"left\" vector, \"right\" vector",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "vector_ne",
        "\"left\" vector, \"right\" vector",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("vector_sum_final", "state real[]", SqlLifecycle::Internal),
    SqlContractObject::function(
        "vector_sum_transition",
        "state real[], value vector",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "vector_to_real_array",
        "vector vector",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("vector_typmod_in", "modifiers cstring[]", SqlLifecycle::Internal),
    SqlContractObject::function("vector_typmod_out", "typmod integer", SqlLifecycle::Internal),
    // Functions added after the registry was first frozen. The classification
    // test that enforces this list sat outside the old gate filter, so these
    // accumulated without a lifecycle decision; classified retroactively.
    SqlContractObject::function("_capture_build_point_delta", "", SqlLifecycle::Internal),
    SqlContractObject::function(
        "_initialize_collection_source_revision",
        "",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "attach_fuzzy_index",
        "collection text, source_name text, index_name text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "attach_lexical_index",
        "collection text, source_name text, index_name text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "create_fuzzy_index",
        "collection text, source_name text, method text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "create_lexical_index",
        "collection text, source_name text, method text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "detach_fuzzy_index",
        "collection text, source_name text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "detach_lexical_index",
        "collection text, source_name text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "drop_fuzzy_source",
        "collection text, source_name text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "drop_lexical_source",
        "collection text, source_name text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "fuzzy_sources",
        "collection text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "lexical_headline",
        "collection text, source_name text, point_ids bigint[], query jsonb, options text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "lexical_sources",
        "collection text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "refresh_lexical_catalog",
        "collection text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "register_fuzzy_source",
        "collection text, source_name text, text_column text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "register_lexical_document_source",
        "collection text, source_name text, document_column text, text_configuration text, ranker text, normalization integer, rank_weights real[]",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "register_lexical_source",
        "collection text, source_name text, text_columns text[], text_configuration text, field_weights text[], json_paths text[], ranker text, normalization integer, rank_weights real[]",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "register_lexical_tsquery",
        "collection text, source_name text, tsquery_name text, tsquery_column text",
        SqlLifecycle::Stable,
    ),
    SqlContractObject::function(
        "_require_collection_owner",
        "p_collection_id bigint",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_register_lexical_source",
        "p_collection_id bigint, p_source_name text, p_document_mode text, p_stored_vector_column text, p_configuration_schema text, p_configuration_name text, p_ranker text, p_normalization integer, p_rank_weights real[], p_columns text[], p_weights text[], p_json_paths text[]",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_register_lexical_tsquery",
        "p_collection_id bigint, p_source_name text, p_tsquery_name text, p_column_name text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_attach_lexical_index",
        "p_collection_id bigint, p_source_name text, p_index_schema text, p_index_name text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_detach_lexical_index",
        "p_collection_id bigint, p_source_name text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_drop_lexical_source",
        "p_collection_id bigint, p_source_name text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_register_fuzzy_source",
        "p_collection_id bigint, p_source_name text, p_column_name text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_attach_fuzzy_index",
        "p_collection_id bigint, p_source_name text, p_index_schema text, p_index_name text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_detach_fuzzy_index",
        "p_collection_id bigint, p_source_name text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_drop_fuzzy_source",
        "p_collection_id bigint, p_source_name text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_refresh_lexical_catalog_oids",
        "p_collection_id bigint",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_set_embedding_profile_lifecycle",
        "p_collection_id bigint, p_profile_name text, p_lifecycle text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_refresh_collection_source_table",
        "p_collection_id bigint",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_refresh_vector_source_binding",
        "p_collection_id bigint, p_vector_column_name text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_refresh_sparse_vector_source_binding",
        "p_collection_id bigint, p_vector_name text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_refresh_payload_source_bindings",
        "p_collection_id bigint",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_cosine_distance_fast",
        "vector, vector",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_hnsw_candidates",
        "index_relation regclass, query vector, \"limit\" integer",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_hnsw_masked_candidates",
        "index_relation regclass, query vector, allowed_heap_tids anyarray, \"limit\" integer",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_hnsw_sparse_candidates",
        "index_relation regclass, query sparsevec, \"limit\" integer",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "_hnsw_sparse_masked_candidates",
        "index_relation regclass, query sparsevec, allowed_heap_tids anyarray, \"limit\" integer",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("_mapped_hnsw_sql_drop", "", SqlLifecycle::Internal),
    SqlContractObject::function("_l1_distance_fast", "vector, vector", SqlLifecycle::Internal),
    SqlContractObject::function("_l2_distance_fast", "vector, vector", SqlLifecycle::Internal),
    SqlContractObject::function("_l2_distance_fast8", "vector, vector", SqlLifecycle::Internal),
    SqlContractObject::function(
        "_negative_inner_product_fast",
        "vector, vector",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "attach_sparse_hnsw_index",
        "collection_name text, vector_name text, index_name text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "attach_hnsw_index",
        "collection_name text, vector_name text, index_name text",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "build_mmap_hnsw_artifact",
        "build_job_id bigint",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("compact", "index regclass", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "compact_ivfflat",
        "index regclass",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "_enqueue_ivfflat_compaction_debt",
        "index_oid oid, generation bigint",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "enqueue_ivfflat_compaction",
        "collection text, index regclass",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function(
        "_compact_hnsw_segment_pair",
        "index regclass, expected_directory_epoch bigint",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "current_vector_config_revision",
        "collection bigint",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function("hnsw_build_stats", "", SqlLifecycle::Experimental),
    SqlContractObject::function("hnsw_last_scan_work", "", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "ivfflat_index_info",
        "index regclass",
        SqlLifecycle::Experimental,
    ),
    SqlContractObject::function("ivfflat_last_scan_work", "", SqlLifecycle::Experimental),
    SqlContractObject::function("hnsw_serving_stats", "", SqlLifecycle::Experimental),
    SqlContractObject::function(
        "hnsw_segment_stats",
        "index regclass",
        SqlLifecycle::Experimental,
    ),
    // Failpoint setters exist only in pg_test builds; the classification test
    // that reads this registry runs only in those builds, so listing them
    // unconditionally keeps the const array length fixed without ever
    // claiming them against a production catalog.
    SqlContractObject::function(
        "test_set_artifact_publish_failpoint",
        "name text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "test_set_build_job_failpoint",
        "name text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "test_run_build_worker_step",
        "",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "test_stale_build_worker_attempt_is_fenced",
        "build_job_id bigint",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "test_set_hnsw_physical_failpoint",
        "name text",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "test_clear_hnsw_packed_cache",
        "",
        SqlLifecycle::Internal,
    ),
    SqlContractObject::function(
        "ivfflat_test_append_tombstone",
        "index regclass, tid tid",
        SqlLifecycle::Internal,
    ),
];
