Feature: Semantic context search using embeddings As a context assembly system I want to use semantic embeddings to find relevant files So that I can select the most semantically relevant context fragments Background: Given I have a semantic context strategy with embeddings And I have a mock embedding provider Scenario: Embed text fragments When I embed the text "Python function definition" Then the embedding should have 10 dimensions And the embedding should be a valid vector Scenario: Compute cosine similarity between embeddings Given I have two text embeddings When I compute their cosine similarity Then the similarity should be between -1 and 1 Scenario: Rank fragments by semantic similarity Given I have context fragments with content: | content | | Python function definition | | JavaScript class syntax | | Python class implementation| And I have a query "Python code structure" When I rank fragments by semantic similarity to the query Then the Python fragments should rank higher than JavaScript Scenario: Filter fragments by minimum similarity threshold Given I have context fragments with content: | content | | Python function definition | | Unrelated database schema | | Python class implementation| And I have a query "Python code" And I have a minimum similarity threshold of 0.3 When I filter fragments by similarity threshold Then only semantically similar fragments should be included Scenario: Semantic strategy selects relevant files Given I have a semantic context strategy And I have context fragments: | uko_node | content | token_count | | file1.py | Python function definition | 10 | | file2.js | JavaScript class syntax | 10 | | file3.py | Python class implementation| 10 | And I have a context budget of 30 tokens When I assemble semantic context with query "Python code structure" Then the selected fragments should include Python files And the selected fragments should be ranked by relevance Scenario: Embedding provider configuration Given I have an embedding provider configuration When I create a semantic strategy with the configuration Then the strategy should use the configured embedding provider And the strategy should report semantic search capability