feat: enhance search, ranking, reranker and CLI tooling across ccw and codex-lens

Major improvements to smart-search, chain-search cascade, ranking pipeline,
reranker factory, CLI history store, codex-lens integration, and uv-manager.
Simplify command-generator skill by inlining phases. Add comprehensive tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
catlog22
2026-03-16 20:35:08 +08:00
parent 1cd96b90e8
commit 5a4b18d9b1
73 changed files with 14684 additions and 2442 deletions

View File

@@ -98,6 +98,23 @@ class TestANNIndex:
assert ids[0] == 1 # ID of first vector
assert distances[0] < 0.01 # Very small distance (almost identical)
@pytest.mark.skipif(
not _hnswlib_available(),
reason="hnswlib not installed"
)
def test_search_clamps_top_k_to_available_vectors(self, temp_db, sample_vectors, sample_ids):
"""Search should clamp top_k to the loaded vector count."""
from codexlens.semantic.ann_index import ANNIndex
index = ANNIndex(temp_db, dim=384)
index.add_vectors(sample_ids[:3], sample_vectors[:3])
ids, distances = index.search(sample_vectors[0], top_k=10)
assert len(ids) == 3
assert len(distances) == 3
assert ids[0] == 1
@pytest.mark.skipif(
not _hnswlib_available(),
reason="hnswlib not installed"