83 lines
3.5 KiB
Gherkin
83 lines
3.5 KiB
Gherkin
Feature: Context Vector Search
|
|
As a developer
|
|
I want semantic context helpers validated
|
|
So that context-aware vector search stays reliable
|
|
|
|
Scenario: Refresh occurs after adding context when vector search is enabled
|
|
Given a context service with vector search enabled
|
|
And I have a vector context file "vector.md" with content:
|
|
"""
|
|
Vector content
|
|
"""
|
|
When I add the file "vector.md" to the vector-aware context
|
|
Then the vector index should have refreshed 1 time
|
|
|
|
Scenario: Refresh is skipped when vector search is disabled
|
|
Given a context service with vector search disabled
|
|
And I have a vector context file "vector.md" with content:
|
|
"""
|
|
Vector content
|
|
"""
|
|
When I add the file "vector.md" to the vector-aware context
|
|
Then the vector index should have refreshed 0 times
|
|
|
|
Scenario: Removing files triggers vector index refresh
|
|
Given a context service with vector search enabled
|
|
And I have a vector context file "remove.md" with content:
|
|
"""
|
|
Remove me
|
|
"""
|
|
When I add the file "remove.md" to the vector-aware context
|
|
And I remove the file "remove.md" from the vector-aware context
|
|
Then the vector index should have refreshed 2 times
|
|
|
|
Scenario: Clearing context triggers vector index refresh
|
|
Given a context service with vector search enabled
|
|
And I have a vector context file "clear.md" with content:
|
|
"""
|
|
Clear me
|
|
"""
|
|
When I add the file "clear.md" to the vector-aware context
|
|
And I clear the vector-aware context
|
|
Then the vector index should have refreshed 2 times
|
|
|
|
Scenario: Semantic search returns stubbed results when enabled
|
|
Given a context service with vector search enabled
|
|
And the vector store stub will return "doc.md" with score 0.9
|
|
When I search the context for "Need insight" with limit 1
|
|
Then the semantic search results should include "doc.md" with score 0.9
|
|
And the vector store query count should be 1
|
|
|
|
Scenario: Semantic search returns empty when disabled or blank
|
|
Given a context service with vector search disabled
|
|
When I search the context for "Need nothing" with limit 1
|
|
Then the semantic search results should be empty
|
|
And the vector store query count should be 0
|
|
When I search the context for " " with limit 1
|
|
Then the semantic search results should be empty
|
|
And the vector store query count should be 0
|
|
|
|
Scenario: Skip semantic search when the project lacks an identifier
|
|
Given a context service with vector search enabled
|
|
And the vector test project loses its identifier
|
|
When I search the context for "Untracked request" with limit 1
|
|
Then the semantic search results should be empty
|
|
And the vector store query count should be 0
|
|
|
|
Scenario: Continue after configuration error during vector refresh
|
|
Given a context service with vector search enabled
|
|
And the vector store refresh fails with configuration error
|
|
And I have a vector context file "refresh.md" with content:
|
|
"""
|
|
Trigger refresh failure
|
|
"""
|
|
When I add the file "refresh.md" to the vector-aware context
|
|
Then the vector index should have refreshed 1 time
|
|
|
|
Scenario: Continue after configuration error during semantic search
|
|
Given a context service with vector search enabled
|
|
And the vector store search fails with configuration error
|
|
When I search the context for "Diagnostic query" with limit 1
|
|
Then the semantic search results should be empty
|
|
And the vector store query count should be 1
|