Deduplication

This commit is contained in:
2026-04-29 01:35:17 +02:00
parent 991c34ce52
commit 8bd22dab1b
5 changed files with 400 additions and 0 deletions

View File

@@ -641,6 +641,43 @@ def test_analyze_repository_can_disable_optional_llm_extractor(tmp_path):
assert all(decision.action != "llm_extraction_used" for decision in decisions)
def test_analyze_repository_normalizes_duplicate_llm_candidates(tmp_path):
source = tmp_path / "repo"
source.mkdir()
(source / "README.md").write_text(
"# LLM Connect\nSupports OpenRouter providers.\n",
encoding="utf-8",
)
store = RegistryStore(tmp_path / "registry.sqlite3")
store.initialize()
extractor = FakeLLMExtractor(
[
ExtractedAbility(
name="LLM Provider Integration",
description="Connects to model providers.",
source_paths=["README.md"],
),
ExtractedAbility(
name="LLM Provider Integrations",
description="Connects prompts to OpenRouter providers.",
source_paths=["README.md"],
),
]
)
service = RegistryService(
store,
ingestion=GitIngestionService(tmp_path / "checkouts"),
llm_extractor=extractor,
)
repository = service.register_repository(name="LLM Connect", url=str(source))
summary = service.analyze_repository(repository.id)
graph = service.candidate_graph(repository.id, summary.analysis_run.id)
assert len(graph.abilities) == 1
assert graph.abilities[0].name == "LLM Provider Integrations"
def test_analyze_repository_falls_back_when_optional_llm_extractor_returns_no_candidates(tmp_path):
source = tmp_path / "repo"
source.mkdir()