# AUTO-GENERATED by scripts/codegen_kernel_abi.py — DO NOT EDIT
# Source: rust/kernel/src/kernel.rs (PyKernel methods)

"""Auto-generated API surface groups for nexus_runtime version validation.

Used by nexus._rust_compat to validate the installed binary against the
expected API surface at import time.  Re-run: python scripts/codegen_kernel_abi.py
"""

from __future__ import annotations

# Module-level symbols grouped by capability area.
# Sourced from CAPABILITY_GROUP_CONFIG in scripts/codegen_kernel_abi.py.
MODULE_CAPABILITY_GROUPS: dict[str, tuple[str, ...]] = {
    "core": (
        "PyKernel",
        "normalize_path",
        "validate_path",
        "canonicalize_path",
        "extract_zone_id",
        "get_ancestors",
        "get_parent",
        "get_parent_chain",
        "parent_path",
        "path_matches_pattern",
        "split_path",
        "unscope_internal_path",
    ),
    "hash": (
        "hash_content_py",
        "hash_content_smart_py",
    ),
    "io": (
        "read_file",
        "read_files_bulk",
    ),
    "search": (
        "grep_bulk",
        "grep_files_mmap",
        "glob_match_bulk",
    ),
    "trigram": (
        "build_trigram_index",
        "build_trigram_index_from_entries",
        "invalidate_trigram_cache",
        "trigram_grep",
        "trigram_index_stats",
        "trigram_search_candidates",
    ),
    "rebac": (
        "compute_permission_single",
        "compute_permissions_bulk",
        "expand_subjects",
        "list_objects_for_subject",
    ),
    "storage": (
        "BloomFilter",
        "BlobPackEngine",
    ),
    "prefix": (
        "any_path_starts_with",
        "batch_prefix_check",
        "filter_paths_by_prefix",
    ),
    "tiger": (
        "any_path_accessible_tiger_cache",
        "check_permission_bitmap",
        "check_permission_bitmap_batch",
        "filter_paths_with_tiger_cache",
        "filter_paths_with_tiger_cache_parallel",
        "intersect_paths_with_tiger_cache",
        "tiger_cache_bitmap_stats",
    ),
}

# All public methods that must exist on nexus_runtime.PyKernel.
# Auto-derived from #[pymethods] in rust/kernel/src/kernel.rs.
# A stale binary missing any of these triggers an actionable ImportError.
KERNEL_REQUIRED_METHODS: frozenset[str] = frozenset(
    {
        "access",
        "agent_count",
        "agent_get",
        "agent_heartbeat",
        "agent_list",
        "agent_register",
        "agent_unregister",
        "agent_update_state",
        "agent_wait",
        "backend_fingerprint",
        "cas_delete",
        "cas_exists",
        "cas_is_chunked",
        "cas_read",
        "cas_size",
        "cas_write",
        "cas_write_partial",
        "close_all_pipes",
        "close_all_streams",
        "close_pipe",
        "close_stream",
        "create_pipe",
        "create_stream",
        "destroy_pipe",
        "destroy_stream",
        "dispatch_event",
        "dispatch_post_hooks",
        "dispatch_pre_hooks",
        "dispatch_pre_hooks_batch_stat",
        "exists_batch",
        "flush_due_write_buffer",
        "flush_observers",
        "flush_write_buffer",
        "get_all_hooks",
        "get_content_id",
        "get_mount_points",
        "get_post_hooks",
        "get_pre_hooks",
        "get_top_level_mounts",
        "get_xattr",
        "get_xattr_bulk",
        "get_zone_revision",
        "has_mount",
        "has_pipe",
        "has_stream",
        "hook_count",
        "increment_zone_revision",
        "is_directory",
        "kernel_observer_count",
        "kernel_unmount",
        "list_pipes",
        "list_streams",
        "llm_start_streaming",
        "match_watches",
        "metastore_list_locks",
        "metastore_list_paginated",
        "notify_zone_revision",
        "op_metadata_for_path",
        "permission_lease_invalidate_agent",
        "permission_lease_invalidate_all",
        "permission_lease_invalidate_path",
        "pipe_read_nowait",
        "pipe_write_nowait",
        "readdir",
        "readdir_paged",
        "register_hook",
        "register_watch",
        "release_metastores",
        "service_close_all",
        "service_enlist",
        "service_lookup",
        "service_mark_bootstrapped",
        "service_snapshot",
        "service_start_all",
        "service_stop_all",
        "service_swap",
        "service_unregister",
        "set_hook_count",
        "set_metastore_path",
        "set_permission_admin_bypass",
        "set_permission_provider",
        "set_self_address",
        "set_vfs_lock_timeout",
        "set_xattr",
        "start_write_buffer_flusher",
        "stat_batch",
        "stream_collect_all",
        "stream_read_at",
        "stream_read_batch",
        "stream_write_nowait",
        "sys_cat",
        "sys_copy",
        "sys_glob",
        "sys_grep",
        "sys_lock",
        "sys_mkdir",
        "sys_read",
        "sys_read_batch",
        "sys_read_raw",
        "sys_rename",
        "sys_setattr",
        "sys_stat",
        "sys_unlink",
        "sys_unlink_batch",
        "sys_unlock",
        "sys_watch",
        "sys_write",
        "sys_write_batch",
        "trie_len",
        "trie_lookup",
        "trie_register",
        "trie_unregister",
        "unregister_hook",
        "unregister_watch",
        "wait_zone_revision",
        "write",
    }
)
