"""
FAISS Index Verifier - Integrity verification for FAISS vector indexes.

FAISS indexes should never be manually modified, making them ideal
candidates for strict integrity verification.
"""

from pathlib import Path

from ..base_verifier import BaseFileVerifier, FileType


class FAISSIndexVerifier(BaseFileVerifier):
    """
    Verifier for FAISS index files.

    Policy:
    - Verifies all .faiss files
    - Does not allow modifications (FAISS indexes are binary, should never be manually edited)
    - Uses default SHA256 checksum algorithm
    """

    def should_verify(self, file_path: Path) -> bool:
        """
        Check if this is a FAISS index file.

        Args:
            file_path: Path to check

        Returns:
            True if file has .faiss extension
        """
        return file_path.suffix.lower() == ".faiss"

    def get_file_type(self) -> FileType:
        """
        Get file type identifier.

        Returns:
            FileType.FAISS_INDEX
        """
        return FileType.FAISS_INDEX

    def allows_modifications(self) -> bool:
        """
        FAISS indexes should never be manually modified.

        Returns:
            False - FAISS indexes are binary and should only be generated programmatically
        """
        return False
