search filters and inspection polish

This commit is contained in:
2026-04-26 00:04:19 +02:00
parent b8627c0e1d
commit 8d1e1ff583
6 changed files with 209 additions and 22 deletions

View File

@@ -137,6 +137,43 @@ def test_search_matches_features_and_evidence_with_context(tmp_path):
assert evidence_results[0].confidence == 0.9
def test_search_filters_by_status_language_and_framework(tmp_path):
source = tmp_path / "repo"
source.mkdir()
(source / "README.md").write_text("# Filterable\n", encoding="utf-8")
(source / "requirements.txt").write_text("fastapi\n", encoding="utf-8")
(source / "app.py").write_text(
"from fastapi import FastAPI\n"
"app = FastAPI()\n"
'@app.get("/health")\n'
"def health():\n"
" return {}\n",
encoding="utf-8",
)
service = make_service(tmp_path)
repository = service.register_repository(name="Filterable", url=str(source))
summary = service.analyze_repository(repository.id)
service.approve_candidate_graph(repository.id, summary.analysis_run.id)
results = service.search(
"repository",
status="indexed",
language="Python",
framework="FastAPI",
)
wrong_language_results = service.search(
"repository",
status="indexed",
language="TypeScript",
framework="FastAPI",
)
assert results
assert {result.repository_name for result in results} == {"Filterable"}
assert wrong_language_results == []
def test_register_repository_imports_metadata_when_name_is_omitted(tmp_path):
source = tmp_path / "metadata-source"
source.mkdir()