Feature: FAISS ACMS vector backend
  As an ACMS maintainer
  I want the FAISS vector backend wired into the ACMS protocols
  So that semantic vector search can index and retrieve UKO resources

  Scenario: FAISS vector backends index and search embeddings with scope filtering
    Given the ACMS FAISS backend is configured to use fake embeddings
    And FAISS interactions are recorded for ACMS backends
    And an ACMS FAISS backend pair
    When I index ACMS embedding "uko:auth" in project "local/app" for resource "RES01" with vector "1.0,0.0"
    And I index ACMS embedding "uko:billing" in project "local/app" for resource "RES02" with vector "4.0,0.0"
    And I search ACMS vectors in project "local/app" for vector "1.1,0.0"
    Then the project vector search should include doc_id "uko:auth"
    When I search ACMS vectors scoped to resource "RES01" for vector "1.1,0.0"
    Then the scoped vector search should include uko_uri "uko:auth"
    When I search ACMS vectors scoped to resource "RES02" for vector "1.1,0.0"
    Then the scoped vector search should include uko_uri "uko:billing"

  Scenario: FAISS vector index backend removes embeddings
    Given the ACMS FAISS backend is configured to use fake embeddings
    And FAISS interactions are recorded for ACMS backends
    And an ACMS FAISS backend pair
    And I index ACMS embedding "uko:auth" in project "local/app" for resource "RES01" with vector "1.0,0.0"
    When I remove ACMS embedding "uko:auth" from project "local/app"
    Then project "local/app" should have 0 ACMS embeddings

  Scenario: ACMS FAISS backend uses embedding configuration from ConfigService
    Given the ACMS FAISS backend is configured to use fake embeddings
    And FAISS interactions are recorded for ACMS backends
    And an ACMS FAISS backend pair
    When I index ACMS embedding "uko:auth" in project "local/app" for resource "RES01" with vector "1.0,0.0"
    Then the ACMS embeddings provider should be FakeEmbeddings sized 8

  Scenario: DI container resolves FAISS vector backends when configured
    Given the ACMS FAISS backend is configured to use fake embeddings
    And FAISS interactions are recorded for ACMS backends
    When I resolve ACMS vector backends from the DI container
    Then the container vector backend should be a FAISSVectorBackend
    And the container index vector backend should be a FAISSVectorIndexBackend

  Scenario: DI container falls back when FAISS support is unavailable
    Given the ACMS FAISS backend is configured to use fake embeddings
    And FAISS is unavailable for ACMS backends
    When I resolve ACMS vector backends from the DI container
    Then the container vector backend should be an InMemoryVectorBackend
    And the container index vector backend should be an InMemoryVectorIndexBackend
